org.openpermis.editor.policy.presenter
Class Presenter<M>

java.lang.Object
  extended by org.openpermis.editor.policy.presenter.Presenter<M>
Type Parameters:
M - the model of this presenter.
Direct Known Subclasses:
PartPresenter, RecentFilesPresenter

public abstract class Presenter<M>
extends Object

Abstract base class for presenter beans.

All abstract presenters have built-in property change support for bound properties.

Since:
0.1.0

Field Summary
private  PropertyChangeSupport changeSupport
          Beans property change support.
private  M model
          The model this presenter is bound to.
private  String[] titleParameters
          An array of title parameters for suitable display in a view title.
 
Constructor Summary
protected Presenter(M model)
          Creates an abstract presenter for the specified domain object.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Registers the specified property change listener.
abstract  void dispose()
          Disposes this presenter.
protected  void firePropertyChange(String property, Object oldValue, Object newValue)
          Support for reporting bound property changes for Object properties.
protected  M getModel()
          Returns the model of this presenter.
 String[] getTitleParameters()
          Returns an array of title parameters for suitable display in a view title.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the specified property change listener.
 void setTitleParameters(String... titleParameters)
          Sets the array of title parameters which are used in view titles.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changeSupport

private final PropertyChangeSupport changeSupport
Beans property change support.

Since:
0.1.0

model

private final M model
The model this presenter is bound to.

Since:
0.1.0

titleParameters

private String[] titleParameters
An array of title parameters for suitable display in a view title.

Since:
0.1.0
Constructor Detail

Presenter

protected Presenter(M model)
Creates an abstract presenter for the specified domain object.

Parameters:
model - the domain object this presenter represents, must not be null.
Since:
0.1.0
Method Detail

getModel

protected final M getModel()
Returns the model of this presenter.

Returns:
the model of this presenter.
Since:
0.1.0

getTitleParameters

public String[] getTitleParameters()
Returns an array of title parameters for suitable display in a view title.

Returns:
the request array of title parameters, never null.
Since:
0.1.0

setTitleParameters

public void setTitleParameters(String... titleParameters)
Sets the array of title parameters which are used in view titles.

Parameters:
titleParameters - the new array to set.
Since:
0.1.0

dispose

public abstract void dispose()
Disposes this presenter.

The presenter has to remove all listeners registered.

Since:
0.1.0

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Registers the specified property change listener.

Parameters:
listener - the listener to register.
Since:
0.1.0

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the specified property change listener.

Parameters:
listener - the listener to remove.
Since:
0.1.0

firePropertyChange

protected void firePropertyChange(String property,
                                  Object oldValue,
                                  Object newValue)
Support for reporting bound property changes for Object properties.

Use this method to inform registered property change listeners of a change in a bound property.

Parameters:
property - the property whose value has changed.
oldValue - the previous value of the property.
newValue - the new value of the property.
Since:
0.1.0


PERMIS Role Based Access Control 0.3.0 (Build 14)
2009/05/08 09:06:48
Copyright (c) 2002-2007 Ergon Informatik AG