本文整理汇总了Java中com.intellij.openapi.wm.WindowManager.getInstance方法的典型用法代码示例。如果您正苦于以下问题:Java WindowManager.getInstance方法的具体用法?Java WindowManager.getInstance怎么用?Java WindowManager.getInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.wm.WindowManager
的用法示例。
在下文中一共展示了WindowManager.getInstance方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showDialog
import com.intellij.openapi.wm.WindowManager; //导入方法依赖的package包/类
/**
* Please, use {@link #showOkCancelDialog} or {@link #showYesNoCancelDialog} if possible (these dialogs implements native OS behavior)!
* @return number of button pressed: from 0 up to options.length-1 inclusive, or -1 for Cancel
*/
public static int showDialog(@Nullable Project project,
String message,
@NotNull @Nls(capitalization = Nls.Capitalization.Title) String title,
@NotNull String[] options,
int defaultOptionIndex,
@Nullable Icon icon,
@Nullable DialogWrapper.DoNotAskOption doNotAskOption) {
if (isApplicationInUnitTestOrHeadless()) {
return ourTestImplementation.show(message);
}
try {
if (canShowMacSheetPanel()) {
WindowManager windowManager = WindowManager.getInstance();
if (windowManager != null) {
Window parentWindow = windowManager.suggestParentWindow(project);
return MacMessages.getInstance()
.showMessageDialog(title, message, options, false, parentWindow, defaultOptionIndex, defaultOptionIndex, doNotAskOption);
}
}
}
catch (MessageException ignored) {/*rollback the message and show a dialog*/}
catch (Exception reportThis) {LOG.error(reportThis);}
return showIdeaMessageDialog(project, message, title, options, defaultOptionIndex, icon, doNotAskOption);
}
示例2: showStatusMessage
import com.intellij.openapi.wm.WindowManager; //导入方法依赖的package包/类
private static void showStatusMessage(Project project, int elementCount) {
final WindowManager windowManager = WindowManager.getInstance();
final StatusBar statusBar = windowManager.getStatusBar(project);
if (statusBar == null) {
return;
}
statusBar.setInfo(InspectionGadgetsBundle.message("unnecessary.fully.qualified.name.status.bar.escape.highlighting.message",
elementCount));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:UnnecessaryFullyQualifiedNameInspection.java
示例3: getInstanceEx
import com.intellij.openapi.wm.WindowManager; //导入方法依赖的package包/类
public static WindowManagerEx getInstanceEx(){
return (WindowManagerEx)WindowManager.getInstance();
}
示例4: main
import com.intellij.openapi.wm.WindowManager; //导入方法依赖的package包/类
@Override
public void main(String[] args) {
SystemDock.updateMenu();
// if OS has dock, RecentProjectsManager will be already created, but not all OS have dock, so, we trigger creation here to ensure that RecentProjectsManager app listener will be added
RecentProjectsManager.getInstance();
// Event queue should not be changed during initialization of application components.
// It also cannot be changed before initialization of application components because IdeEventQueue uses other
// application components. So it is proper to perform replacement only here.
final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
WindowManagerImpl windowManager = (WindowManagerImpl)WindowManager.getInstance();
IdeEventQueue.getInstance().setWindowManager(windowManager);
Ref<Boolean> willOpenProject = new Ref<Boolean>(Boolean.FALSE);
AppLifecycleListener lifecyclePublisher = app.getMessageBus().syncPublisher(AppLifecycleListener.TOPIC);
lifecyclePublisher.appFrameCreated(args, willOpenProject);
LOG.info("App initialization took " + (System.nanoTime() - PluginManager.startupStart) / 1000000 + " ms");
PluginManagerCore.dumpPluginClassStatistics();
if (JetBrainsProtocolHandler.getCommand() != null || !willOpenProject.get()) {
WelcomeFrame.showNow();
lifecyclePublisher.welcomeScreenDisplayed();
}
else {
windowManager.showFrame();
}
app.invokeLater(new Runnable() {
@Override
public void run() {
if (mySplash != null) {
mySplash.dispose();
mySplash = null; // Allow GC collect the splash window
}
}
}, ModalityState.NON_MODAL);
app.invokeLater(new Runnable() {
@Override
public void run() {
Project projectFromCommandLine = null;
if (myPerformProjectLoad) {
projectFromCommandLine = loadProjectFromExternalCommandLine();
}
final MessageBus bus = ApplicationManager.getApplication().getMessageBus();
bus.syncPublisher(AppLifecycleListener.TOPIC).appStarting(projectFromCommandLine);
//noinspection SSBasedInspection
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
PluginManager.reportPluginError();
}
});
//safe for headless and unit test modes
UsageTrigger.trigger(app.getName() + "app.started");
}
}, ModalityState.NON_MODAL);
}