@Nullable public static IdeFrameDecorator decorate(@NotNull IdeFrameImpl frame) { if (SystemInfo.isMac) { return new MacMainFrameDecorator(frame, PlatformUtils.isAppCode()); } else if (SystemInfo.isWindows) { return new WinMainFrameDecorator(frame); } else if (SystemInfo.isXWindow) { if (X11UiUtil.isFullScreenSupported()) { return new EWMHFrameDecorator(frame); } } return null; }
@Override public void update(final AnActionEvent e) { Presentation p = e.getPresentation(); p.setVisible(SystemInfo.isMac); if (SystemInfo.isMac) { Project project = CommonDataKeys.PROJECT.getData(e.getDataContext()); if (project != null) { JFrame frame = WindowManager.getInstance().getFrame(project); if (frame != null) { JRootPane pane = frame.getRootPane(); p.setEnabled(pane != null && pane.getClientProperty(MacMainFrameDecorator.FULL_SCREEN) == null); } } } else { p.setEnabled(false); } }
@Override public void update(final AnActionEvent e) { final Presentation p = e.getPresentation(); p.setVisible(SystemInfo.isMac); if (SystemInfo.isMac) { Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext()); if (project != null) { JFrame frame = WindowManager.getInstance().getFrame(project); if (frame != null) { JRootPane pane = frame.getRootPane(); p.setEnabled(pane != null && pane.getClientProperty(MacMainFrameDecorator.FULL_SCREEN) == null); } } } else { p.setEnabled(false); } }
@Nullable public static IdeFrameDecorator decorate(@Nonnull IdeFrameImpl frame) { if (SystemInfo.isMac) { return new MacMainFrameDecorator(frame, false); } else if (SystemInfo.isWindows) { return new WinMainFrameDecorator(frame); } else if (SystemInfo.isXWindow) { if (X11UiUtil.isFullScreenSupported()) { return new EWMHFrameDecorator(frame); } } return null; }
@Override public void update(final AnActionEvent e) { final Presentation p = e.getPresentation(); p.setVisible(SystemInfo.isMac); if (SystemInfo.isMac) { Project project = e.getData(CommonDataKeys.PROJECT); if (project != null) { JFrame frame = WindowManager.getInstance().getFrame(project); if (frame != null) { JRootPane pane = frame.getRootPane(); p.setEnabled(pane != null && pane.getClientProperty(MacMainFrameDecorator.FULL_SCREEN) == null); } } } else { p.setEnabled(false); } }
public void dispose() { if (SystemInfo.isMac && isInFullScreen()) { ((MacMainFrameDecorator)myFrameDecorator).exitFullScreenAndDispose(); } else { disposeImpl(); } }
private boolean couldBeInFullScreen() { if (myParent instanceof JFrame) { JRootPane rootPane = ((JFrame)myParent).getRootPane(); return rootPane.getClientProperty(MacMainFrameDecorator.FULL_SCREEN) == null; } return false; }
@Override public void dispose() { if (SystemInfo.isMac && isInFullScreen()) { ((MacMainFrameDecorator)myFrameDecorator).toggleFullScreenNow(); } if (isTemporaryDisposed()) { super.dispose(); return; } MouseGestureManager.getInstance().remove(this); if (myBalloonLayout != null) { ((DesktopBalloonLayoutImpl)myBalloonLayout).dispose(); myBalloonLayout = null; } // clear both our and swing hard refs if (myRootPane != null) { if (ApplicationManager.getApplication().isUnitTestMode()) { myRootPane.removeNotify(); } myRootPane = null; setRootPane(new JRootPane()); } if (myFrameDecorator != null) { Disposer.dispose(myFrameDecorator); myFrameDecorator = null; } if (myWindowsBorderUpdater != null) { Toolkit.getDefaultToolkit().removePropertyChangeListener("win.xpstyle.themeActive", myWindowsBorderUpdater); myWindowsBorderUpdater = null; } super.dispose(); }