/** * Returns the DOM Tree window group. * * @return DOM Tree {@code TopComponentGroup}. */ static TopComponentGroup getDOMTCGroup() { return WindowManager.getDefault().findTopComponentGroup("DomTree"); // NOI18N }
private static TopComponent getOutputWindow() { final String outputWindowId = "output"; //NOI18N TopComponent outputWindow = WindowManager.getDefault().findTopComponent(outputWindowId); assert outputWindow != null : "Could not find the output window using id " + outputWindowId; //NOI18N return outputWindow; }
/** @return Preferred size of editor top component */ @Override public Dimension getPreferredSize() { @SuppressWarnings("deprecation") Rectangle bounds = WindowManager.getDefault().getCurrentWorkspace().getBounds(); return new Dimension(bounds.width / 2, bounds.height / 2); }
@Override public void run() { assert EventQueue.isDispatchThread(); try { JFrame frame = (JFrame) WindowManager.getDefault().getMainWindow(); Component component = frame.getGlassPane(); component.setVisible(show); component.setCursor(show ? Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR) : null); } catch (NullPointerException npe) { LOGGER.log(Level.WARNING, null, npe); } }
public static boolean isComponentOpened(String viewName) { TopComponent view = WindowManager.getDefault().findTopComponent(viewName); if (view == null) { throw new IllegalArgumentException(viewName); } return view.isOpened(); }
private static TopComponent findTopComponentOfId(String id) { TopComponent tc = WindowManager.getDefault().findTopComponent(id); if (tc == null) { // ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, // new NullPointerException("TopComponent of id=" + id + " not found!")); // NOI18N info(new NullPointerException("TopComponent of id=" + id + " not found!")); // NOI18N return null; } return tc; }
public NetBeansUniformityCheckMainPresentation() { assert EventQueue.isDispatchThread(); topComponent = (UniformityCheckMainTopComponent)WindowManager.getDefault().findTopComponent("UniformityCheckMainTopComponent"); panel = topComponent.getContent(); }
public NetBeansProfileEvaluationMainPresentation() { assert EventQueue.isDispatchThread(); topComponent = (ProfileEvaluationMainTopComponent)WindowManager.getDefault().findTopComponent("ProfileEvaluationMainTopComponent"); panel = topComponent.getContent(); } }
/** Sets localized display name of this <code>TopComponent</code>. * @param displayName localized display name which is set * @since 4.13 */ public void setDisplayName(String displayName) { String old = this.displayName; if(displayName == old || (displayName != null && displayName.equals(old))) { return; } this.displayName = displayName; firePropertyChange("displayName", old, displayName); // NOI18N WindowManager.getDefault().topComponentDisplayNameChanged(this, displayName); }
private static synchronized ResultWindow getResultWindow() { ResultWindow result = (ResultWindow) WindowManager.getDefault().findTopComponent(ID); if (result == null) { result = getDefault(); } return result; }
private static boolean isModalDialogPresent() { return hasModalDialog(WindowManager.getDefault().getMainWindow()) // XXX Trick to get the shared frame instance. || hasModalDialog(new JDialog().getOwner()); }
@Override public void actionPerformed(ActionEvent e) { Color newColor = ColorPicker.showDialog(WindowManager.getDefault().getMainWindow(), color, JColorButton.this.includeOpacity); if (newColor != null) { setColor(newColor); } } });
/*************************************************************************** * * **************************************************************************/ public static boolean isInActivatedTopComponent (final JComponent component) { if (registry == null) { registry = WindowManager.getDefault().getRegistry(); } return registry.getActivated() == findTopComponent(component); }
public static Image getCssPreviewImage(Map<String, String> properties, URL base, int width, int height, int defaultFontSize) { WindowManager wm = WindowManager.getDefault(); Graphics2D g2d = (Graphics2D)wm.getMainWindow().getGraphics(); return paintCssPreview(g2d, base, properties, width, height, defaultFontSize); }
/** Finds current undo/redo. */ static UndoRedo getUndoRedo (){ TopComponent el = WindowManager.getDefault ().getRegistry ().getActivated (); return el == null ? UndoRedo.NONE : el.getUndoRedo (); }
@Override public void mouseClicked(MouseEvent e) { if (SwingUtilities.isRightMouseButton(e)) { Color newColor = ColorPicker.showDialog(WindowManager.getDefault().getMainWindow(), color, JColorButton.this.includeOpacity); if (newColor != null) { setColor(newColor); } } } });
/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ private void internalSetTitle2() { WindowManager.getDefault().getMainWindow().setTitle(fixed(titlePrefix) + (((titlePrefix != null) && (title != null)) ? " - " : "") + fixed(title)); }
private TopComponent selectedEditorComponent() { Mode editor = WindowManager.getDefault().findMode("editor");//NOI18N TopComponent tc = editor.getSelectedTopComponent(); TopComponent topComponent = getTopComponent(EditorRegistry.lastFocusedComponent()); if (topComponent == tc) { return tc; } return null; }
private static void frontMainWindow() { Frame f = WindowManager.getDefault().getMainWindow(); // makes sure the frame is visible f.setVisible(true); // uniconifies the frame if it is inconified if ((f.getExtendedState() & Frame.ICONIFIED) != 0) { f.setExtendedState(~Frame.ICONIFIED & f.getExtendedState()); } // moves it to front and requests focus f.toFront (); } private static class EQStuck extends Throwable {
private void configureHistogramButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_configureHistogramButtonActionPerformed prepareHistogram(); if (histogramDialog != null) { histogramDialog.setVisible(true); } else { histogramDialog = new JFreeChartDialog(WindowManager.getDefault().getMainWindow(), histogram.getTitle().getText(), histogram, 600, 400); } }//GEN-LAST:event_configureHistogramButtonActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables