/** * Add additional attributes to the action. If any of these attributes * are null then they will still be set on the action. Many of these * attributes map to the set methods on <code>AbstractActionExt</code> * * @see AbstractActionExt * @param action the action which will all the attributes will be applied */ public static void decorateAction(AbstractAction action, String shortDesc, String longDesc, Icon smallIcon, Icon largeIcon, KeyStroke accel) { if (action instanceof AbstractActionExt) { AbstractActionExt a = (AbstractActionExt)action; a.setShortDescription(shortDesc); a.setLongDescription(longDesc); a.setSmallIcon(smallIcon); a.setLargeIcon(largeIcon); a.setAccelerator(accel); } else { action.putValue(Action.SHORT_DESCRIPTION, shortDesc); action.putValue(Action.LONG_DESCRIPTION, longDesc); action.putValue(Action.SMALL_ICON, smallIcon); action.putValue(AbstractActionExt.LARGE_ICON, largeIcon); action.putValue(Action.ACCELERATOR_KEY, accel); } } }
/** * Add additional attributes to the action. If any of these attributes * are null then they will still be set on the action. Many of these * attributes map to the set methods on <code>AbstractActionExt</code> * * @see AbstractActionExt * @param action the action which will all the attributes will be applied */ public static void decorateAction(AbstractAction action, String shortDesc, String longDesc, Icon smallIcon, Icon largeIcon, KeyStroke accel) { if (action instanceof AbstractActionExt) { AbstractActionExt a = (AbstractActionExt)action; a.setShortDescription(shortDesc); a.setLongDescription(longDesc); a.setSmallIcon(smallIcon); a.setLargeIcon(largeIcon); a.setAccelerator(accel); } else { action.putValue(Action.SHORT_DESCRIPTION, shortDesc); action.putValue(Action.LONG_DESCRIPTION, longDesc); action.putValue(Action.SMALL_ICON, smallIcon); action.putValue(AbstractActionExt.LARGE_ICON, largeIcon); action.putValue(Action.ACCELERATOR_KEY, accel); } } }
/** * Add additional attributes to the action. If any of these attributes * are null then they will still be set on the action. Many of these * attributes map to the set methods on <code>AbstractActionExt</code> * * @see AbstractActionExt * @param action the action which will all the attributes will be applied */ public static void decorateAction(AbstractAction action, String shortDesc, String longDesc, Icon smallIcon, Icon largeIcon, KeyStroke accel) { if (action instanceof AbstractActionExt) { AbstractActionExt a = (AbstractActionExt)action; a.setShortDescription(shortDesc); a.setLongDescription(longDesc); a.setSmallIcon(smallIcon); a.setLargeIcon(largeIcon); a.setAccelerator(accel); } else { action.putValue(Action.SHORT_DESCRIPTION, shortDesc); action.putValue(Action.LONG_DESCRIPTION, longDesc); action.putValue(Action.SMALL_ICON, smallIcon); action.putValue(AbstractActionExt.LARGE_ICON, largeIcon); action.putValue(Action.ACCELERATOR_KEY, accel); } } }
/** * Add additional attributes to the action. If any of these attributes * are null then they will still be set on the action. Many of these * attributes map to the set methods on <code>AbstractActionExt</code> * * @see AbstractActionExt * @param action the action which will all the attributes will be applied */ public static void decorateAction(AbstractAction action, String shortDesc, String longDesc, Icon smallIcon, Icon largeIcon, KeyStroke accel) { if (action instanceof AbstractActionExt) { AbstractActionExt a = (AbstractActionExt)action; a.setShortDescription(shortDesc); a.setLongDescription(longDesc); a.setSmallIcon(smallIcon); a.setLargeIcon(largeIcon); a.setAccelerator(accel); } else { action.putValue(Action.SHORT_DESCRIPTION, shortDesc); action.putValue(Action.LONG_DESCRIPTION, longDesc); action.putValue(Action.SMALL_ICON, smallIcon); action.putValue(AbstractActionExt.LARGE_ICON, largeIcon); action.putValue(Action.ACCELERATOR_KEY, accel); } } }