Java 类com.intellij.ui.mac.MacMainFrameDecorator 实例源码

项目:intellij-ce-playground    文件:IdeFrameDecorator.java   
@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;
}
项目:intellij-ce-playground    文件:MacWindowActionBase.java   
@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);
  }
}
项目:tools-idea    文件:IdeFrameDecorator.java   
@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;
}
项目:tools-idea    文件:MinimizeCurrentWindowAction.java   
@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);
  }
}
项目:consulo    文件:IdeFrameDecorator.java   
@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;
}
项目:consulo    文件:MinimizeCurrentWindowAction.java   
@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);
  }
}
项目:intellij-ce-playground    文件:IdeFrameImpl.java   
public void dispose() {
  if (SystemInfo.isMac && isInFullScreen()) {
    ((MacMainFrameDecorator)myFrameDecorator).exitFullScreenAndDispose();
  }
  else {
    disposeImpl();
  }
}
项目:intellij-ce-playground    文件:SheetMessage.java   
private boolean couldBeInFullScreen() {
  if (myParent instanceof JFrame) {
    JRootPane rootPane = ((JFrame)myParent).getRootPane();
    return rootPane.getClientProperty(MacMainFrameDecorator.FULL_SCREEN) == null;
  }
  return false;
}
项目:consulo    文件:IdeFrameImpl.java   
@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();
}
项目:consulo    文件:SheetMessage.java   
private boolean couldBeInFullScreen() {
  if (myParent instanceof JFrame) {
    JRootPane rootPane = ((JFrame)myParent).getRootPane();
    return rootPane.getClientProperty(MacMainFrameDecorator.FULL_SCREEN) == null;
  }
  return false;
}