Java Code Examples for com.intellij.openapi.wm.IdeFrame#Child

The following examples show how to use com.intellij.openapi.wm.IdeFrame#Child . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IdeFrameUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nullable
public static IdeFrame findRootIdeFrame(@Nullable Window activeWindow) {
  if (activeWindow == null) {
    return null;
  }

  IdeFrame frame = null;
  while (frame == null) {
    if (activeWindow == null) {
      break;
    }

    frame = activeWindow.getUserData(IdeFrame.KEY);

    activeWindow = activeWindow.getParent();
  }

  if (frame == null) {
    return null;
  }

  while (frame instanceof IdeFrame.Child) {
    frame = ((IdeFrame.Child)frame).getParentFrame();
  }

  return frame;
}
 
Example 2
Source File: OwnerOptional.java    From consulo with Apache License 2.0 5 votes vote down vote up
public OwnerOptional ifFrame(Consumer<? super Frame> consumer) {
  if (myPermanentOwner instanceof Frame) {
    if (myPermanentOwner instanceof IdeFrame.Child) {
      IdeFrame.Child ideFrameChild = (IdeFrame.Child)myPermanentOwner;
      myPermanentOwner = WindowManager.getInstance().getFrame(ideFrameChild.getProject());
    }
    consumer.consume((Frame)this.myPermanentOwner);
  }
  return this;
}
 
Example 3
Source File: RunnerContentUi.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void showNotify() {
  Window awtWindow = SwingUtilities.getWindowAncestor(myComponent);
  consulo.ui.Window uiWindow = TargetAWT.from(awtWindow);

  IdeFrame ideFrame = uiWindow.getUserData(IdeFrame.KEY);
  if (ideFrame instanceof IdeFrame.Child) {
    ideFrame.setFrameTitle(mySessionName);
  }
}
 
Example 4
Source File: IdeFrameUtil.java    From consulo with Apache License 2.0 4 votes vote down vote up
public static boolean isRootFrame(@Nullable IdeFrame frame) {
  return frame != null && !(frame instanceof IdeFrame.Child);
}