edu.stanford.smi.protegex.owl.ui.actions
Interface OWLModelAction

All Superinterfaces:
edu.stanford.smi.protege.util.Disposable, IconOwner
All Known Implementing Classes:
AbstractOWLModelAction, AbstractOWLModelTestAction

public interface OWLModelAction
extends edu.stanford.smi.protege.util.Disposable, IconOwner

An object representing a global "action" which can be used in tool bars and menu bars. This interface is independent from the Swing Action class, because it should also serve as a container for action items in Eclipse or similar platforms.

Author:
Holger Knublauch

Field Summary
static String ICON
           
static String NAME
           
static String PATH_SEPARATOR
           
static String SUITABILITY
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to receive events when one of the characteristics of this (name, icon, suitability) have changed.
 String getMenubarPath()
          Gets a path to the menu bar location of this action.
 String getName()
          Gets the human readable name of this action, to be used as menu item text and tool bar button tool tip text.
 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)
           
 void run(OWLModel owlModel)
          Called when the action is executed by the user.
 
Methods inherited from interface edu.stanford.smi.protege.util.Disposable
dispose
 
Methods inherited from interface edu.stanford.smi.protegex.owl.ui.actions.IconOwner
getIconFileName, getIconResourceClass
 

Field Detail

PATH_SEPARATOR

public static final String PATH_SEPARATOR
See Also:
Constant Field Values

NAME

public static final String NAME
See Also:
Constant Field Values

ICON

public static final String ICON
See Also:
Constant Field Values

SUITABILITY

public static final String SUITABILITY
See Also:
Constant Field Values
Method Detail

addPropertyChangeListener

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

Parameters:
listener - the listener to add

getMenubarPath

public String getMenubarPath()
Gets a path to the menu bar location of this action. This method determines where the menu item will show up, if at all. The path consists of a menu name with an optional group name. There must be a '/' character (PATH_SEPARATOR) between the menu and group name.

Returns:
the path for the menu or null if this shall not appear in the menu

getName

public String getName()
Gets the human readable name of this action, to be used as menu item text and tool bar button tool tip text.

Returns:
the name (must not be null)

getToolbarPath

public String getToolbarPath()
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.

Returns:
the path or null

isSuitable

public boolean isSuitable(OWLModel owlModel)
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.

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)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)

run

public void run(OWLModel owlModel)
Called when the action is executed by the user.

Parameters:
owlModel - the OWLModel to operate on