org.openpermis.editor.policy.gui
Class ComponentFactory

java.lang.Object
  extended by org.openpermis.editor.policy.gui.ComponentFactory
Direct Known Subclasses:
ButtonFactory, MenuBarFactory

public abstract class ComponentFactory
extends Object

Abstract factory for user interface components based on resource and action map keys.

Since:
0.1.0

Constructor Summary
protected ComponentFactory(ActionMap actionMap, org.jdesktop.application.ResourceMap resourceMap)
          Creates an abstract factory that operates on the specified action and resource map.
 
Method Summary
protected  Action getAction(String name)
          Returns a swing action with the specified name.
protected  ActionMap getActionMap()
          Returns the action map this factory operates on.
protected  String[] getEntries(String name)
          Returns the entries of a collection resource key.
protected  org.jdesktop.application.ResourceMap getResourceMap()
          Returns the resource map this factory operates on.
protected  boolean isComposite(String name)
          Checks if the resource entry is a special composite entry.
protected  boolean isGlue(String name)
          Checks if a resource entry is a glue entry.
protected  boolean isPlaceholder(String name)
          Checks if the resource entry is a special placeholder entry.
protected  boolean isSeparator(String name)
          Checks if a resource entry is a separator entry.
protected  String unmaskComposite(String name)
          Unmasks a name composite name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentFactory

protected ComponentFactory(ActionMap actionMap,
                           org.jdesktop.application.ResourceMap resourceMap)
Creates an abstract 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

getActionMap

protected ActionMap getActionMap()
Returns the action map this factory operates on.

Returns:
the action map this factory operates on.
Since:
0.1.0

getResourceMap

protected org.jdesktop.application.ResourceMap getResourceMap()
Returns the resource map this factory operates on.

Returns:
the resource map this factory operates on.
Since:
0.1.0

getAction

protected Action getAction(String name)
Returns a swing action with the specified name.

Parameters:
name - the name of the swing action as it appears in the resource map.
Returns:
the swing action requested.
Throws:
IllegalStateException - if the action cannot be found.
Since:
0.1.0

getEntries

protected String[] getEntries(String name)
Returns the entries of a collection resource key.

Collection resource keys always have the suffix .Entries.

Parameters:
name - the name of the collection resource.
Returns:
the entries requested, never null.
Since:
0.1.0

isPlaceholder

protected boolean isPlaceholder(String name)
Checks if the resource entry is a special placeholder entry.

Special entries are placeholder replaced at a later stage.

Parameters:
name - the name to check.
Returns:
true if the entry is a placeholder.
Since:
0.1.0

unmaskComposite

protected String unmaskComposite(String name)
Unmasks a name composite name.

Parameters:
name - the name to unmask if it is a isComposite(String) name.
Returns:
the unmasked name if it was a composite name, the unmodified name otherwise.
Since:
0.1.0

isComposite

protected boolean isComposite(String name)
Checks if the resource entry is a special composite entry.

Special entries are placeholder replaced at a later stage.

Parameters:
name - the name to check.
Returns:
true if the entry is a placeholder.
Since:
0.1.0

isGlue

protected boolean isGlue(String name)
Checks if a resource entry is a glue entry.

Parameters:
name - the resource entry to check.
Returns:
true if the entry denotes a glue entry, false otherwise.
Since:
0.1.0

isSeparator

protected boolean isSeparator(String name)
Checks if a resource entry is a separator entry.

Parameters:
name - the resource entry to check.
Returns:
true if the entry denotes a separator, false otherwise.
Since:
0.1.0


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