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

java.lang.Object
  extended byedu.stanford.smi.protegex.owl.ui.actions.AbstractOWLModelAction
All Implemented Interfaces:
edu.stanford.smi.protege.util.Disposable, IconOwner, OWLModelAction
Direct Known Subclasses:
AllDifferentAction, CheckConsistencyAction, ClassifyTaxonomyAction, ComputeInferredTypesAction, DIGAction, DublinCoreAction, EMFAction, ImportsTreeAction, JavaCodeGeneratorAction, JenaSchemagenAction, KazukiAction, OWLPluginVersionInfoAction, OWLTestSettingsAction, PreferencesAction, ShowMetricsAction, ShowReasonerInspectorAction, ShowRepositoryEditorAction, SourceCodeAction, SPARQLOWLModelAction, ValidatorAction

public abstract class AbstractOWLModelAction
extends Object
implements OWLModelAction

A base class for OWLModelActions.

Author:
Holger Knublauch

Field Summary
static String CODE_MENU
           
private  Set listeners
           
static String OWL_MENU
           
static String PROJECT_MENU
           
private  boolean suitable
           
static String TOOLS_MENU
           
 
Fields inherited from interface edu.stanford.smi.protegex.owl.ui.actions.OWLModelAction
ICON, NAME, PATH_SEPARATOR, SUITABILITY
 
Constructor Summary
AbstractOWLModelAction()
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to receive events when one of the characteristics of this (name, icon, suitability) have changed.
 void dispose()
           
 String getIconFileName()
          Gets the relative name of an (optional) icon.
 Class getIconResourceClass()
          Gets a Class that is in the same folder as the icon file.
 String getToolbarPath()
          Gets the path to the tool bar location of this action.
 boolean isSuitable(OWLModel owlModel)
          Determines whether this action shall be used for the given OWLModel.
 void notifyPropertyChangeListeners(String propertyName, Object oldValue, Object newValue)
           
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.stanford.smi.protegex.owl.ui.actions.OWLModelAction
getMenubarPath, getName, run
 

Field Detail

listeners

private Set listeners

suitable

private boolean suitable

CODE_MENU

public static String CODE_MENU

OWL_MENU

public static String OWL_MENU

PROJECT_MENU

public static String PROJECT_MENU

TOOLS_MENU

public static String TOOLS_MENU
Constructor Detail

AbstractOWLModelAction

public AbstractOWLModelAction()
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: OWLModelAction
Adds a PropertyChangeListener to receive events when one of the characteristics of this (name, icon, suitability) have changed.

Specified by:
addPropertyChangeListener in interface OWLModelAction
Parameters:
listener - the listener to add

dispose

public void dispose()
Specified by:
dispose in interface edu.stanford.smi.protege.util.Disposable

getIconResourceClass

public Class getIconResourceClass()
Description copied from interface: IconOwner
Gets a Class that is in the same folder as the icon file.

Specified by:
getIconResourceClass in interface IconOwner
Returns:
the icon resource Class

getIconFileName

public String getIconFileName()
Description copied from interface: IconOwner
Gets the relative name of an (optional) icon.

Specified by:
getIconFileName in interface IconOwner
Returns:
the icon name such as "classify.gif" or null

getToolbarPath

public String getToolbarPath()
Description copied from interface: OWLModelAction
Gets the path to the tool bar location of this action. This is either null (to not show up in the tool bar), or a group name. Actions that shall be grouped together should get the same path.

Specified by:
getToolbarPath in interface OWLModelAction
Returns:
the path or null

isSuitable

public boolean isSuitable(OWLModel owlModel)
Description copied from interface: OWLModelAction
Determines whether this action shall be used for the given OWLModel. This allows programmers to veto the use of their action in OWLDatabaseModels or projects that don't import SWRL etc.

Specified by:
isSuitable in interface OWLModelAction
Parameters:
owlModel - the OWLModel to check against
Returns:
true if this is suitable for owlModel

notifyPropertyChangeListeners

public void notifyPropertyChangeListeners(String propertyName,
                                          Object oldValue,
                                          Object newValue)
Specified by:
notifyPropertyChangeListeners in interface OWLModelAction

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface OWLModelAction