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


Java IdeFrameImpl类代码示例

本文整理汇总了Java中com.intellij.openapi.wm.impl.IdeFrameImpl的典型用法代码示例。如果您正苦于以下问题:Java IdeFrameImpl类的具体用法?Java IdeFrameImpl怎么用?Java IdeFrameImpl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IdeFrameImpl类属于com.intellij.openapi.wm.impl包,在下文中一共展示了IdeFrameImpl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onSettingsChange

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
@Override
@SuppressWarnings("ConstantConditions")
public void onSettingsChange() {
    prepareTemplateSettings();

    for (IdeFrame frame : WindowManager.getInstance().getAllProjectFrames()) {
        if (frame.getProject() != null) {
            String projectTitle = getProjectTitle(frame.getProject());
            ((IdeFrameImpl)frame).setTitle(projectTitle);

            try {
                File currentFile = (File)((IdeFrameImpl) frame).getRootPane().getClientProperty("Window.documentFile");
                VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByIoFile(currentFile);
                IdeFrameImpl.updateTitle((IdeFrameImpl) frame, projectTitle, getFileTitle(frame.getProject(), virtualFile), currentFile);
            } catch (Exception e) {
                IdeFrameImpl.updateTitle((IdeFrameImpl) frame, projectTitle, null, null);
            }
        }
    }
}
 
开发者ID:mabdurrahman,项目名称:custom-title-plugin,代码行数:21,代码来源:CustomFrameTitleBuilder.java

示例2: tweakFrameFullScreen

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
private static ActionCallback tweakFrameFullScreen(Project project, boolean inPresentation) {
  Window window = IdeFrameImpl.getActiveFrame();
  if (window instanceof IdeFrameImpl) {
    IdeFrameImpl frame = (IdeFrameImpl)window;
    PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(project);
    if (inPresentation) {
      propertiesComponent.setValue("full.screen.before.presentation.mode", String.valueOf(frame.isInFullScreen()));
      return frame.toggleFullScreen(true);
    }
    else {
      if (frame.isInFullScreen()) {
        final String value = propertiesComponent.getValue("full.screen.before.presentation.mode");
        return frame.toggleFullScreen("true".equalsIgnoreCase(value));
      }
    }
  }
  return ActionCallback.DONE;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:TogglePresentationModeAction.java

示例3: find

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
@NotNull
public static IdeFrameFixture find(@NotNull final Robot robot, @NotNull final File projectPath, @Nullable final String projectName) {
  final GenericTypeMatcher<IdeFrameImpl> matcher = new GenericTypeMatcher<IdeFrameImpl>(IdeFrameImpl.class) {
    @Override
    protected boolean isMatching(@NotNull IdeFrameImpl frame) {
      Project project = frame.getProject();
      if (project != null && projectPath.getPath().equals(project.getBasePath())) {
        return projectName == null || projectName.equals(project.getName());
      }
      return false;
    }
  };

  pause(new Condition("IdeFrame " + quote(projectPath.getPath()) + " to show up") {
    @Override
    public boolean test() {
      Collection<IdeFrameImpl> frames = robot.finder().findAll(matcher);
      return !frames.isEmpty();
    }
  }, LONG_TIMEOUT);

  IdeFrameImpl ideFrame = robot.finder().find(matcher);
  return new IdeFrameFixture(robot, ideFrame, projectPath);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:IdeFrameFixture.java

示例4: update

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
private static void update() {
  UISettings.getInstance().fireUISettingsChanged();
  EditorFactory.getInstance().refreshAllEditors();

  Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
  for (Project openProject : openProjects) {
    FileStatusManager.getInstance(openProject).fileStatusesChanged();
    DaemonCodeAnalyzer.getInstance(openProject).restart();
  }
  for (IdeFrame frame : WindowManagerEx.getInstanceEx().getAllProjectFrames()) {
    if (frame instanceof IdeFrameImpl) {
      ((IdeFrameImpl)frame).updateView();
    }
  }
  //Editor[] editors = EditorFactory.getInstance().getAllEditors();
  //for (Editor editor : editors) {
  //  ((EditorEx)editor).reinitSettings();
  //}
  ActionToolbarImpl.updateAllToolbarsImmediately();

  restart(); //todo[kb] remove when get fixed ToolbarDecorator and toolwindow tabs
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:DarculaInstaller.java

示例5: getStepicWidget

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
@Nullable
static StudyStepicUserWidget getStepicWidget() {
  JFrame frame = WindowManager.getInstance().findVisibleFrame();
  if (frame instanceof IdeFrameImpl) {
    return (StudyStepicUserWidget)((IdeFrameImpl)frame).getStatusBar().getWidget(StudyStepicUserWidget.ID);
  }
  return null;
}
 
开发者ID:medvector,项目名称:educational-plugin,代码行数:9,代码来源:StudyUtils.java

示例6: closeWindow

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
public static void closeWindow(@NotNull Window window, boolean modalOnly) {
  if (window instanceof IdeFrameImpl) return;
  if (modalOnly && window instanceof Frame) return;

  if (window instanceof DialogWrapperDialog) {
    ((DialogWrapperDialog)window).getDialogWrapper().doCancelAction();
    return;
  }

  window.setVisible(false);
  window.dispose();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:DiffUtil.java

示例7: showIfNoProjectOpened

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
public static void showIfNoProjectOpened() {
  ApplicationManager.getApplication().invokeLater(new DumbAwareRunnable() {
    @Override
    public void run() {
      WindowManagerImpl windowManager = (WindowManagerImpl)WindowManager.getInstance();
      windowManager.disposeRootFrame();
      IdeFrameImpl[] frames = windowManager.getAllProjectFrames();
      if (frames.length == 0) {
        showNow();
      }
    }
  }, ModalityState.NON_MODAL);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:WelcomeFrame.java

示例8: isSelected

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
@Override
public boolean isSelected(AnActionEvent e) {
  IdeFrameImpl frame = getFrame();
  if (frame != null) {
    StatusBar statusBar = frame.getStatusBar();
    if (statusBar != null) {
      return ((StatusBarEx)statusBar).isProcessWindowOpen();
    }
  }

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ShowProcessWindowAction.java

示例9: setSelected

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
@Override
public void setSelected(AnActionEvent e, boolean state) {
  IdeFrameImpl frame = getFrame();
  if (frame != null) {
    StatusBar statusBar = frame.getStatusBar();
    if (statusBar != null) {
      ((StatusBarEx)statusBar).setProcessWindowOpen(state);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:ShowProcessWindowAction.java

示例10: getFrame

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
@Nullable
private static IdeFrameImpl getFrame() {
  Container window = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow();
  while (window != null) {
    if (window instanceof IdeFrameImpl) {
      return (IdeFrameImpl)window;
    }
    window = window.getParent();
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:ShowProcessWindowAction.java

示例11: isToolwindowVisible

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
protected static boolean isToolwindowVisible(@NotNull JComponent splitters, @NotNull String toolwindowId) {
  Window frame = SwingUtilities.getWindowAncestor(splitters);
  if (frame instanceof IdeFrameImpl) {
    Project project = ((IdeFrameImpl)frame).getProject();
    if (project != null) {
      if (!project.isInitialized()) return true;
      ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(toolwindowId);
      return toolWindow != null && toolWindow.isVisible();
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:EditorEmptyTextPainter.java

示例12: moveFocusOnDelete

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
private static boolean moveFocusOnDelete() {
  final Window window = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow();
  if (window != null) {
    final Component component = FocusTrackback.getFocusFor(window);
    if (component != null) {
      return component instanceof EditorComponentImpl;
    }
    return window instanceof IdeFrameImpl;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:FileEditorManagerImpl.java

示例13: isModalContext

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
/**
 * @return <code>true</code> if and only if the <code>component</code> represents
 * modal context.
 * @throws IllegalArgumentException if <code>component</code> is <code>null</code>.
 */
public static boolean isModalContext(@NotNull Component component) {
  Window window = UIUtil.getWindow(component);

  if (window instanceof IdeFrameImpl) {
    final Component pane = ((IdeFrameImpl) window).getGlassPane();
    if (pane instanceof IdeGlassPaneEx) {
      return ((IdeGlassPaneEx) pane).isInModalContext();
    }
  }

  if (window instanceof JDialog) {
    final JDialog dialog = (JDialog)window;
    if (!dialog.isModal()) {
      final Window owner = dialog.getOwner();
      return owner != null && isModalContext(owner);
    }
  }

  if (window instanceof JFrame) {
    return false;
  }

  boolean isMainFrame = window instanceof IdeFrameImpl;
  boolean isFloatingDecorator = window instanceof FloatingDecorator;

  boolean isPopup = !(component instanceof JFrame) && !(component instanceof JDialog);
  if (isPopup) {
    if (component instanceof JWindow) {
      JBPopup popup = (JBPopup)((JWindow)component).getRootPane().getClientProperty(JBPopup.KEY);
      if (popup != null) {
        return popup.isModalContext();
      }
    }
  }

  return !isMainFrame && !isFloatingDecorator;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:43,代码来源:IdeKeyEventDispatcher.java

示例14: guessBestPopupLocation

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
@NotNull
@Override
public RelativePoint guessBestPopupLocation(@NotNull DataContext dataContext) {
  Component component = PlatformDataKeys.CONTEXT_COMPONENT.getData(dataContext);
  JComponent focusOwner = component instanceof JComponent ? (JComponent)component : null;

  if (focusOwner == null) {
    Project project = CommonDataKeys.PROJECT.getData(dataContext);
    IdeFrameImpl frame = project == null ? null : ((WindowManagerEx)WindowManager.getInstance()).getFrame(project);
    focusOwner = frame == null ? null : frame.getRootPane();
    if (focusOwner == null) {
      throw new IllegalArgumentException("focusOwner cannot be null");
    }
  }

  final Point point = PlatformDataKeys.CONTEXT_MENU_POINT.getData(dataContext);
  if (point != null) {
    return new RelativePoint(focusOwner, point);
  }

  Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
  if (editor != null && focusOwner == editor.getContentComponent()) {
    return guessBestPopupLocation(editor);
  }
  else {
    return guessBestPopupLocation(focusOwner);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:PopupFactoryImpl.java

示例15: runStatisticsService

import com.intellij.openapi.wm.impl.IdeFrameImpl; //导入依赖的package包/类
private void runStatisticsService() {
  final StatisticsService statisticsService = StatisticsUploadAssistant.getStatisticsService();

  if (StatisticsUploadAssistant.isShouldShowNotification()) {
    myFrameStateManager.addListener(new FrameStateListener.Adapter() {
      @Override
      public void onFrameActivated() {
        if (((WindowManagerEx)WindowManager.getInstance()).getMostRecentFocusedWindow() instanceof IdeFrameImpl) {
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            @Override
            public void run() {
              StatisticsNotificationManager.showNotification(statisticsService);
            }
          });
          myFrameStateManager.removeListener(this);
        }
      }
    });
  }
  else if (StatisticsUploadAssistant.isSendAllowed() && StatisticsUploadAssistant.isTimeToSend()) {
    StatisticsService serviceToUse = null;
    StatisticsServiceEP[] extensions = StatisticsService.EP_NAME.getExtensions();
    if (extensions.length > 1) {
      LOG.warn(String.format("More than one stats service detected (%s). Falling back to the built-in one", Arrays.toString(extensions)));
    }
    else if (extensions.length == 1) {
      serviceToUse = extensions[0].getInstance();
    }
    if (serviceToUse == null) {
      serviceToUse = statisticsService;
    }
    runWithDelay(serviceToUse);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:SendStatisticsComponent.java


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