org.openpermis.editor.policy.gui
Class PolicyIconRegistry

java.lang.Object
  extended by org.openpermis.editor.policy.gui.PolicyIconRegistry

public final class PolicyIconRegistry
extends Object

Helper class to create the policy icon registry.

This class is mainly used since the swing application framework only permits creation of resource maps based on classes.

Since:
0.3.0

Field Summary
private static String ANNOTATION_PREFIX
          Prefix for annotation icons.
private  IconRegistry iconRegistry
          The actual icon registry used internally.
private static String PART_TYPE_PREFIX
          Prefix for part type icons.
private static IconRegistry singleton
          Unfortunately we are forced to use a singleton here.
 
Constructor Summary
private PolicyIconRegistry(IconRegistry iconRegistry)
          Creates a new policy icon registry for the specified icon registry.
 
Method Summary
static PolicyIconRegistry create(org.jdesktop.application.ApplicationContext context)
          Creates a policy icon registry.
 Icon getIcon(Class<? extends org.openpermis.policy.bean.PartBean> partBeanType, IconAnnotation... annotations)
          Returns an icon for the specified part type.
 Icon getIcon(org.openpermis.policy.bean.PartBean partBean, IconAnnotation... annotations)
          Returns an icon for the specified part bean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANNOTATION_PREFIX

private static final String ANNOTATION_PREFIX
Prefix for annotation icons.

Constant Field Value:
"annotation."
Since:
0.3.0

PART_TYPE_PREFIX

private static final String PART_TYPE_PREFIX
Prefix for part type icons.

Constant Field Value:
"part."
Since:
0.3.0

singleton

private static IconRegistry singleton
Unfortunately we are forced to use a singleton here.

See IconRegistryConverter for the gory details.

Since:
0.3.0

iconRegistry

private final IconRegistry iconRegistry
The actual icon registry used internally.

Since:
0.3.0
Constructor Detail

PolicyIconRegistry

private PolicyIconRegistry(IconRegistry iconRegistry)
Creates a new policy icon registry for the specified icon registry.

See Also:
create(ApplicationContext)
Since:
0.3.0
Method Detail

create

public static final PolicyIconRegistry create(org.jdesktop.application.ApplicationContext context)
Creates a policy icon registry.

Parameters:
context - the application context to create the registry for.
Returns:
the icon registry requested.
Since:
0.3.0

getIcon

public Icon getIcon(org.openpermis.policy.bean.PartBean partBean,
                    IconAnnotation... annotations)
Returns an icon for the specified part bean.

Parameters:
partBean - the part bean for which to retrieve an icon.
annotations - an optional list of annotations for the icon.
Returns:
the icon requested or null if there is no icon available.
Since:
0.3.0

getIcon

public Icon getIcon(Class<? extends org.openpermis.policy.bean.PartBean> partBeanType,
                    IconAnnotation... annotations)
Returns an icon for the specified part type.

Parameters:
partBeanType - the part bean type for which to return an icon.
annotations - an optional list of annotations for the icon.
Returns:
the icon requested or null if there is no such icon.
Since:
0.3.0


PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:48
Copyright (c) 2002-2007 Ergon Informatik AG