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