/** Listener to changes of some properties. * Multicast - reacts to keymap changes and ancestor changes * together. */ public void propertyChange(final PropertyChangeEvent ev) { //assert EventQueue.isDispatchThread(); if (!EventQueue.isDispatchThread()) { new IllegalStateException("This must happen in the event thread!").printStackTrace(); } updateState(ev.getPropertyName()); }
/** Listener to changes of some properties. * Multicast - reacts to keymap changes and ancestor changes * together. */ public void propertyChange (final PropertyChangeEvent ev) { //assert EventQueue.isDispatchThread(); if (!EventQueue.isDispatchThread()) { new IllegalStateException("This must happen in the event thread!").printStackTrace(); } updateState(ev.getPropertyName()); } // Must be separate from general PCL, because otherwise
/** Listener to changes of some properties. * Multicast - reacts to keymap changes and ancestor changes * together. */ public void propertyChange (final PropertyChangeEvent ev) { //assert EventQueue.isDispatchThread(); if (!EventQueue.isDispatchThread()) { new IllegalStateException("This must happen in the event thread!").printStackTrace(); } updateState(ev.getPropertyName()); } // Must be separate from general PCL, because otherwise
/** Connects buttons to action. If the action supplies value for "iconBase" * key from getValue(String) with a path to icons the methods setIcon, * setPressedIcon, setDisabledIcon and setRolloverIcon will be called on the * button with loaded icons using the iconBase. E.g. if the value for "iconBase" * will be "com/mycompany/myIcon.gif" following images will be tried "com/mycompany/myIcon.gif" * for setIcon, "com/mycompany/myIcon_pressed.gif" for setPressedIcon, * "com/mycompany/myIcon_disabled.gif" for setDisabledIcon and * "com/mycompany/myIcon_rollover.gif" for setRolloverIcon. SystemAction has * special support for iconBase - please check {@link SystemAction#iconResource} * for more details. * @param button the button * @param action the action * @since 3.29 */ public static void connect (AbstractButton button, Action action) { Bridge b = new ButtonBridge (button, action); b.updateState (null); }
/** Connects buttons to action. If the action supplies value for "iconBase" * key from getValue(String) with a path to icons the methods setIcon, * setPressedIcon, setDisabledIcon and setRolloverIcon will be called on the * button with loaded icons using the iconBase. E.g. if the value for "iconBase" * will be "com/mycompany/myIcon.gif" following images will be tried "com/mycompany/myIcon.gif" * for setIcon, "com/mycompany/myIcon_pressed.gif" for setPressedIcon, * "com/mycompany/myIcon_disabled.gif" for setDisabledIcon and * "com/mycompany/myIcon_rollover.gif" for setRolloverIcon. SystemAction has * special support for iconBase - please check {@link SystemAction#iconResource} * for more details. * @param button the button * @param action the action * @since 3.29 */ public static void connect (AbstractButton button, Action action) { Bridge b = new ButtonBridge (button, action); b.updateState (null); }
/** Attaches menu item to an action. * @param item menu item * @param action action * @param popup create popup or menu item * @since 3.29 */ public static void connect (JMenuItem item, Action action, boolean popup) { Bridge b = new MenuBridge (item, action, popup); // Would make more sense to defer this until addNotify, but for some reason (why?) // if you do that, various menus start out compacted and poorly painted. b.updateState (null); if (!popup) { // #39508 fix. setMenuActionConnection(item, action); } }
/** Attaches menu item to an action. * @param item menu item * @param action action * @param popup create popup or menu item * @since 3.29 */ public static void connect (JMenuItem item, Action action, boolean popup) { Bridge b = new MenuBridge (item, action, popup); // Would make more sense to defer this until addNotify, but for some reason (why?) // if you do that, various menus start out compacted and poorly painted. b.updateState (null); if (!popup) { // #39508 fix. setMenuActionConnection(item, action); } }
/** Attaches checkbox menu item to boolean state action. * @param item menu item * @param action action * @param popup create popup or menu item */ public static void connect (JCheckBoxMenuItem item, BooleanStateAction action, boolean popup) { Bridge b = new CheckMenuBridge (item, action, popup); b.updateState (null); }
/** Attaches listener to given action */ public void addNotify () { action.addPropertyChangeListener (this); updateState (null); }
/** Connects buttons to action. * @param button the button * @param action the action */ public static void connect (AbstractButton button, BooleanStateAction action) { Bridge b = new BooleanButtonBridge (button, action); b.updateState (null); }
/** Attaches checkbox menu item to boolean state action. * @param item menu item * @param action action * @param popup create popup or menu item */ public static void connect (JCheckBoxMenuItem item, BooleanStateAction action, boolean popup) { Bridge b = new CheckMenuBridge (item, action, popup); b.updateState (null); }
/** Attaches listener to given action */ public void addNotify () { action.addPropertyChangeListener (this); updateState (null); }
/** Connects buttons to action. * @param button the button * @param action the action */ public static void connect (AbstractButton button, BooleanStateAction action) { Bridge b = new BooleanButtonBridge (button, action); b.updateState (null); }
public JComponent[] synchMenuPresenters(JComponent[] items) { if (bridge != null) { bridge.updateState(null); } return getMenuPresenters(); }
/** Attaches listener to given action */ final void addNotify() { action.addPropertyChangeListener(actionL); updateState(null); }
protected void prepare() { comp.addPropertyChangeListener(new VisL()); if (comp.isShowing()) { addNotify(); } else { updateState(null); } }