com.intellij.openapi.ui.FrameWrapper Java Examples
The following examples show how to use
com.intellij.openapi.ui.FrameWrapper.
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: CommentsDiffTool.java From review-board-idea-plugin with Apache License 2.0 | 6 votes |
@Override public void show(DiffRequest request) { final FrameWrapper frameWrapper = new FrameWrapper(request.getProject(), request.getGroupKey()); final DiffPanelImpl diffPanel = createDiffPanelImpl(request, frameWrapper.getFrame(), frameWrapper); final Editor editor = diffPanel.getEditor2(); updateHighLights(editor); editor.addEditorMouseListener(new EditorMouseAdapter() { @Override public void mouseClicked(EditorMouseEvent e) { if (e.getArea() != null && e.getArea().equals(EditorMouseEventArea.LINE_MARKERS_AREA)) { final Point locationOnScreen = e.getMouseEvent().getLocationOnScreen(); final int lineNumber = EditorUtil.yPositionToLogicalLine(editor, e.getMouseEvent()) + 1; showCommentsView(locationOnScreen, lineNumber, editor, e); } } }); DiffUtil.initDiffFrame(request.getProject(), frameWrapper, diffPanel, diffPanel.getComponent()); frameWrapper.setTitle(request.getWindowTitle()); frameWrapper.setPreferredFocusedComponent(diffPanel.getComponent()); frameWrapper.show(); }
Example #2
Source File: DiffUtil.java From consulo with Apache License 2.0 | 5 votes |
public static void initDiffFrame(Project project, @Nonnull FrameWrapper frameWrapper, @Nonnull final DiffViewer diffPanel, final JComponent mainComponent) { frameWrapper.setComponent(mainComponent); frameWrapper.setProject(project); frameWrapper.setImage(ImageLoader.loadFromResource("/diff/Diff.png")); frameWrapper.setPreferredFocusedComponent(diffPanel.getPreferredFocusedComponent()); frameWrapper.closeOnEsc(); }
Example #3
Source File: MergeTool.java From consulo with Apache License 2.0 | 5 votes |
public void show(DiffRequest data) { if (data instanceof MergeRequestImpl) { showDialog((MergeRequestImpl)data); return; } FrameWrapper frameWrapper = new FrameWrapper(data.getProject(), data.getGroupKey()); DiffViewer mergePanel = createMergeComponent(data, null, frameWrapper); frameWrapper.setComponent(mergePanel.getComponent()); frameWrapper.setPreferredFocusedComponent(mergePanel.getPreferredFocusedComponent()); frameWrapper.closeOnEsc(); frameWrapper.setTitle(data.getWindowTitle()); frameWrapper.setProject(data.getProject()); frameWrapper.show(); }
Example #4
Source File: FrameWrapperPeerFactoryImpl.java From consulo with Apache License 2.0 | 5 votes |
private MyJFrame(FrameWrapper owner, IdeFrame parent) throws HeadlessException { myOwner = owner; myParent = parent; toUIWindow().putUserData(IdeFrame.KEY, this); toUIWindow().addUserDataProvider(this::getData); FrameState.setFrameStateListener(this); setGlassPane(new IdeGlassPaneImpl(getRootPane(), true)); boolean setMenuOnFrame = SystemInfo.isMac; if (SystemInfo.isLinux) { final String desktop = System.getenv("XDG_CURRENT_DESKTOP"); if ("Unity".equals(desktop) || "Unity:Unity7".equals(desktop)) { try { Class.forName("com.jarego.jayatana.Agent"); setMenuOnFrame = true; } catch (ClassNotFoundException e) { // ignore } } } if (setMenuOnFrame) { setJMenuBar(new IdeMenuBar(ActionManagerEx.getInstanceEx(), DataManager.getInstance())); } MouseGestureManager.getInstance().add(this); setFocusTraversalPolicy(new LayoutFocusTraversalPolicyExt()); setDefaultCloseOperation(DISPOSE_ON_CLOSE); }
Example #5
Source File: FrameWrapperPeerFactoryImpl.java From consulo with Apache License 2.0 | 5 votes |
@Override public void dispose() { FrameWrapper owner = myOwner; myOwner = null; if (owner == null || myDisposing) return; myDisposing = true; Disposer.dispose(owner); super.dispose(); rootPane = null; setMenuBar((MenuBar)null); }
Example #6
Source File: FrameWrapperPeerFactoryImpl.java From consulo with Apache License 2.0 | 5 votes |
private MyJDialog(FrameWrapper owner, @Nullable IdeFrame parent) throws HeadlessException { super(parent == null ? null : parent.getWindow(), null); myOwner = owner; myParent = parent; setGlassPane(new IdeGlassPaneImpl(getRootPane())); getRootPane().putClientProperty("Window.style", "small"); setBackground(UIUtil.getPanelBackground()); MouseGestureManager.getInstance().add(this); setFocusTraversalPolicy(new LayoutFocusTraversalPolicyExt()); setDefaultCloseOperation(DISPOSE_ON_CLOSE); toUIWindow().putUserData(IdeFrame.KEY, this); toUIWindow().addUserDataProvider(this::getData); }
Example #7
Source File: FrameWrapperPeerFactoryImpl.java From consulo with Apache License 2.0 | 5 votes |
@Override public void dispose() { FrameWrapper owner = myOwner; myOwner = null; if (owner == null || myDisposing) return; myDisposing = true; Disposer.dispose(owner); super.dispose(); rootPane = null; }
Example #8
Source File: FrameWrapperPeerFactoryImpl.java From consulo with Apache License 2.0 | 4 votes |
@Override public JFrame createJFrame(FrameWrapper owner, IdeFrame parent) { return new MyJFrame(owner, parent); }
Example #9
Source File: FrameWrapperPeerFactoryImpl.java From consulo with Apache License 2.0 | 4 votes |
@Override public JDialog createJDialog(FrameWrapper owner, IdeFrame parent) { return new MyJDialog(owner, parent); }