public class GuiFactory extends Object
The following keys are supported in the resource bundle:
Key | Purpose |
---|---|
menuBar | the menus for the menu bar |
toolBar | the buttons for the tool bar |
action.menu | the menu items or sub menus for a menu |
action.AcceleratorKey | The keystroke for triggering an action |
action.SwingDisplayedMnemonicIndexKey | The index of the mnemonic character to underline |
action.Name | The main text of the action, appears in menus |
action.MnemonicKey | The key to use as mnemonic |
action.ShortDescription | The text to show as a tooltip |
action.SmallIcon | Small icon, shown in menus |
action.SwingLargeIconKey | Large icon, shown in toolbars |
Constructor and Description |
---|
GuiFactory(@NotNull ResourceBundle resourceBundle,
@NotNull ActionMap actionMap)
Creates a GuiFactory.
|
Modifier and Type | Method and Description |
---|---|
@NotNull Action |
createAction(@NotNull String actionCommand)
Creates an dummy action.
|
@NotNull Action |
createAction(@NotNull String actionCommand,
@NotNull Action action)
Creates an action.
|
@NotNull Action |
createAction(@NotNull String actionCommand,
@NotNull ActionListener actionListener)
Creates an action.
|
@NotNull Action |
createAction(@NotNull String actionCommand,
@NotNull SerializableRunnable runnable)
Creates an action.
|
@NotNull JMenuBar |
createJMenuBar()
Creates a JMenuBar with the actions specified by the resource bundle.
|
@NotNull JMenuBar |
createJMenuBar(@NotNull String base)
Creates a JMenuBar with the actions specified by the resource bundle.
|
@NotNull JToolBar |
createJToolBar()
Creates a JToolBar with the actions specified by the resource bundle.
|
@NotNull JToolBar |
createJToolBar(@NotNull String base)
Creates a JToolBar with the actions specified by the resource bundle.
|
@NotNull Action |
setupAction(@NotNull String actionCommand,
@NotNull Action action)
Sets up an Action by initializing it form the resource bundle and storing it in the actionMap.
|
public GuiFactory(@NotNull @NotNull ResourceBundle resourceBundle, @NotNull @NotNull ActionMap actionMap)
resourceBundle
- The resource bundle from which to get the information about the components that are to be created.actionMap
- The action map for actions which are used for toolbar buttons and menu items.@NotNull public @NotNull JToolBar createJToolBar(@NotNull @NotNull String base)
base + ".toolBar"
.base
- Base to use.@NotNull public @NotNull JToolBar createJToolBar()
"toolBar"
.@NotNull public @NotNull JMenuBar createJMenuBar()
"menuBar"
.@NotNull public @NotNull JMenuBar createJMenuBar(@NotNull @NotNull String base)
base + ".menuBar"
.base
- The bae for the key to look up in the resource bundle.@NotNull public @NotNull Action createAction(@NotNull @NotNull String actionCommand, @NotNull @NotNull SerializableRunnable runnable)
actionCommand
- Action command for the action.runnable
- Runnable to run when the action is triggered.@NotNull public @NotNull Action createAction(@NotNull @NotNull String actionCommand, @NotNull @NotNull Action action)
actionCommand
- Action command for the action.action
- Action to create.@NotNull public @NotNull Action setupAction(@NotNull @NotNull String actionCommand, @NotNull @NotNull Action action)
actionCommand
- Action command of the action to initialize.action
- Action to setup.action
after it was setup.@NotNull public @NotNull Action createAction(@NotNull @NotNull String actionCommand, @NotNull @NotNull ActionListener actionListener)
actionListener
is actually an Action
, that action is setup instead.actionCommand
- Action command for the action.actionListener
- ActionListener to call when the action is triggered.@NotNull public @NotNull Action createAction(@NotNull @NotNull String actionCommand)
actionCommand
- Action command for the action.Copyright © 2016 Nelkinda Software Craft Pvt Ltd. All rights reserved.