private static synchronized WindowManager getDummyInstance() { if(dummyInstance == null) { dummyInstance = new DummyWindowManager(); } return dummyInstance; }
public DummyWindowManager() { workspaces = new TreeMap(); createWorkspace("default", null); // NOI18N }
public void remove() { DummyWindowManager.this.delete(this); }
protected void topComponentClose(TopComponent tc) { componentHidden(tc); componentCloseNotify(tc); JFrame f = (JFrame)SwingUtilities.getAncestorOfClass(JFrame.class, tc); if (f != null) { f.setVisible(false); tc.getParent ().remove (tc); } registry().close(tc); java.util.Iterator it = workspaces.values ().iterator (); while (it.hasNext ()) { W w = (W)it.next (); w.close (tc); } }
componentOpenNotify(tc); componentShowing(tc); f.setVisible(true); registry().open(tc);
protected void topComponentRequestActive(TopComponent tc) { JFrame f = (JFrame)SwingUtilities.getAncestorOfClass(JFrame.class, tc); if(f != null) { f.toFront(); } registry().setActive(tc); activateComponent(tc); }
public Mode findMode(String name) { if(name == null) { return null; } for(Iterator it = getModes().iterator(); it.hasNext(); ) { Mode m = (Mode)it.next(); if(name.equals(m.getName())) { return m; } } return null; }
protected Action[] topComponentDefaultActions(TopComponent tc) { // XXX It could be better to provide non-SystemAction instances. synchronized(DummyWindowManager.class) { //Bugfix #33557: Do not provide CloneViewAction when //TopComponent does not implement TopComponent.Cloneable if (tc instanceof TopComponent.Cloneable) { if (DEFAULT_ACTIONS_CLONEABLE == null) { DEFAULT_ACTIONS_CLONEABLE = loadActions (new String[] { "Save", // NOI18N "CloneView", // NOI18N null, "CloseView" // NOI18N }); } return DEFAULT_ACTIONS_CLONEABLE; } else { if (DEFAULT_ACTIONS_NOT_CLONEABLE == null) { DEFAULT_ACTIONS_NOT_CLONEABLE = loadActions (new String[] { "Save", // NOI18N null, "CloseView" // NOI18N }); } return DEFAULT_ACTIONS_NOT_CLONEABLE; } } }
protected void topComponentClose(TopComponent tc) { componentHidden(tc); componentCloseNotify(tc); JFrame f = (JFrame)SwingUtilities.getAncestorOfClass(JFrame.class, tc); if (f != null) { f.setVisible(false); tc.getParent ().remove (tc); } registry().close(tc); java.util.Iterator it = workspaces.values ().iterator (); while (it.hasNext ()) { W w = (W)it.next (); w.close (tc); } }
componentOpenNotify(tc); componentShowing(tc); f.setVisible(true); registry().open(tc);
protected void topComponentRequestActive(TopComponent tc) { JFrame f = (JFrame)SwingUtilities.getAncestorOfClass(JFrame.class, tc); if(f != null) { f.toFront(); } registry().setActive(tc); activateComponent(tc); }
public Mode findMode(TopComponent tc) { for(Iterator it = getModes().iterator(); it.hasNext(); ) { Mode m = (Mode)it.next(); if(Arrays.asList(m.getTopComponents()).contains(tc)) { return m; } } return null; }
protected Action[] topComponentDefaultActions(TopComponent tc) { // XXX It could be better to provide non-SystemAction instances. synchronized(DummyWindowManager.class) { //Bugfix #33557: Do not provide CloneViewAction when //TopComponent does not implement TopComponent.Cloneable if (tc instanceof TopComponent.Cloneable) { if (DEFAULT_ACTIONS_CLONEABLE == null) { DEFAULT_ACTIONS_CLONEABLE = loadActions (new String[] { "Save", // NOI18N "CloneView", // NOI18N null, "CloseView" // NOI18N }); } return DEFAULT_ACTIONS_CLONEABLE; } else { if (DEFAULT_ACTIONS_NOT_CLONEABLE == null) { DEFAULT_ACTIONS_NOT_CLONEABLE = loadActions (new String[] { "Save", // NOI18N null, "CloseView" // NOI18N }); } return DEFAULT_ACTIONS_NOT_CLONEABLE; } } }
public DummyWindowManager() { workspaces = new TreeMap(); createWorkspace("default", null); // NOI18N }
public Mode findMode(TopComponent tc) { for(Iterator it = getModes().iterator(); it.hasNext(); ) { Mode m = (Mode)it.next(); if(Arrays.asList(m.getTopComponents()).contains(tc)) { return m; } } return null; }
private static synchronized WindowManager getDummyInstance() { if(dummyInstance == null) { dummyInstance = new DummyWindowManager(); } return dummyInstance; }
public void remove() { DummyWindowManager.this.delete(this); }
synchronized void delete(Workspace w) { workspaces.remove(w.getName()); if (workspaces.isEmpty()) { createWorkspace("default", null); // NOI18N } if (pcs != null) { pcs.firePropertyChange(PROP_WORKSPACES, null, null); pcs.firePropertyChange(PROP_CURRENT_WORKSPACE, null, null); } }
public Mode findMode(String name) { if(name == null) { return null; } for(Iterator it = getModes().iterator(); it.hasNext(); ) { Mode m = (Mode)it.next(); if(name.equals(m.getName())) { return m; } } return null; }
synchronized void delete(Workspace w) { workspaces.remove(w.getName()); if (workspaces.isEmpty()) { createWorkspace("default", null); // NOI18N } if (pcs != null) { pcs.firePropertyChange(PROP_WORKSPACES, null, null); pcs.firePropertyChange(PROP_CURRENT_WORKSPACE, null, null); } }