本文整理汇总了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);
}
}
}
示例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();
}
}
}
示例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);
}
}
}));
}
示例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);
}
}
示例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();
}
}
}
示例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);
}
示例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();
}
}
}
示例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);
}
}
示例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);
}
});
}
示例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);
}
示例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);
}
}
});
}
示例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);
}
示例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;
}
示例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();
}
示例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);
}
}