| java.lang.Object com.ibm.richtext.uiimpl.MenuBuilder com.ibm.richtext.swingui.SwingMenuBuilder
SwingMenuBuilder | final public class SwingMenuBuilder extends MenuBuilder (Code) | | SwingMenuBuilder provides a method for creating a set of Swing menus for interacting
with an MTextPanel. Future versions of this class may provide greater control
over the menu contents.
See Also: MTextPanel |
Field Summary | |
final public static int | ABOUT Id for a menu with an About item. | final public static int | BIDI Id for a menu that sets
the primary run direction for a paragraph. | final static String | COPYRIGHT | final public static int | EDIT Id for an Edit menu. | final public static int | FLUSH Id for a paragraph alignment menu. | final public static int | KEYMAP Id for a menu that sets the KeyRemap
on an MTextPanel. | final public static int | SIZE Id for the point sizes menu. | final public static int | STYLE Id for a Style menu. |
Method Summary | |
protected DialogFactory | createAboutDialogFactory() | public void | createMenus(JMenuBar menuBar, MTextPanel textPanel, Frame frame) Add a standard set of menus to the given menu bar. | public void | createMenus(JMenuBar menuBar, MTextPanel textPanel, Frame frame, int[] menus) Add a set of menus to the given menu bar. | protected DialogFactory | createNumberDialogFactory(String dialogTitle, String dialogMessage, Object key, boolean character) | protected DialogFactory | createObjectDialogFactory(String dialogTitle, String dialogMessage, Object key, boolean character, String[] names, Object[] values) | public static SwingMenuBuilder | getInstance() Return an instance of SwingMenuBuilder. | protected void | handleAddMenu(String key) |
ABOUT | final public static int ABOUT(Code) | | Id for a menu with an About item. When selected,
the item displays a Frame containing some
self-promotional text.
|
BIDI | final public static int BIDI(Code) | | Id for a menu that sets
the primary run direction for a paragraph. Run direction can be left-to-right,
right-to-left, or can use the default run direction from the Unicode bidi algorithm.
|
EDIT | final public static int EDIT(Code) | | Id for an Edit menu. The Edit menu has the following items:
- Undo - invoke undo() on the MTextPanel
- Redo - invoke redo() on the MTextPanel
- Cut - invoke cut() on the MTextPanel
- Copy - invoke copy() on the MTextPanel
- Paste - invoke paste() on the MTextPanel
- Clear - invoke clear() on the MTextPanel
- Select All - invoke selectAll() on the MTextPanel
|
FLUSH | final public static int FLUSH(Code) | | Id for a paragraph alignment menu. The menu has the following items:
- Leading - give selected paragraph(s) LEADING flush
- Center - give selected paragraph(s) CENTER flush
- Trailing - give selected paragraph(s) TRAILING flush
- Justified - give selected paragraph(s) full justification
|
KEYMAP | final public static int KEYMAP(Code) | | Id for a menu that sets the KeyRemap
on an MTextPanel. The menu has the following items:
- Default - set KeyRemap to identity remap
- Arabic - set KeyRemap to Arabic transliteration
- Hebrew - set KeyRemap to Hebrew transliteration
- Israel Nikud - set KeyRemap to Israel Nikud
- Thai Ketmanee - set KeyRemap to Thai Ketmanee
|
SIZE | final public static int SIZE(Code) | | Id for the point sizes menu. The menu has items that set the size of a character
in a typeface.
|
STYLE | final public static int STYLE(Code) | | Id for a Style menu. The Style menu has the following items:
- Plain - remove
WEIGHT ,
POSTURE ,
UNDERLINE and
STRIKETHROUGH attributes from the
current selection
- Bold - add
{WEIGHT,WEIGHT_BOLD} to
the current selection
- Italic - add
{POSTURE,POSTURE_ITALIC} to
the current selection
- Underline - add
{UNDERLINE,UNDERLINE_ON} to
the current selection
- Strikethrough - add
{STRIKETHROUGH,STRIKETHROUGH_ON}
to the current selection
- Font... - display a dialog allowing the user to
select a typeface (font family) for the current selection
- Forecolor... - display a dialog allowing the user to
select a foreground color for the current selection
- Backcolor... - display a dialog allowing the user to
select a background color for the current selection
|
createAboutDialogFactory | protected DialogFactory createAboutDialogFactory()(Code) | | |
createMenus | public void createMenus(JMenuBar menuBar, MTextPanel textPanel, Frame frame)(Code) | | Add a standard set of menus to the given menu bar. The menus
will interact with the given MTextPanel.
Parameters: menuBar - the MenuBar to which menus are added Parameters: textPanel - the MTextPanel with which the menus interact Parameters: frame - a Frame to use as the parent of any dialogs created by a a menu item. If null, menu items which create dialogs will be omitted. |
createMenus | public void createMenus(JMenuBar menuBar, MTextPanel textPanel, Frame frame, int[] menus)(Code) | | Add a set of menus to the given menu bar. The menus
will interact with the given MTextPanel.
Parameters: menuBar - the MenuBar to which menus are added Parameters: textPanel - the MTextPanel with which the menus interact Parameters: frame - a Frame to use as the parent of any dialogs created by a a menu item. If null, menu items which create dialogs will be omitted. Parameters: menus - an array of integer menu id's. Each element of thearray must be one of this class's menu id constants. If null,the default menus are created. |
createNumberDialogFactory | protected DialogFactory createNumberDialogFactory(String dialogTitle, String dialogMessage, Object key, boolean character)(Code) | | |
createObjectDialogFactory | protected DialogFactory createObjectDialogFactory(String dialogTitle, String dialogMessage, Object key, boolean character, String[] names, Object[] values)(Code) | | |
Methods inherited from com.ibm.richtext.uiimpl.MenuBuilder | abstract protected DialogFactory createAboutDialogFactory()(Code)(Java Doc) abstract protected DialogFactory createNumberDialogFactory(String dialogTitle, String dialogText, Object key, boolean character)(Code)(Java Doc) abstract protected DialogFactory createObjectDialogFactory(String dialogTitle, String dialogText, Object key, boolean character, String[] names, Object[] values)(Code)(Java Doc) final protected void doCreateMenus(MTextPanel textPanel, Frame frame, int[] menus)(Code)(Java Doc) abstract protected void handleAddMenu(String key)(Code)(Java Doc)
|
|
|