• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java WindowManagerEx类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.wm.ex.WindowManagerEx的典型用法代码示例。如果您正苦于以下问题:Java WindowManagerEx类的具体用法?Java WindowManagerEx怎么用?Java WindowManagerEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



WindowManagerEx类属于com.intellij.openapi.wm.ex包,在下文中一共展示了WindowManagerEx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: centerOnIdeFrameOrScreen

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
private void centerOnIdeFrameOrScreen(@NotNull AnActionEvent actionEvent) {
    WindowManagerEx windowManager = WindowManagerEx.getInstanceEx();
    IdeFrame frame = windowManager.getFrame(actionEvent.getProject());
    int x = 0;
    int y = 0;
    if (frame != null) {
        Component frameComponent = frame.getComponent();
        if (frameComponent != null) {
            Point origin = frameComponent.getLocationOnScreen();
            x = (int)(origin.getX() + (frameComponent.getWidth() - this.getWidth()) / 2);
            y = (int)(origin.getY() + (frameComponent.getHeight() - this.getHeight()) / 2);
        }
    }
    else {
        Rectangle screenBounds = windowManager.getScreenBounds();
        x = (int)(screenBounds.getX()  + (screenBounds.getWidth() - this.getWidth()) / 2);
        y = (int)(screenBounds.getY() + (screenBounds.getHeight() - this.getHeight()) / 2);
    }
    this.setLocation(x, y);
}
 
开发者ID:dyadix,项目名称:typengo,代码行数:21,代码来源:CommandInputForm.java


示例2: showPopup

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
protected void showPopup(DataContext context, ListPopup popup, JComponent contextComponent) {
  Component focusedComponent = contextComponent != null ? contextComponent : PlatformDataKeys.CONTEXT_COMPONENT.getData(context);
  if (focusedComponent != null) {
    if (popup instanceof PopupFactoryImpl.ActionGroupPopup && focusedComponent instanceof JLabel) {
      ((PopupFactoryImpl.ActionGroupPopup)popup).showUnderneathOfLabel((JLabel)focusedComponent);
    } else {
      popup.showUnderneathOf(focusedComponent);
    }
  }
  else {
    Rectangle r;
    int x;
    int y;
    focusedComponent = WindowManagerEx.getInstanceEx().getFocusedComponent((Project)null);
    r = WindowManagerEx.getInstanceEx().getScreenBounds();
    x = r.x + r.width / 2;
    y = r.y + r.height / 2;
    Point point = new Point(x, y);
    SwingUtilities.convertPointToScreen(point, focusedComponent.getParent());

    popup.showInScreenCoordinates(focusedComponent.getParent(), point);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:WelcomePopupAction.java


示例3: show

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
public final void show(){
  setFocusableWindowState(myInfo.isActive());

  super.show();
  final UISettings uiSettings=UISettings.getInstance();
  if(uiSettings.ENABLE_ALPHA_MODE){
    final WindowManagerEx windowManager=WindowManagerEx.getInstanceEx();
    windowManager.setAlphaModeEnabled(this,true);
    if(myInfo.isActive()){
      windowManager.setAlphaModeRatio(this,0.0f);
    }else{
      windowManager.setAlphaModeRatio(this,uiSettings.ALPHA_MODE_RATIO);
    }
  }
  paint(getGraphics()); // This prevents annoying flick

  setFocusableWindowState(true);

  uiSettings.addUISettingsListener(myUISettingsListener, myDelayAlarm);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:FloatingDecorator.java


示例4: createNotification

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
public static Notification createNotification(@NotNull final String groupDisplayId, @Nullable NotificationListener listener) {

    final String productName = ApplicationNamesInfo.getInstance().getProductName();

    Window recentFocusedWindow = WindowManagerEx.getInstanceEx().getMostRecentFocusedWindow();

    String text =
      "<html>We have found out that you are using a non-english keyboard layout. You can <a href='enable'>enable</a> smart layout support for " +
      KeyboardSettingsExternalizable.getDisplayLanguageNameForComponent(recentFocusedWindow) + " language." +
      "You can change this option in the settings of " + productName + " <a href='settings'>more...</a></html>";

    String title = "Enable smart keyboard internalization for " + productName + ".";

    return new Notification(groupDisplayId, title,
                            text,
                            NotificationType.INFORMATION,
                            listener);
  }
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:KeyboardInternationalizationNotificationManager.java


示例5: hyperlinkUpdate

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
  if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    final String description = event.getDescription();
    if ("enable".equals(description)) {
      KeyboardSettingsExternalizable.getInstance().setNonEnglishKeyboardSupportEnabled(true);
    }
    else if ("settings".equals(description)) {
      final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
      IdeFrame ideFrame = WindowManagerEx.getInstanceEx().findFrameFor(null);
      //util.editConfigurable((JFrame)ideFrame, new StatisticsConfigurable(true));
      util.showSettingsDialog(ideFrame.getProject(), KeymapPanel.class);
    }

    NotificationsConfiguration.getNotificationsConfiguration().changeSettings(LOCALIZATION_GROUP_DISPLAY_ID, NotificationDisplayType.NONE, false, false);
    notification.expire();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:KeyboardInternationalizationNotificationManager.java


示例6: noIntersections

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
private boolean noIntersections(Rectangle bounds) {
  Window owner = SwingUtilities.getWindowAncestor(myComponent);
  Window popup = SwingUtilities.getWindowAncestor(myTipComponent);
  Window focus = WindowManagerEx.getInstanceEx().getMostRecentFocusedWindow();
  boolean focused = SystemInfo.isWindows || owner.isFocused();
  for (Window other : owner.getOwnedWindows()) {
    if (!focused && !SystemInfo.isWindows) {
      focused = other.isFocused();
    }
    if (popup != other && other.isVisible() && bounds.x + 10 >= other.getX() && bounds.intersects(other.getBounds())) {
      return false;
    }
    if (focus == other) {
      focus = null; // already checked
    }
  }
  return focused && (focus == owner || focus == null || !owner.getBounds().intersects(focus.getBounds()));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:AbstractExpandableItemsHandler.java


示例7: hasFocus2

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
/**
 * @return true if window ancestor of component was most recent focused window and most recent focused component
 * in that window was descended from component
 */
public static boolean hasFocus2(Component component) {
  WindowManagerEx windowManager = WindowManagerEx.getInstanceEx();
  Window activeWindow=null;
  if (windowManager != null) {
    activeWindow = windowManager.getMostRecentFocusedWindow();
  }
  if(activeWindow==null){
    return false;
  }
  Component focusedComponent = windowManager.getFocusedComponent(activeWindow);
  if (focusedComponent == null) {
    return false;
  }

  return SwingUtilities.isDescendingFrom(focusedComponent, component);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:IJSwingUtilities.java


示例8: projectOpened

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
@Override
public void projectOpened() {
  myIdeFrame = ((WindowManagerEx)myWindowManager).getFrame(myProject);
  myProject.getMessageBus().connect(myProject).subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new FileEditorManagerAdapter() {
    @Override
    public void selectionChanged(@NotNull FileEditorManagerEvent event) {
      if (myIdeFrame == null || myIdeFrame.getFocusOwner() == null) return;
      setActiveWindow(myIdeFrame);
    }
  });

  final MyEditorFactoryListener myEditorFactoryListener = new MyEditorFactoryListener();
  myEditorFactory.addEditorFactoryListener(myEditorFactoryListener,myProject);
  Disposer.register(myProject, new Disposable() {
    @Override
    public void dispose() {
      myEditorFactoryListener.executeOnRelease(null);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:EditorTracker.java


示例9: showPopup

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
protected void showPopup(DataContext context, ListPopup popup, JComponent contextComponent) {
  Component focusedComponent = contextComponent != null ? contextComponent : PlatformDataKeys.CONTEXT_COMPONENT.getData(context);
  if (focusedComponent != null) {
    popup.showUnderneathOf(focusedComponent);
  }
  else {
    Rectangle r;
    int x;
    int y;
    focusedComponent = WindowManagerEx.getInstanceEx().getFocusedComponent((Project)null);
    r = WindowManagerEx.getInstanceEx().getScreenBounds();
    x = r.x + r.width / 2;
    y = r.y + r.height / 2;
    Point point = new Point(x, y);
    SwingUtilities.convertPointToScreen(point, focusedComponent.getParent());

    popup.showInScreenCoordinates(focusedComponent.getParent(), point);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:WelcomePopupAction.java


示例10: show

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
/**
 * Shows the hint as the window.
 */
@Override
public void show(@NotNull JComponent parentComponent, int x, int y, @Nullable JComponent focusBackComponent, @Nullable HintHint hh) {
  myParentComponent = parentComponent;
  LOG.assertTrue(parentComponent.isShowing());

  Window windowAncestor = SwingUtilities.getWindowAncestor(parentComponent);
  LOG.assertTrue(windowAncestor != null);

  myWindow = new JWindow(windowAncestor);
  myWindow.setFocusableWindowState(myFocusableWindowState);
  WindowManagerEx.getInstanceEx().setWindowShadow(myWindow, WindowManagerEx.WindowShadowMode.DISABLED);

  myWindow.getContentPane().setLayout(new BorderLayout());
  myWindow.getContentPane().add(myComponent, BorderLayout.CENTER);

  updateBounds(x, y);
  myWindow.setVisible(true);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:22,代码来源:HeavyweightHint.java


示例11: updateMaskAndAlpha

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
private Window updateMaskAndAlpha(Window window) {
  if (window == null) return window;

  final WindowManagerEx wndManager = getWndManager();
  if (wndManager == null) return window;

  if (!wndManager.isAlphaModeEnabled(window)) return window;

  if (myAlpha != myLastAlpha) {
    wndManager.setAlphaModeRatio(window, myAlpha);
    myLastAlpha = myAlpha;
  }

  if (myMaskProvider != null) {
    final Dimension size = window.getSize();
    Shape mask = myMaskProvider.getMask(size);
    wndManager.setWindowMask(window, mask);
  }

  WindowManagerEx.WindowShadowMode mode =
    myShadowed ? WindowManagerEx.WindowShadowMode.NORMAL : WindowManagerEx.WindowShadowMode.DISABLED;
  WindowManagerEx.getInstanceEx().setWindowShadow(window, mode);

  return window;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:AbstractPopup.java


示例12: update

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
private static void update() {
  UISettings.getInstance().fireUISettingsChanged();
  EditorFactory.getInstance().refreshAllEditors();

  Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
  for (Project openProject : openProjects) {
    FileStatusManager.getInstance(openProject).fileStatusesChanged();
    DaemonCodeAnalyzer.getInstance(openProject).restart();
  }
  for (IdeFrame frame : WindowManagerEx.getInstanceEx().getAllProjectFrames()) {
    if (frame instanceof IdeFrameImpl) {
      ((IdeFrameImpl)frame).updateView();
    }
  }
  //Editor[] editors = EditorFactory.getInstance().getAllEditors();
  //for (Editor editor : editors) {
  //  ((EditorEx)editor).reinitSettings();
  //}
  ActionToolbarImpl.updateAllToolbarsImmediately();

  restart(); //todo[kb] remove when get fixed ToolbarDecorator and toolwindow tabs
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:DarculaInstaller.java


示例13: projectOpened

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
@Override
public void projectOpened() {
  myIdeFrame = ((WindowManagerEx)myWindowManager).getFrame(myProject);
  myProject.getMessageBus().connect(myProject).subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, new FileEditorManagerAdapter() {
    @Override
    public void selectionChanged(@NotNull FileEditorManagerEvent event) {
      if (myIdeFrame == null || myIdeFrame.getFocusOwner() == null) return;
      setActiveWindow(myIdeFrame);
    }
  });

  final MyEditorFactoryListener myEditorFactoryListener = new MyEditorFactoryListener();
  myEditorFactory.addEditorFactoryListener(myEditorFactoryListener,myProject);
  Disposer.register(myProject, new Disposable() {
    @Override
    public void dispose() {
      myEditorFactoryListener.dispose(null);
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:EditorTracker.java


示例14: updateShowDialogSetting

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
public static void updateShowDialogSetting(LayoutCodeDialog dialog, String title) {
  if (dialog.isDoNotAskMe()) {
    Notifications.Bus.notify(new Notification("Reformat Code", title,
                                              "<html>You can re-enable the dialog on the <a href=''>IDE Settings -> Editor</a> pane</html>",
                                              NotificationType.INFORMATION, new NotificationListener() {
        @Override
        public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
          if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
            final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
            IdeFrame ideFrame = WindowManagerEx.getInstanceEx().findFrameFor(null);
            util.editConfigurable((JFrame)ideFrame, new EditorOptions());
          }
        }
      }));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:ReformatCodeAction.java


示例15: showPopup

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
protected void showPopup(DataContext context, ListPopup popup, JComponent contextComponent) {
  Component focusedComponent = contextComponent != null ? contextComponent : context.getData(PlatformDataKeys.CONTEXT_COMPONENT);
  if (focusedComponent != null) {
    if (popup instanceof PopupFactoryImpl.ActionGroupPopup && focusedComponent instanceof JLabel) {
      ((PopupFactoryImpl.ActionGroupPopup)popup).showUnderneathOfLabel((JLabel)focusedComponent);
    } else {
      popup.showUnderneathOf(focusedComponent);
    }
  }
  else {
    Rectangle r;
    int x;
    int y;
    focusedComponent = WindowManagerEx.getInstanceEx().getFocusedComponent((Project)null);
    r = WindowManagerEx.getInstanceEx().getScreenBounds();
    x = r.x + r.width / 2;
    y = r.y + r.height / 2;
    Point point = new Point(x, y);
    SwingUtilities.convertPointToScreen(point, focusedComponent.getParent());

    popup.showInScreenCoordinates(focusedComponent.getParent(), point);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:WelcomePopupAction.java


示例16: IdeMenuBar

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
public IdeMenuBar(ActionManagerEx actionManager, DataManager dataManager) {
  myActionManager = actionManager;
  myTimerListener = new MyTimerListener();
  myVisibleActions = new ArrayList<AnAction>();
  myNewVisibleActions = new ArrayList<AnAction>();
  myPresentationFactory = new MenuItemPresentationFactory();
  myDataManager = dataManager;

  if (WindowManagerEx.getInstanceEx().isFloatingMenuBarSupported()) {
    myAnimator = new MyAnimator();
    myActivationWatcher = new Timer(100, new MyActionListener());
    myClockPanel = new ClockPanel();
    myButton = new MyExitFullScreenButton();
    add(myClockPanel);
    add(myButton);
    addPropertyChangeListener(WindowManagerEx.FULL_SCREEN, evt -> updateState());
    addMouseListener(new MyMouseListener());
  }
  else {
    myAnimator = null;
    myActivationWatcher = null;
    myClockPanel = null;
    myButton = null;
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:IdeMenuBar.java


示例17: createNotification

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
public static Notification createNotification(@Nonnull final String groupDisplayId, @Nullable NotificationListener listener) {

    final String productName = ApplicationNamesInfo.getInstance().getProductName();

    Window recentFocusedWindow = WindowManagerEx.getInstanceEx().getMostRecentFocusedWindow();

    String text =
            "<html>We have found out that you are using a non-english keyboard layout. You can <a href='enable'>enable</a> smart layout support for " +
            KeyboardSettingsExternalizable.getDisplayLanguageNameForComponent(recentFocusedWindow) + " language." +
            "You can change this option in the settings of " + productName + " <a href='settings'>more...</a></html>";

    String title = "Enable smart keyboard internalization for " + productName + ".";

    return new Notification(groupDisplayId, title,
                            text,
                            NotificationType.INFORMATION,
                            listener);
  }
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:KeyboardInternationalizationNotificationManager.java


示例18: hyperlinkUpdate

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
@Override
public void hyperlinkUpdate(@Nonnull Notification notification, @Nonnull HyperlinkEvent event) {
  if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    final String description = event.getDescription();
    if ("enable".equals(description)) {
      KeyboardSettingsExternalizable.getInstance().setNonEnglishKeyboardSupportEnabled(true);
    }
    else if ("settings".equals(description)) {
      final ShowSettingsUtil util = ShowSettingsUtil.getInstance();
      IdeFrame ideFrame = WindowManagerEx.getInstanceEx().findFrameFor(null);
      //util.editConfigurable((JFrame)ideFrame, new StatisticsConfigurable(true));
      util.showSettingsDialog(ideFrame.getProject(), KeymapPanel.class);
    }

    NotificationsConfiguration.getNotificationsConfiguration().changeSettings(LOCALIZATION_GROUP_DISPLAY_ID, NotificationDisplayType.NONE, false, false);
    notification.expire();
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:19,代码来源:KeyboardInternationalizationNotificationManager.java


示例19: noIntersections

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
private boolean noIntersections(Rectangle bounds) {
  Window owner = SwingUtilities.getWindowAncestor(myComponent);
  Window popup = SwingUtilities.getWindowAncestor(myTipComponent);
  Window focus = WindowManagerEx.getInstanceEx().getMostRecentFocusedWindow();
  if (focus == owner.getOwner()) {
    focus = null; // do not check intersection with parent
  }
  boolean focused = SystemInfo.isWindows || owner.isFocused();
  for (Window other : owner.getOwnedWindows()) {
    if (!focused && !SystemInfo.isWindows) {
      focused = other.isFocused();
    }
    if (popup != other && other.isVisible() && bounds.x + 10 >= other.getX() && bounds.intersects(other.getBounds())) {
      return false;
    }
    if (focus == other) {
      focus = null; // already checked
    }
  }
  return focused && (focus == owner || focus == null || !owner.getBounds().intersects(focus.getBounds()));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:AbstractExpandableItemsHandler.java


示例20: updateMaskAndAlpha

import com.intellij.openapi.wm.ex.WindowManagerEx; //导入依赖的package包/类
private Window updateMaskAndAlpha(Window window) {
  if (window == null) return null;

  if (!window.isDisplayable() || !window.isShowing()) return window;

  final WindowManagerEx wndManager = getWndManager();
  if (wndManager == null) return window;

  if (!wndManager.isAlphaModeEnabled(window)) return window;

  if (myAlpha != myLastAlpha) {
    wndManager.setAlphaModeRatio(window, myAlpha);
    myLastAlpha = myAlpha;
  }

  if (myMaskProvider != null) {
    final Dimension size = window.getSize();
    Shape mask = myMaskProvider.getMask(size);
    wndManager.setWindowMask(window, mask);
  }

  WindowManagerEx.WindowShadowMode mode = myShadowed ? WindowManagerEx.WindowShadowMode.NORMAL : WindowManagerEx.WindowShadowMode.DISABLED;
  WindowManagerEx.getInstanceEx().setWindowShadow(window, mode);

  return window;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:27,代码来源:AbstractPopup.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java PolicyMapUtil类代码示例发布时间:2022-05-23
下一篇:
Java Connection类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap