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


Java IdeEventQueue.getInstance方法代码示例

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


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

示例1: applyActivationState

import com.intellij.ide.IdeEventQueue; //导入方法依赖的package包/类
private void applyActivationState() {
  boolean wasVisible = isVisible();
  boolean hasWork = getPainters().hasPainters() || getComponentCount() > 0;

  if (wasVisible != hasWork) {
    setVisible(hasWork);
  }

  IdeEventQueue queue = IdeEventQueue.getInstance();
  if (!queue.containsDispatcher(this) && (myPreprocessorActive || isVisible())) {
    queue.addDispatcher(this, null);
  }
  else if (queue.containsDispatcher(this) && !myPreprocessorActive && !isVisible()) {
    queue.removeDispatcher(this);
  }

  if (wasVisible != isVisible()) {
    revalidate();
    repaint();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:IdeGlassPaneImpl.java

示例2: applyActivationState

import com.intellij.ide.IdeEventQueue; //导入方法依赖的package包/类
private void applyActivationState() {
  boolean wasVisible = isVisible();

  if (wasVisible != myPaintingActive) {
    setVisible(myPaintingActive);
  }

  IdeEventQueue queue = IdeEventQueue.getInstance();
  if (!queue.containsDispatcher(this) && (myPreprocessorActive || isVisible())) {
    queue.addDispatcher(this, null);
  }
  else if (queue.containsDispatcher(this) && !myPreprocessorActive && !isVisible()) {
    queue.removeDispatcher(this);
  }

  if (wasVisible != isVisible()) {
    revalidate();
    repaint();
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:IdeGlassPaneImpl.java

示例3: processClose

import com.intellij.ide.IdeEventQueue; //导入方法依赖的package包/类
private void processClose(final MouseEvent e) {
  final IdeEventQueue queue = IdeEventQueue.getInstance();

  // See IDEA-59553 for rationale on why this feature is disabled
  //if (isLineNumbersShown()) {
  //  if (e.getX() >= getLineNumberAreaOffset() && getLineNumberAreaOffset() + getLineNumberAreaWidth() >= e.getX()) {
  //    queue.blockNextEvents(e);
  //    myEditor.getSettings().setLineNumbersShown(false);
  //    e.consume();
  //    return;
  //  }
  //}

  if (getGutterRenderer(e) != null) return;

  if (myEditor.getMouseEventArea(e) == EditorMouseEventArea.ANNOTATIONS_AREA) {
    queue.blockNextEvents(e);
    closeAllAnnotations();
    e.consume();
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:EditorGutterComponentImpl.java

示例4: patchSystem

import com.intellij.ide.IdeEventQueue; //导入方法依赖的package包/类
private static void patchSystem(boolean headless) {
  System.setProperty("sun.awt.noerasebackground", "true");

  IdeEventQueue.getInstance(); // replace system event queue

  if (headless) return;

  if (Patches.SUN_BUG_ID_6209673) {
    RepaintManager.setCurrentManager(new IdeRepaintManager());
  }

  if (SystemInfo.isXWindow) {
    String wmName = X11UiUtil.getWmName();
    LOG.info("WM detected: " + wmName);
    if (wmName != null) {
      X11UiUtil.patchDetectedWm(wmName);
    }
  }

  IconLoader.activate();

  new JFrame().pack(); // this peer will prevent shutting down our application
}
 
开发者ID:consulo,项目名称:consulo,代码行数:24,代码来源:ApplicationStarter.java

示例5: FocusManagerImpl

import com.intellij.ide.IdeEventQueue; //导入方法依赖的package包/类
@SuppressWarnings("UnusedParameters")  // the dependencies are needed to ensure correct loading order
public FocusManagerImpl(ServiceManagerImpl serviceManager, WindowManager wm, UiActivityMonitor monitor) {
  myApp = ApplicationManager.getApplication();
  myQueue = IdeEventQueue.getInstance();
  myActivityMonitor = monitor;

  myFocusedComponentAlarm = new EdtAlarm();
  myForcedFocusRequestsAlarm = new EdtAlarm();
  myIdleAlarm = new EdtAlarm();

  final AppListener myAppListener = new AppListener();
  myApp.getMessageBus().connect().subscribe(ApplicationActivationListener.TOPIC, myAppListener);

  IdeEventQueue.getInstance().addDispatcher(new IdeEventQueue.EventDispatcher() {
    @Override
    public boolean dispatch(AWTEvent e) {
      if (e instanceof FocusEvent) {
        final FocusEvent fe = (FocusEvent)e;
        final Component c = fe.getComponent();
        if (c instanceof Window || c == null) return false;

        Component parent = UIUtil.findUltimateParent(c);

        if (parent instanceof IdeFrame) {
          myLastFocused.put((IdeFrame)parent, c);
        }
      }
      else if (e instanceof WindowEvent) {
        Window wnd = ((WindowEvent)e).getWindow();
        if (e.getID() == WindowEvent.WINDOW_CLOSED) {
          if (wnd instanceof IdeFrame) {
            myLastFocused.remove(wnd);
            myLastFocusedAtDeactivation.remove(wnd);
          }
        }
      }

      return false;
    }
  }, this);

  KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener("focusedWindow", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      if (evt.getNewValue() instanceof IdeFrame) {
        myLastFocusedFrame = (IdeFrame)evt.getNewValue();
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:51,代码来源:FocusManagerImpl.java

示例6: FocusManagerImpl

import com.intellij.ide.IdeEventQueue; //导入方法依赖的package包/类
@SuppressWarnings("UnusedParameters")  // the dependencies are needed to ensure correct loading order
public FocusManagerImpl(ServiceManagerImpl serviceManager, WindowManager wm, UiActivityMonitor monitor) {
  myApp = ApplicationManager.getApplication();
  myQueue = IdeEventQueue.getInstance();
  myActivityMonitor = monitor;

  myFocusedComponentAlaram = new EdtAlarm();
  myForcedFocusRequestsAlarm = new EdtAlarm();
  myIdleAlarm = new EdtAlarm();

  final AppListener myAppListener = new AppListener();
  myApp.getMessageBus().connect().subscribe(ApplicationActivationListener.TOPIC, myAppListener);

  IdeEventQueue.getInstance().addDispatcher(new IdeEventQueue.EventDispatcher() {
    public boolean dispatch(AWTEvent e) {
      if (e instanceof FocusEvent) {
        final FocusEvent fe = (FocusEvent)e;
        final Component c = fe.getComponent();
        if (c instanceof Window || c == null) return false;

        Component parent = SwingUtilities.getWindowAncestor(c);

        if (parent instanceof IdeFrame) {
          myLastFocused.put((IdeFrame)parent, new WeakReference<Component>(c));
        }
      } else if (e instanceof WindowEvent) {
        Window wnd = ((WindowEvent)e).getWindow();
        if (e.getID() == WindowEvent.WINDOW_CLOSED) {
          if (wnd instanceof IdeFrame) {
            myLastFocused.remove((IdeFrame)wnd);
            myLastFocusedAtDeactivation.remove((IdeFrame)wnd);
          }
        }
      }

      return false;
    }
  }, this);

  KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener("focusedWindow", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      if (evt.getNewValue() instanceof IdeFrame) {
        myLastFocusedFrame = (IdeFrame)evt.getNewValue();
      }
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:49,代码来源:FocusManagerImpl.java

示例7: FocusManagerImpl

import com.intellij.ide.IdeEventQueue; //导入方法依赖的package包/类
@SuppressWarnings("UnusedParameters")  // the dependencies are needed to ensure correct loading order
public FocusManagerImpl(ServiceManagerImpl serviceManager, WindowManager wm, UiActivityMonitor monitor) {
  myApp = ApplicationManager.getApplication();
  myQueue = IdeEventQueue.getInstance();
  myActivityMonitor = monitor;

  myFocusedComponentAlarm = new EdtAlarm();
  myForcedFocusRequestsAlarm = new EdtAlarm();

  final AppListener myAppListener = new AppListener();
  myApp.getMessageBus().connect().subscribe(ApplicationActivationListener.TOPIC, myAppListener);

  IdeEventQueue.getInstance().addDispatcher(e -> {
    if (e instanceof FocusEvent) {
      final FocusEvent fe = (FocusEvent)e;
      final Component c = fe.getComponent();
      if (c instanceof Window || c == null) return false;

      Component parent = UIUtil.findUltimateParent(c);

      if (parent instanceof IdeFrame) {
        myLastFocused.put((IdeFrame)parent, c);
      }
    }
    else if (e instanceof WindowEvent) {
      Window wnd = ((WindowEvent)e).getWindow();
      if (e.getID() == WindowEvent.WINDOW_CLOSED) {
        if (wnd instanceof IdeFrame) {
          myLastFocused.remove(wnd);
          myLastFocusedAtDeactivation.remove(wnd);
        }
      }
    }

    return false;
  }, this);

  KeyboardFocusManager.getCurrentKeyboardFocusManager().addPropertyChangeListener("focusedWindow", new PropertyChangeListener() {
    @Override
    public void propertyChange(PropertyChangeEvent evt) {
      if (evt.getNewValue() instanceof IdeFrame) {
        myLastFocusedFrame = (IdeFrame)evt.getNewValue();
      }
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:47,代码来源:FocusManagerImpl.java

示例8: show

import com.intellij.ide.IdeEventQueue; //导入方法依赖的package包/类
@Override
@SuppressWarnings("deprecation")
public void show() {
  final DialogWrapper dialogWrapper = getDialogWrapper();
  boolean isAutoAdjustable = dialogWrapper.isAutoAdjustable();
  Point location = null;
  if (isAutoAdjustable) {
    pack();

    Dimension packedSize = getSize();
    Dimension minSize = getMinimumSize();
    setSize(Math.max(packedSize.width, minSize.width), Math.max(packedSize.height, minSize.height));

    setSize((int)(getWidth() * dialogWrapper.getHorizontalStretch()), (int)(getHeight() * dialogWrapper.getVerticalStretch()));

    // Restore dialog's size and location

    myDimensionServiceKey = dialogWrapper.getDimensionKey();

    if (myDimensionServiceKey != null) {
      final Project projectGuess = DataManager.getInstance().getDataContext(this).getData(CommonDataKeys.PROJECT);
      location = DimensionService.getInstance().getLocation(myDimensionServiceKey, projectGuess);
      Dimension size = DimensionService.getInstance().getSize(myDimensionServiceKey, projectGuess);
      if (size != null) {
        myInitialSize = new Dimension(size);
        _setSizeForLocation(myInitialSize.width, myInitialSize.height, location);
      }
    }

    if (myInitialSize == null) {
      myInitialSize = getSize();
    }
  }

  if (location == null) {
    location = dialogWrapper.getInitialLocation();
  }

  if (location != null) {
    setLocation(location);
  }
  else {
    setLocationRelativeTo(getOwner());
  }

  if (isAutoAdjustable) {
    final Rectangle bounds = getBounds();
    ScreenUtil.fitToScreen(bounds);
    setBounds(bounds);
  }

  if (Registry.is("actionSystem.fixLostTyping")) {
    final IdeEventQueue queue = IdeEventQueue.getInstance();
    if (queue != null) {
      queue.getKeyEventDispatcher().resetState();
    }

  }

  // Workaround for switching workspaces on dialog show
  if (SystemInfo.isMac && myProject != null && Registry.is("ide.mac.fix.dialog.showing") && !dialogWrapper.isModalProgress()) {
    final IdeFrame frame = WindowManager.getInstance().getIdeFrame(myProject.get());
    AppIcon.getInstance().requestFocus(frame);
  }

  setBackground(UIUtil.getPanelBackground());

  final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
  if (app != null && !app.isLoaded() && DesktopSplash.BOUNDS != null) {
    final Point loc = getLocation();
    loc.y = DesktopSplash.BOUNDS.y + DesktopSplash.BOUNDS.height;
    setLocation(loc);
  }
  super.show();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:76,代码来源:DialogWrapperPeerImpl.java


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