org.beanfabrics.model
Interface IOperationPM

All Superinterfaces:
Bean, ContextOwner, HasComparable, PresentationModel, Supportable, Validatable
All Known Implementing Classes:
AbstractOperationPM, OperationPM

public interface IOperationPM
extends PresentationModel

The IOperationPM represents a PresentationModel for view components that can invoke an operation, like buttons and menu items.


Method Summary
 void check()
          Checks whether this operation is enabled.
 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.
 Validator getValidator()
          Returns the Validator of this object.
 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 icon)
          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 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
 

Method Detail

execute

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

Returns:
true if this operation has been executed successfully
Throws:
java.lang.Throwable

isEnabled

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

Returns:
true if this operation can be executed, otherwise false.

check

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

Throws:
java.lang.IllegalStateException - if this operation is not enabled

getDescription

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.

Returns:
the description of this operation

setDescription

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

Parameters:
description -
See Also:
getDescription()

getValidator

Validator getValidator()
Returns the Validator of this object. The validator is responsible for creating the ValidationState of this object by evaluating a specific set of ValidationRules.

Specified by:
getValidator in interface Validatable
Returns:
the Validator of this object

getTitle

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

Returns:
the title of this operation

setTitle

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

Parameters:
title -
See Also:
getTitle()

getIcon

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


setIcon

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

Parameters:
icon -

setIconUrl

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

Parameters:
url -