org.openpermis.editor.policy.gui
Class ToolBarFactory

java.lang.Object
  extended by org.openpermis.editor.policy.gui.ComponentFactory
      extended by org.openpermis.editor.policy.gui.ButtonFactory
          extended by org.openpermis.editor.policy.gui.ToolBarFactory

public final class ToolBarFactory
extends ButtonFactory

Factory for tool bars.

The factory creates tool bars from a resource description.

Since:
0.1.0

Constructor Summary
ToolBarFactory(ActionMap actionMap, org.jdesktop.application.ResourceMap resourceMap)
          Creates a tool bar factory that operates on the specified action and resource map.
 
Method Summary
private  void addToolBarEntries(JToolBar toolBar, String toolBarName, String[] entries)
          Recursively adds all entries to the tool bar specified.
private  boolean addToolBarEntries(JToolBar toolBar, String toolBarName, String[] entries, boolean addStrut)
          Primitive to add tool bar entries.
static JToolBar createToolBar(ActionMap actionMap, org.jdesktop.application.ResourceMap resourceMap, String key)
          Convenience method to create a tool bar.
 JToolBar createToolBar(String key)
          Creates a tool bar from the specfied resource key.
 
Methods inherited from class org.openpermis.editor.policy.gui.ButtonFactory
createToolButton
 
Methods inherited from class org.openpermis.editor.policy.gui.ComponentFactory
getAction, getActionMap, getEntries, getResourceMap, isComposite, isGlue, isPlaceholder, isSeparator, unmaskComposite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ToolBarFactory

public ToolBarFactory(ActionMap actionMap,
                      org.jdesktop.application.ResourceMap resourceMap)
Creates a tool bar factory that operates on the specified action and resource map.

Parameters:
actionMap - the action map this factory operates on.
resourceMap - the resource map this factory operates on.
Since:
0.1.0
Method Detail

createToolBar

public static JToolBar createToolBar(ActionMap actionMap,
                                     org.jdesktop.application.ResourceMap resourceMap,
                                     String key)
Convenience method to create a tool bar.

Except for performance this convenience method is equivalent to creating a tool bar factory for the specfied action and resource map and then creating the tool bar using the newly created factory.

Parameters:
actionMap - the action map this factory operates on.
resourceMap - the resource map this factory operates on.
key - the resource key for the tool bar.
Returns:
the tool bar requested.
Since:
0.1.0

addToolBarEntries

private void addToolBarEntries(JToolBar toolBar,
                               String toolBarName,
                               String[] entries)
Recursively adds all entries to the tool bar specified.

Parameters:
toolBar - the tool bar to add entries to.
toolBarName - the resource key of the tool bar.
entries - the entries to add.
Since:
0.1.0

addToolBarEntries

private boolean addToolBarEntries(JToolBar toolBar,
                                  String toolBarName,
                                  String[] entries,
                                  boolean addStrut)
Primitive to add tool bar entries.

Struts are added between non-separator tool bar entries.

Parameters:
toolBar - the tool bar to add entries to.
toolBarName - the resource key of the tool bar.
entries - the entries to add.
addStrut - true if a strut should be added before adding an entry.
Returns:
true if a strut should be added before adding the next entry.
Since:
0.1.0

createToolBar

public JToolBar createToolBar(String key)
Creates a tool bar from the specfied resource key.

Parameters:
key - the resource key from which to create tool bar.
Returns:
the tool bar created.
Since:
0.1.0


PERMIS Role Based Access Control 0.4.0 (Build 15)
2009/05/20 08:15:22
Copyright (c) 2002-2007 Ergon Informatik AG