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