/** * Set name of action. Used for a menu or button text. If {@code null} is * specified, any existing value is lost (removed). * * @param name Name of action. * * @see #NAME */ public void setName( final String name ) { putValue( NAME, name ); }
/** * Set long description of action. Could be used for context-sensitive help. * If {@code null} is specified, any existing value is lost (removed). * * @param description Long description. * * @see #LONG_DESCRIPTION */ public void setLongDescription( final String description ) { putValue( LONG_DESCRIPTION, description ); }
/** * Set key stroke to use as keyboard accelerator. If {@code null} is * specified, any existing value is lost (removed). * * @param key Keystroke to use as keyboard accelerator. * * @see #ACCELERATOR_KEY * @see KeyStroke */ public void setAcceleratorKey( final KeyStroke key ) { putValue( ACCELERATOR_KEY, key ); }
/** * Set command string to associate with action. If {@code null} is * specified, any existing value is lost (removed). * * @param command Command string to associate with action. * * @see #ACTION_COMMAND_KEY * @see ActionEvent */ private void setActionCommand( final String command ) { putValue( ACTION_COMMAND_KEY, command ); }
/** * Set small icon. Used for toolbar buttons. If {@code null} is specified, * any existing value is lost (removed). * * @param icon Small icon. * * @see #SMALL_ICON * @see Icon */ public void setSmallIcon( final Icon icon ) { putValue( SMALL_ICON, icon ); }
/** * Set integer key code to use as mnemonic (e.g. key to select menu item). * If a negative code is specified, any existing value is lost (removed). * * @param key Integer key code to use as mnemonic. * * @see #MNEMONIC_KEY * @see java.awt.event.KeyEvent * @see javax.swing.JMenuItem#setAction(javax.swing.Action) */ public void setMnemonicKey( final int key ) { putValue( MNEMONIC_KEY, ( key < 0 ) ? null : new Integer( key ) ); }
/** * Set short description of action. Used for tooltip text. If {@code null} * is specified, any existing value is lost (removed). * * @param description Short description. * * @see #SHORT_DESCRIPTION */ public void setShortDescription( final String description ) { putValue( SHORT_DESCRIPTION, TextTools.plainTextToHTML( description ) ); }