org.beanfabrics.model
Class AbstractOperationPM

java.lang.Object
  extended by org.beanfabrics.AbstractBean
      extended by org.beanfabrics.ValidatableBean
          extended by org.beanfabrics.model.AbstractPM
              extended by org.beanfabrics.model.AbstractOperationPM
All Implemented Interfaces:
Bean, ContextOwner, HasComparable, IOperationPM, PresentationModel, Supportable, Validatable
Direct Known Subclasses:
OperationPM

public abstract class AbstractOperationPM
extends AbstractPM
implements IOperationPM


Nested Class Summary
 
Nested classes/interfaces inherited from class org.beanfabrics.model.AbstractPM
AbstractPM.PropertiesValidationRule
 
Field Summary
 
Fields inherited from class org.beanfabrics.model.AbstractPM
KEY_MESSAGE_ONE_OR_MORE_INVALID
 
Constructor Summary
protected AbstractOperationPM()
          Constructs a new AbstractOperationPM.
 
Method Summary
 void check()
          Checks whether this operation is enabled.
abstract  boolean execute()
          Executes this operation.
 java.lang.String getDescription()
          Returns the description of this operation.
 javax.swing.Icon getIcon()
          Returns the Icon of this operation.
 java.lang.String getTitle()
          Returns the title of this operation.
 boolean isEnabled()
          Returns whether this operation is enabled.
 void setDescription(java.lang.String description)
          Sets the description of this operation.
 void setIcon(javax.swing.Icon newIcon)
          Sets the icon of this operation.
 void setIconUrl(java.net.URL url)
          Sets the URL pointing to the icon of this operation.
 void setTitle(java.lang.String title)
          Sets the title of this operation.
 
Methods inherited from class org.beanfabrics.model.AbstractPM
getComparable, getContext, getSupportMap, revalidateProperties
 
Methods inherited from class org.beanfabrics.ValidatableBean
getValidationState, getValidator, isValid, revalidate, setValidationState
 
Methods inherited from class org.beanfabrics.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, equals, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.beanfabrics.model.IOperationPM
getValidator
 
Methods inherited from interface org.beanfabrics.Bean
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface org.beanfabrics.validation.Validatable
getValidationState, isValid, revalidate
 
Methods inherited from interface org.beanfabrics.support.Supportable
getSupportMap
 
Methods inherited from interface org.beanfabrics.context.ContextOwner
getContext
 
Methods inherited from interface org.beanfabrics.HasComparable
getComparable
 

Constructor Detail

AbstractOperationPM

protected AbstractOperationPM()
Constructs a new AbstractOperationPM.

Method Detail

setIcon

public void setIcon(javax.swing.Icon newIcon)
Sets the icon of this operation.

Specified by:
setIcon in interface IOperationPM

getIcon

public javax.swing.Icon getIcon()
Returns the Icon of this operation. Some views might display this icon on a GUI widget.

Specified by:
getIcon in interface IOperationPM

setIconUrl

public void setIconUrl(java.net.URL url)
Sets the URL pointing to the icon of this operation.

Specified by:
setIconUrl in interface IOperationPM

getTitle

public java.lang.String getTitle()
Returns the title of this operation. Some views might use this text as the label for the GUI widget.

Specified by:
getTitle in interface IOperationPM
Returns:
the title of this operation

setTitle

public void setTitle(java.lang.String title)
Sets the title of this operation.

Specified by:
setTitle in interface IOperationPM
See Also:
IOperationPM.getTitle()

getDescription

public java.lang.String getDescription()
Returns the description of this operation. It describes the intent of this operation for the user.

A view displays this text usually in the form of a tooltip.

Specified by:
getDescription in interface IOperationPM
Returns:
the description of this operation

setDescription

public void setDescription(java.lang.String description)
Sets the description of this operation.

Specified by:
setDescription in interface IOperationPM
See Also:
IOperationPM.getDescription()

execute

public abstract boolean execute()
                         throws java.lang.Throwable
Executes this operation.

Specified by:
execute in interface IOperationPM
Returns:
true if this operation has been executed successfully
Throws:
java.lang.Throwable

isEnabled

public boolean isEnabled()
Returns whether this operation is enabled. If an operation is enabled it can be executed.

Specified by:
isEnabled in interface IOperationPM
Returns:
true if this operation can be executed, otherwise false.

check

public void check()
           throws java.lang.IllegalStateException
Checks whether this operation is enabled. If it is enabled, it just returns, otherwise it throws an IllegalStateException.

Specified by:
check in interface IOperationPM
Throws:
java.lang.IllegalStateException - if this operation is not enabled