/** * Nreates an ActionButton and assigns the given action with the button. * * @param action the action. */ public ActionRadioButton(final Action action) { setAction(action); }
final Action oldAction = getAction(); if (oldAction != null) removeActionListener(oldAction); oldAction.removePropertyChangeListener(getPropertyChangeHandler()); unregisterKeyboardAction(k); if (this.action != null) addActionListener(newAction); newAction.addPropertyChangeListener(getPropertyChangeHandler()); setText((String) (newAction.getValue(Action.NAME))); setToolTipText((String) (newAction.getValue(Action.SHORT_DESCRIPTION))); setIcon((Icon) newAction.getValue(Action.SMALL_ICON)); setEnabled(this.action.isEnabled()); setMnemonic(c.charValue()); setMnemonic(c.intValue()); registerKeyboardAction(newAction, k, WHEN_IN_FOCUSED_WINDOW);
setEnabled(getAction().isEnabled()); setIcon((Icon) getAction().getValue(Action.SMALL_ICON)); setText((String) getAction().getValue (Action.NAME)); ActionRadioButton.this.setToolTipText((String) getAction().getValue(Action.SHORT_DESCRIPTION)); final Action ac = getAction(); if (event.getPropertyName().equals(ActionDowngrade.ACCELERATOR_KEY)) if (oldVal != null) unregisterKeyboardAction (oldVal); registerKeyboardAction(ac, k, WHEN_IN_FOCUSED_WINDOW); setMnemonic(c.charValue()); setMnemonic(c.intValue());
/** * Enables and disables this button and if an action is assigned to this button the * propertychange is forwarded to the assigned action. * * @param b the new enable-state of this button */ public void setEnabled(final boolean b) { super.setEnabled(b); if (getAction() != null) { getAction().setEnabled(b); } }
final Action oldAction = getAction(); if (oldAction != null) removeActionListener(oldAction); oldAction.removePropertyChangeListener(getPropertyChangeHandler()); unregisterKeyboardAction(k); if (this.action != null) addActionListener(newAction); newAction.addPropertyChangeListener(getPropertyChangeHandler()); setText((String) (newAction.getValue(Action.NAME))); setToolTipText((String) (newAction.getValue(Action.SHORT_DESCRIPTION))); setIcon((Icon) newAction.getValue(Action.SMALL_ICON)); setEnabled(this.action.isEnabled()); setMnemonic(c.charValue()); setMnemonic(c.intValue()); registerKeyboardAction(newAction, k, WHEN_IN_FOCUSED_WINDOW);
setEnabled(getAction().isEnabled()); setIcon((Icon) getAction().getValue(Action.SMALL_ICON)); setText((String) getAction().getValue (Action.NAME)); ActionRadioButton.this.setToolTipText((String) getAction().getValue(Action.SHORT_DESCRIPTION)); final Action ac = getAction(); if (event.getPropertyName().equals(ActionDowngrade.ACCELERATOR_KEY)) if (oldVal != null) unregisterKeyboardAction (oldVal); registerKeyboardAction(ac, k, WHEN_IN_FOCUSED_WINDOW); setMnemonic(c.charValue()); setMnemonic(c.intValue());
/** * Enables and disables this button and if an action is assigned to this button the * propertychange is forwarded to the assigned action. * * @param b the new enable-state of this button */ public void setEnabled(final boolean b) { super.setEnabled(b); if (getAction() != null) { getAction().setEnabled(b); } }
final Action oldAction = getAction(); if (oldAction != null) removeActionListener(oldAction); oldAction.removePropertyChangeListener(getPropertyChangeHandler()); unregisterKeyboardAction(k); if (this.action != null) addActionListener(newAction); newAction.addPropertyChangeListener(getPropertyChangeHandler()); setText((String) (newAction.getValue(Action.NAME))); setToolTipText((String) (newAction.getValue(Action.SHORT_DESCRIPTION))); setIcon((Icon) newAction.getValue(Action.SMALL_ICON)); setEnabled(this.action.isEnabled()); setMnemonic(c.charValue()); setMnemonic(c.intValue()); registerKeyboardAction(newAction, k, WHEN_IN_FOCUSED_WINDOW);
setEnabled(getAction().isEnabled()); setIcon((Icon) getAction().getValue(Action.SMALL_ICON)); setText((String) getAction().getValue (Action.NAME)); ActionRadioButton.this.setToolTipText((String) getAction().getValue(Action.SHORT_DESCRIPTION)); final Action ac = getAction(); if (event.getPropertyName().equals(ActionDowngrade.ACCELERATOR_KEY)) if (oldVal != null) unregisterKeyboardAction (oldVal); registerKeyboardAction(ac, k, WHEN_IN_FOCUSED_WINDOW); setMnemonic(c.charValue()); setMnemonic(c.intValue());
/** * Nreates an ActionButton and assigns the given action with the button. * * @param action the action. */ public ActionRadioButton(final Action action) { setAction(action); }
/** * Enables and disables this button and if an action is assigned to this button the * propertychange is forwarded to the assigned action. * * @param b the new enable-state of this button */ public void setEnabled(final boolean b) { super.setEnabled(b); if (getAction() != null) { getAction().setEnabled(b); } }
/** * Nreates an ActionButton and assigns the given action with the button. * * @param action the action. */ public ActionRadioButton(final Action action) { setAction(action); }