edu.stanford.smi.protegex.owl.ui.actions
Class ResourceAction

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byedu.stanford.smi.protegex.owl.ui.actions.ResourceAction
All Implemented Interfaces:
Action, ActionListener, Cloneable, Comparable, EventListener, Serializable
Direct Known Subclasses:
AddClosureAxiomAction, AddCoveringAxiomAction, AddRDFTypeAction, AddSubclassAction, ChangeMetaclassAction, ChangeMetaclassOfSubclassesAction, ChangePropertyTypeAction, CheckSingleConceptConsistencyAction, CollapseTreeAction, ComputeIndividualsBelongingToClassAction, ComputeSingleIndividualTypesAction, ConvertIndividualToClassAction, ConvertToDatatypePropertyAction, ConvertToDefinedClassAction, ConvertToObjectPropertyAction, ConvertToPrimitiveClassAction, CreateClassUsingMetaclassAction, CreateCloneAction, CreateRDFListResourceAction, CreateSiblingClassAction, CreateSubclassAction, CreateSubpropertyAction, DeleteClassAction, DeletePropertyAction, EditRuleAction, ExistentialMatrixAction, ExpandTreeAction, ExplorerAction, ExtractOntologyAction, ExtractTaxonomyAction, GetInferredSubClassesAction, GetInferredSuperClassesAction, HideClassAction, JavaCodeGeneratorResourceAction, RefactorResourceAction, RemoveRDFTypeAction, SearchNamedClassAction, SortSubclassesAction, SortSubclassesTreeAction, SubclassesMatrixAction, SubpropertiesMatrixAction, UnhideClassAction

public abstract class ResourceAction
extends AbstractAction
implements Comparable

Author:
Holger Knublauch
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.AbstractAction
 
Field Summary
private  Component component
           
private  String group
           
private  boolean inToolBar
           
private  RDFResource resource
           
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ResourceAction(String name, Icon icon)
           
ResourceAction(String name, Icon icon, String group)
           
ResourceAction(String name, Icon icon, String group, boolean inToolBar)
          Constructs a new ResourceAction.
 
Method Summary
 int compareTo(Object o)
           
protected  Component getComponent()
           
 String getGroup()
           
 OWLModel getOWLModel()
           
 int getPriority()
          Gets an (optional) integer that can be used to control the order of actions in a menu.
protected  RDFResource getResource()
           
 void initialize(Component component, RDFResource resource)
           
 boolean isInToolBar()
           
abstract  boolean isSuitable(Component component, RDFResource resource)
           
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.awt.event.ActionListener
actionPerformed
 

Field Detail

component

private Component component

group

private String group

inToolBar

private boolean inToolBar

resource

private RDFResource resource
Constructor Detail

ResourceAction

public ResourceAction(String name,
                      Icon icon)

ResourceAction

public ResourceAction(String name,
                      Icon icon,
                      String group)

ResourceAction

public ResourceAction(String name,
                      Icon icon,
                      String group,
                      boolean inToolBar)
Constructs a new ResourceAction.

Parameters:
name - the display name of the Action
icon - the Icon
group - the (optional) group this should belong to
inToolBar - true to put this into the tool bar at the bottom of forms (this is only possible if there is an icon as well)
Method Detail

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

getComponent

protected Component getComponent()

getGroup

public String getGroup()

getPriority

public int getPriority()
Gets an (optional) integer that can be used to control the order of actions in a menu. The higher the number, the further up the item will appear.

Returns:
the priority (0 is default)

getOWLModel

public OWLModel getOWLModel()

getResource

protected RDFResource getResource()

initialize

public void initialize(Component component,
                       RDFResource resource)

isInToolBar

public boolean isInToolBar()

isSuitable

public abstract boolean isSuitable(Component component,
                                   RDFResource resource)