Class ToolBarFactory
java.lang.Object
org.apache.batik.util.resources.ResourceManager
org.apache.batik.util.gui.resource.ToolBarFactory
This class represents a tool bar factory which builds
tool bars from the content of a resource file.
The resource entries format is (for a tool bar named 'ToolBar'):
The resource entries format is (for a tool bar named 'ToolBar'):
ToolBar = Item1 Item2 - Item3 ... See ButtonFactory.java for details about the items ... '-' represents a separatorAll entries are optional.
- Version:
- $Id: ToolBarFactory.java 1808001 2017-09-11 09:51:29Z ssteiner $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ButtonFactory
The button factoryprivate static final String
Fields inherited from class org.apache.batik.util.resources.ResourceManager
bundle
-
Constructor Summary
ConstructorsConstructorDescriptionToolBarFactory
(ResourceBundle rb, ActionMap am) Creates a new tool bar factory -
Method Summary
Modifier and TypeMethodDescriptioncreateJButton
(String name) Creates and returns a new swing buttoncreateJToolBar
(String name) Creates a tool barMethods inherited from class org.apache.batik.util.resources.ResourceManager
getBoolean, getCharacter, getInteger, getString, getStringList, getStringList, getStringList
-
Field Details
-
SEPARATOR
- See Also:
-
buttonFactory
The button factory
-
-
Constructor Details
-
ToolBarFactory
Creates a new tool bar factory- Parameters:
rb
- the resource bundle that contains the menu bar description.am
- the actions to add to menu items
-
-
Method Details
-
createJToolBar
public JToolBar createJToolBar(String name) throws MissingResourceException, ResourceFormatException, MissingListenerException Creates a tool bar- Parameters:
name
- the name of the menu bar in the resource bundle- Throws:
MissingResourceException
- if one of the keys that compose the tool bar is missing. It is not thrown if the action key is missing.ResourceFormatException
- if a boolean is malformedMissingListenerException
- if an item action is not found in the action map.
-
createJButton
public JButton createJButton(String name) throws MissingResourceException, ResourceFormatException, MissingListenerException Creates and returns a new swing button- Parameters:
name
- the name of the button in the resource bundle- Throws:
MissingResourceException
- if key is not the name of a button. It is not thrown if the mnemonic and the action keys are missingResourceFormatException
- if the mnemonic is not a single characterMissingListenerException
- if the button action is not found in the action map.
-