/** * Uninstalls the sheet on the owner. This method is invoked immediately after the JSheet is * hidden. */ protected void uninstallSheet() { if (isInstalled) { Window owner = getOwner(); if (owner != null) { if (isExperimentalSheet()) { owner.removeWindowListener(windowEventHandler); } else { // Note: We mustn't change the windows focusable state // because // this also affects the focusable state of the JSheet. // owner.setFocusableWindowState(true); owner.setEnabled(true); // ((JFrame) owner).setResizable(true); owner.removeComponentListener(ownerMovementHandler); if (shiftBackLocation != null) { owner.setLocation(shiftBackLocation); } if (oldFocusOwner != null) { owner.toFront(); oldFocusOwner.requestFocus(); } } } isInstalled = false; } }
private void forgetWindow() { if (win != null) { win.removeWindowListener(winL); win.removeComponentListener(cmpL); if (EventManager.DEBUG_EVENTS) { System.err.println( "DynamicAncestorAdapter removed WindowListener : " + win.getClass().getName()); } win = null; if (listening) stopListening(); } }
private void resetWindow() { if (myWindow != null && getWndManager() != null) { getWndManager().resetWindow(myWindow); if (myWindowListener != null) { myWindow.removeWindowListener(myWindowListener); } if (myWindow instanceof JWindow) { ((JWindow) myWindow).getRootPane().putClientProperty(KEY, null); } myWindow = null; myWindowListener = null; } }
public void hierarchyChanged(HierarchyEvent e) { if ((e.getChangeFlags() & HierarchyEvent.PARENT_CHANGED) != 0) { Window parentWindow = SwingUtilities.getWindowAncestor(BufferedCanvasComponent.this); if (lastParentWindow != parentWindow) { if (lastParentWindow != null) lastParentWindow.removeWindowListener(VisibilityHandler.this); if (parentWindow != null) parentWindow.addWindowListener(VisibilityHandler.this); lastParentWindow = parentWindow; } } if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) { if (isShowing()) BufferedCanvasComponent.this.shown(); else BufferedCanvasComponent.this.hidden(); } }
/** This method uninstalls listeners installed by the UI. */ protected void uninstallListeners() { if (toolBarFocusListener != null) { int count = toolBar.getComponentCount(); for (int i = 0; i < count; i++) toolBar.getComponent(i).removeFocusListener(toolBarFocusListener); toolBarFocusListener = null; } floatFrame.removeWindowListener(windowListener); windowListener = null; toolBar.removeContainerListener(toolBarContListener); toolBarContListener = null; toolBar.removeMouseMotionListener(dockingListener); toolBar.removeMouseListener(dockingListener); dockingListener = null; }
public void setPalette(Window newValue) { AbstractOSXApplication application = getApplication(); if (palette != null) { palette.removeWindowListener(windowHandler); } palette = newValue; if (palette != null) { palette.addWindowListener(windowHandler); if (getValue(Actions.SELECTED_KEY) == Boolean.TRUE) { application.addPalette(palette); palette.setVisible(true); } else { application.removePalette(palette); palette.setVisible(false); } } }
private void uninstallListeners() { if (myWindow != null) { myWindow.removeWindowListener(myWindowListener); myWindow.removePropertyChangeListener(myPropertyChangeListener); } }
/** * Properties pages are disposed differently here than for the general node, so they need a * separately called method. */ void disposePropertiesPage(Window keyWindow) { XmlSchemaPanel propertiesPage = (XmlSchemaPanel) this.propertiesPages.remove(keyWindow); propertiesPage.setNode(null, this.buildShellWorkbenchContext()); keyWindow.removeWindowListener(this.windowListener); }