当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationManagerEx.getApplicationEx方法代码示例

本文整理汇总了Java中com.intellij.openapi.application.ex.ApplicationManagerEx.getApplicationEx方法的典型用法代码示例。如果您正苦于以下问题:Java ApplicationManagerEx.getApplicationEx方法的具体用法?Java ApplicationManagerEx.getApplicationEx怎么用?Java ApplicationManagerEx.getApplicationEx使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.openapi.application.ex.ApplicationManagerEx的用法示例。


在下文中一共展示了ApplicationManagerEx.getApplicationEx方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: IdeErrorsDialog

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
public IdeErrorsDialog(MessagePool messagePool, @Nullable LogMessage defaultMessage) {
  super(JOptionPane.getRootFrame(), false);
  myMessagePool = messagePool;
  ApplicationEx app = ApplicationManagerEx.getApplicationEx();
  myInternalMode = app != null && app.isInternal();
  setTitle(DiagnosticBundle.message("error.list.title"));
  init();
  rebuildHeaders();
  if (defaultMessage == null || !moveSelectionToMessage(defaultMessage)) {
    moveSelectionToEarliestMessage();
  }
  setCancelButtonText(CommonBundle.message("close.action.name"));
  setModal(false);
  if (myInternalMode) {
    if (ourDevelopersList.isEmpty()) {
      loadDevelopersAsynchronously();
    } else {
      myDetailsTabForm.setDevelopers(ourDevelopersList);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:IdeErrorsDialog.java

示例2: apply

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
public void apply() throws ConfigurationException {
  final String applyMessage = myPluginManagerMain.apply();
  if (applyMessage != null) {
    throw new ConfigurationException(applyMessage);
  }

  if (myPluginManagerMain.isRequireShutdown()) {
    final ApplicationEx app = ApplicationManagerEx.getApplicationEx();

    int response = app.isRestartCapable() ? showRestartIDEADialog() : showShutDownIDEADialog();
    if (response == 0) {
      app.restart(true);
    }
    else {
      myPluginManagerMain.ignoreChanges();
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:PluginManagerConfigurable.java

示例3: notifyPluginsWereInstalled

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
private static void notifyPluginsWereInstalled(@Nullable String pluginName) {
  final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
  final boolean restartCapable = app.isRestartCapable();
  String message =
    restartCapable ? IdeBundle.message("message.idea.restart.required", ApplicationNamesInfo.getInstance().getFullProductName())
                   : IdeBundle.message("message.idea.shutdown.required", ApplicationNamesInfo.getInstance().getFullProductName());
  message += "<br><a href=";
  message += restartCapable ? "\"restart\">Restart now" : "\"shutdown\">Shutdown";
  message += "</a>";
  Notifications.Bus.notify(new Notification("Plugins Lifecycle Group",
                                            pluginName != null ? "Plugin \'" + pluginName + "\' was successfully installed" : "Plugins were installed",
                                            XmlStringUtil.wrapInHtml(message), NotificationType.INFORMATION,
                                            new NotificationListener() {
                                              @Override
                                              public void hyperlinkUpdate(@NotNull Notification notification,
                                                                          @NotNull HyperlinkEvent event) {
                                                notification.expire();
                                                if (restartCapable) {
                                                  app.restart(true);
                                                }
                                                else {
                                                  app.exit(true);
                                                }
                                              }
                                            }));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:ActionInstallPlugin.java

示例4: run

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
public void run(boolean newConfigFolder) {
  try {
    ApplicationEx app = ApplicationManagerEx.getApplicationEx();
    app.load(PathManager.getOptionsPath());

    if (myPostStarter.needStartInTransaction()) {
      ((TransactionGuardImpl)TransactionGuard.getInstance()).performUserActivity(() -> myPostStarter.main(newConfigFolder, myArgs));
    }
    else {
      myPostStarter.main(newConfigFolder, myArgs);
    }

    myPostStarter = null;

    ourLoaded = true;
  }
  catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:ApplicationStarter.java

示例5: apply

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
@Override
public void apply() throws ConfigurationException {
  final String applyMessage = myPluginManagerMain.apply();
  if (applyMessage != null) {
    throw new ConfigurationException(applyMessage);
  }

  if (myPluginManagerMain.isRequireShutdown()) {
    final ApplicationEx app = ApplicationManagerEx.getApplicationEx();

    int response = app.isRestartCapable() ? showRestartIDEADialog() : showShutDownIDEADialog();
    if (response == Messages.YES) {
      app.restart(true);
    }
    else {
      myPluginManagerMain.ignoreChanges();
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:PluginManagerConfigurable.java

示例6: notifyPluginsWereUpdated

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
public static void notifyPluginsWereUpdated(final String title, final Project project) {
  final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
  final boolean restartCapable = app.isRestartCapable();
  String message = restartCapable
                   ? IdeBundle.message("message.idea.restart.required", ApplicationNamesInfo.getInstance().getFullProductName())
                   : IdeBundle.message("message.idea.shutdown.required", ApplicationNamesInfo.getInstance().getFullProductName());
  message += "<br><a href=";
  message += restartCapable ? "\"restart\">Restart now" : "\"shutdown\">Shutdown";
  message += "</a>";
  new NotificationGroup("Plugins Lifecycle Group", NotificationDisplayType.STICKY_BALLOON, true)
          .createNotification(title, XmlStringUtil.wrapInHtml(message), NotificationType.INFORMATION, new NotificationListener() {
            @Override
            public void hyperlinkUpdate(@Nonnull Notification notification, @Nonnull HyperlinkEvent event) {
              notification.expire();
              if (restartCapable) {
                app.restart(true);
              }
              else {
                app.exit(true, true);
              }
            }
          }).notify(project);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:PluginManagerMain.java

示例7: updateConnection

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
private void updateConnection()
{
	final ApplicationEx app = ApplicationManagerEx.getApplicationEx();

	boolean value = PropertiesComponent.getInstance().getBoolean(KEY);
	if(value)
	{
		myConnection = app.getMessageBus().connect();
		myConnection.subscribe(ApplicationActivationListener.TOPIC, myListener);
	}
	else
	{
		if(myConnection != null)
		{
			myConnection.disconnect();
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:19,代码来源:UnscrambleManager.java

示例8: saveProject

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
public static void saveProject(Project project) {
  ApplicationEx application = ApplicationManagerEx.getApplicationEx();
  boolean oldValue = application.isDoNotSave();
  try {
    application.doNotSave(false);
    project.save();
  }
  finally {
    application.doNotSave(oldValue);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:PlatformTestUtil.java

示例9: restart

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
protected void restart() {
  final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
  // do not stack several modal dialogs (native & swing)
  app.invokeLater(new Runnable() {
    @Override
    public void run() {
      app.restart(true);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:AbstractUpdateDialog.java

示例10: createConfirmation

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
@NotNull
@Override
public ListPopup createConfirmation(String title,
                                    final String yesText,
                                    String noText,
                                    final Runnable onYes,
                                    final Runnable onNo,
                                    int defaultOptionIndex)
{

  final BaseListPopupStep<String> step = new BaseListPopupStep<String>(title, new String[]{yesText, noText}) {
    @Override
    public PopupStep onChosen(String selectedValue, final boolean finalChoice) {
      if (selectedValue.equals(yesText)) {
        onYes.run();
      }
      else {
        onNo.run();
      }
      return FINAL_CHOICE;
    }

    @Override
    public void canceled() {
      onNo.run();
    }

    @Override
    public boolean isMnemonicsNavigationEnabled() {
      return true;
    }
  };
  step.setDefaultOptionIndex(defaultOptionIndex);

  final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
  return app == null || !app.isUnitTestMode() ? new ListPopupImpl(step) : new MockConfirmation(step, yesText);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:PopupFactoryImpl.java

示例11: startup

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
public void startup() {
  if (myProjectPath == null) {
    logError("Project to inspect is not defined");
    printHelp();
  }

  if (myProfileName == null && myProfilePath == null && myStubProfile == null) {
    logError("Profile to inspect with is not defined");
    printHelp();
  }

  final ApplicationEx application = ApplicationManagerEx.getApplicationEx();
  application.runReadAction(new Runnable() {
    @Override
    public void run() {
      try {
        final ApplicationInfoEx applicationInfo = (ApplicationInfoEx)ApplicationInfo.getInstance();
        logMessage(1, InspectionsBundle.message("inspection.application.starting.up", applicationInfo.getFullApplicationName()));
        application.doNotSave();
        logMessageLn(1, InspectionsBundle.message("inspection.done"));

        InspectionApplication.this.run();
      }
      catch (Exception e) {
        LOG.error(e);
      }
      finally {
        if (myErrorCodeRequired) application.exit(true, true);
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:InspectionApplication.java

示例12: actionPerformed

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final ApplicationEx application = ApplicationManagerEx.getApplicationEx();
  String m = "Started loading content";
  LOG.info(m);
  System.out.println(m);
  long start = System.currentTimeMillis();

  count.set(0);
  totalSize.set(0);
  ApplicationManagerEx.getApplicationEx().runProcessWithProgressSynchronously(new Runnable() {
    @Override
    public void run() {
      PersistentFS vfs = (PersistentFS)application.getComponent(ManagingFS.class);
      VirtualFile[] roots = vfs.getRoots();
      for (VirtualFile root : roots) {
        iterateCached(root);
      }
    }
  }, "Loading", false, null);

  long end = System.currentTimeMillis();
  String message = "Finished loading content of " + count + " files. " +
                   "Total size=" + StringUtil.formatFileSize(totalSize.get()) + ". " +
                   "Elapsed=" + ((end - start) / 1000) + "sec.";
  LOG.info(message);
  System.out.println(message);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:LoadAllVfsStoredContentsAction.java

示例13: getInstance

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
public static synchronized IdeaTestApplication getInstance(@Nullable final String configPath) {
  if (ourInstance == null) {
    new IdeaTestApplication();
    PluginManager.getPlugins();
    final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
    new WriteAction() {
      protected void run(Result result) throws Throwable {
        app.load(configPath);
      }
    }.execute();
  }
  return (IdeaTestApplication)ourInstance;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:IdeaTestApplication.java

示例14: doOKAction

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
protected void doOKAction() {
  if (doDownloadAndPrepare() && isShowConfirmation()) {
    final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
    // do not stack several modal dialogs (native & swing)
    app.invokeLater(new Runnable() {
      @Override
      public void run() {
        app.restart(true);
      }
    });
  }
  super.doOKAction();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:AbstractUpdateDialog.java

示例15: run

import com.intellij.openapi.application.ex.ApplicationManagerEx; //导入方法依赖的package包/类
public void run() {
  try {
    ApplicationEx app = ApplicationManagerEx.getApplicationEx();
    app.load(PathManager.getOptionsPath());

    myStarter.main(myArgs);
    myStarter = null; //GC it

    myLoaded = true;
  }
  catch (Exception e) {
    throw new RuntimeException(e);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:IdeaApplication.java


注:本文中的com.intellij.openapi.application.ex.ApplicationManagerEx.getApplicationEx方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。