Methods Summary |
---|
javax.swing.ComponentInputMap | createInputMap(int condition, javax.swing.JComponent c)
return new RootPaneInputMap(c);
|
public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent c)
return rootPaneUI;
|
javax.swing.InputMap | getInputMap(int condition, javax.swing.JComponent c)
if (condition == JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT) {
return (InputMap)DefaultLookup.get(c, this,
"RootPane.ancestorInputMap");
}
if (condition == JComponent.WHEN_IN_FOCUSED_WINDOW) {
return createInputMap(condition, c);
}
return null;
|
protected void | installComponents(javax.swing.JRootPane root)
|
protected void | installDefaults(javax.swing.JRootPane c)
LookAndFeel.installProperty(c, "opaque", Boolean.FALSE);
|
protected void | installKeyboardActions(javax.swing.JRootPane root)
InputMap km = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW, root);
SwingUtilities.replaceUIInputMap(root,
JComponent.WHEN_IN_FOCUSED_WINDOW, km);
km = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,
root);
SwingUtilities.replaceUIInputMap(root,
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, km);
LazyActionMap.installLazyActionMap(root, BasicRootPaneUI.class,
"RootPane.actionMap");
updateDefaultButtonBindings(root);
|
protected void | installListeners(javax.swing.JRootPane root)
root.addPropertyChangeListener(this);
|
public void | installUI(javax.swing.JComponent c)
installDefaults((JRootPane)c);
installComponents((JRootPane)c);
installListeners((JRootPane)c);
installKeyboardActions((JRootPane)c);
|
static void | loadActionMap(javax.swing.plaf.basic.LazyActionMap map)
map.put(new Actions(Actions.PRESS));
map.put(new Actions(Actions.RELEASE));
map.put(new Actions(Actions.POST_POPUP));
|
public void | propertyChange(java.beans.PropertyChangeEvent e)Invoked when a property changes on the root pane. If the event
indicates the defaultButton has changed, this will
reinstall the keyboard actions.
if(e.getPropertyName().equals("defaultButton")) {
JRootPane rootpane = (JRootPane)e.getSource();
updateDefaultButtonBindings(rootpane);
if (rootpane.getClientProperty("temporaryDefaultButton") == null) {
rootpane.putClientProperty("initialDefaultButton", e.getNewValue());
}
}
|
protected void | uninstallComponents(javax.swing.JRootPane root)
|
protected void | uninstallDefaults(javax.swing.JRootPane root)
|
protected void | uninstallKeyboardActions(javax.swing.JRootPane root)
SwingUtilities.replaceUIInputMap(root, JComponent.
WHEN_IN_FOCUSED_WINDOW, null);
SwingUtilities.replaceUIActionMap(root, null);
|
protected void | uninstallListeners(javax.swing.JRootPane root)
root.removePropertyChangeListener(this);
|
public void | uninstallUI(javax.swing.JComponent c)
uninstallDefaults((JRootPane)c);
uninstallComponents((JRootPane)c);
uninstallListeners((JRootPane)c);
uninstallKeyboardActions((JRootPane)c);
|
void | updateDefaultButtonBindings(javax.swing.JRootPane root)Invoked when the default button property has changed. This reloads
the bindings from the defaults table with name
RootPane.defaultButtonWindowKeyBindings .
InputMap km = SwingUtilities.getUIInputMap(root, JComponent.
WHEN_IN_FOCUSED_WINDOW);
while (km != null && !(km instanceof RootPaneInputMap)) {
km = km.getParent();
}
if (km != null) {
km.clear();
if (root.getDefaultButton() != null) {
Object[] bindings = (Object[])DefaultLookup.get(root, this,
"RootPane.defaultButtonWindowKeyBindings");
if (bindings != null) {
LookAndFeel.loadKeyBindings(km, bindings);
}
}
}
|