public interface Action2
extends javax.swing.Action
Action.NAME
.
The Action.NAME
property is treated as a caption when it is set to a
menu item. In the meanwhile, it is treated as its identifier which is used
when users need to retrieve the menu items from a list. That means you cannot
create two or more menu items which have a same caption string.
Use Action2#NAME property to set an independent caption string. This requires additional process : calling processXXX() methods before the menu item is shown. This is very ugly but I believe the cost is less than its benefit.
(Tue, 09 Jul 2019 17:53:51 +0900)
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CAPTION |
static java.lang.String |
MENU_CATEGORY |
Modifier and Type | Method and Description |
---|---|
static <C extends javax.swing.AbstractButton> |
processButton(C button) |
static javax.swing.JMenuBar |
processMenuBar(javax.swing.JMenuBar menuBar) |
static java.awt.Component |
processMenuItem(java.awt.Component menuItemObject) |
static void |
setCaption(javax.swing.Action action,
java.lang.String caption) |
static final java.lang.String MENU_CATEGORY
static final java.lang.String CAPTION
static void setCaption(javax.swing.Action action, java.lang.String caption)
static <C extends javax.swing.AbstractButton> C processButton(C button)
static java.awt.Component processMenuItem(java.awt.Component menuItemObject)
static javax.swing.JMenuBar processMenuBar(javax.swing.JMenuBar menuBar)