Java: Swing: Components: Actions: Action-executing and Actions
Class | Methods | Action command | Used action |
|---|---|---|---|
SwingUtilities | notifyAction | from action itself (ACTION_COMMAND_KEY) (never set internally), or from KeyEvent character | generic only invoked from JComponent's key binding processing |
JTextComponent | cut/copy/paste | action's NAME | Actions from TransferHandler (study logic later) |
DefaultCaret | mouseClicked | null | DefaultEditorKit.Select(Word|Line)Action |
DefaultEditorKit | actions | forwarded | some actions are implemented by two other actions |
BasicTextUI | TextActionWrapper.actionPerformed | forwarded | wrapper around action (misses most properties), for isEnabled, use? |
BasicLookAndFeel | playSound | ? | ? |
BasicComboBoxUI | EnterAction.actionPerformed | forwarded (wrong event source?) | hack to forward to other action |
BasicComboBoxUI | EditorActionListener.actionPerformed | forwarded | hack to forward to combo box action if selection didn't change |
BasicTreeUI | KeyHandler.keyPressed | "" | ? |
Class | Use | Classification |
|---|---|---|
DefaultEditorKit.DefaultKeyTypedAction DefaultEditorKit.InsertContentAction | insert as text (intended for ActionMap) | needed |
StyledEditorKit.FontFamilyAction StyledEditorKit.FontSizeAction StyledEditorKit.ForegroundAction StyledEditorKit.ColorAction | parse, use as instead of parameter (if action event comes from editor) not used | strange |
BasicTabbedPaneUI | Action parses as mnemonic (previously registered in ActionMap for mnemonics) | OK (internal) |
Class | Description |
|---|---|
JButton JCheckBox JRadioButton JToggleButton JMenu JMenuItem JCheckBoxMenuItem JRadioButtonMenuItem | have action constructors have setAction (by AbstractButton) |
JComboBox JTextField | have setAction |
JMenu JPopupMenu JToolBar | use setAction for given action on created component |
BasicTabbedPaneUI | scrollable tab buttons (also action map actions) always enabled |
MetalTitlePane (not internal frame!) | close, iconify, maximize/minimize buttons (localized names) externally disabled |
MetalFileChooserUI WindowFileChooserUI | up (also action map), new folder buttons externally disabled |
None of these classes are accessible, some don't exist any more.
Class | Enclosing class | Name | Purpose | Remarks |
|---|---|---|---|---|
IncrementAction | InternationalFormatter.Filter | "increment", "decrement" | change value (also used for decrement) | |
IncrementAction, DecrementAction | JSpinner.DefaultEditor | ? | removed in 1.4.1beta | |
ValueDelta | colorchooser.JIntegerTextField | ? | like increment/decrement | removed (when?) |
DefaultAction | RootPane | null | fakes click on default button | not used anymore |
TransferAction | TransferHandler | "cut", "copy", "paste" (undocumented) | for cut, copy, paste (getXXXAction) |
Action registration name | Purpose | Used on | isEnabled | Action name | Action class | Code | Remarks |
|---|---|---|---|---|---|---|---|
postTip | show tool tip | any registered JComponent | always | null | anonymous ToolTipManager | ToolTipManager | rude |
hideTip | hide tool tip | any registered JComponent | if showing | null | anonymous ToolTipManager | ToolTipManager | rude |
cancel | cancel dialog | internal button | always | null | anonymous ColorChooserDialog | JColorChooser | |
increment, decrement | not known, set to empty action | formatted text field | never | null | JSpinner.DisabledAction |
Rest by LAF
(C) 2001-2009 Christian Kaufhold (swing@chka.de)