ilog.views.appframe.docview
Class IlvAbstractStaticViewContainer

java.lang.Object
  extended by ilog.views.appframe.docview.IlvAbstractStaticViewContainer
All Implemented Interfaces:
IlvViewContainer, ActionHandler, IlvPropertyManager, ActionListener, EventListener
Direct Known Subclasses:
IlvDefaultStaticViewContainer

public abstract class IlvAbstractStaticViewContainer
extends Object
implements IlvViewContainer

This class provides a skeletal implementation of the IlvViewContainer interface for static view containers.


Field Summary
 
Fields inherited from interface ilog.views.appframe.docview.IlvViewContainer
ACTIVE_VIEW_PROPERTY, APPLICATION_PROPERTY, CONFIGURATION_NAME_PROPERTY, CONTAINER_TEMPLATE_PROPERTY, DOCUMENT_PROPERTY, DOCUMENT_TEMPLATE_PROPERTY, DOCUMENT_VIEWS_PROPERTY, VISIBILITY_PROPERTY
 
Constructor Summary
IlvAbstractStaticViewContainer()
          Constructs a new IlvAbstractStaticViewContainer instance.
IlvAbstractStaticViewContainer(IlvDocumentView view)
          Constructs a new IlvAbstractStaticViewContainer instance that contains the specified document view.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Invoked when an action occurs.
abstract  void activate()
          Sets the container as active.
 void addActionHandler(ActionHandler actionHandler)
          Adds the specified actionHandler to the list of action handlers of the view container.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a listener that listens for changes to the properties of this view container.
protected abstract  IlvDocumentView[] findViews()
          Invoked by the getViews() method to retrieve the document views contained by this view container.
 Object getProperty(String key)
          Returns the property of this view container with the specified key.
 IlvDocumentView[] getViews()
          Returns the document views of this container that are provided with the findViews() method.
 boolean isContainerVisible()
          Determines whether this view container is visible.
 boolean isProcessingAction(String command)
          Determines whether the view container can perform the action with the specified command key in its actionPerformed(java.awt.event.ActionEvent) method.
 boolean removeActionHandler(ActionHandler actionHandler)
          Removes the specified actionHandler from the list of action handlers managed by this view container.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the specified listener from the list of PropertyChange listeners managed by this object.
 void setContainerVisible(boolean visible)
          Shows or hides this view container depending on the value of the visible parameter.
 Object setProperty(String key, Object value)
          Changes the value of one of the properties of this view container.
 boolean updateAction(Action action)
          Invoked by the application to update the state of the specified action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvAbstractStaticViewContainer

public IlvAbstractStaticViewContainer()
Constructs a new IlvAbstractStaticViewContainer instance.


IlvAbstractStaticViewContainer

public IlvAbstractStaticViewContainer(IlvDocumentView view)
Constructs a new IlvAbstractStaticViewContainer instance that contains the specified document view. The method getViews() returns an array of one element containing this document view and the findViews() is not called.

Parameters:
view - The document view owned by this view container.
Method Detail

getViews

public IlvDocumentView[] getViews()
Returns the document views of this container that are provided with the findViews() method.

Specified by:
getViews in interface IlvViewContainer
Returns:
the array of views of this view container.

findViews

protected abstract IlvDocumentView[] findViews()
Invoked by the getViews() method to retrieve the document views contained by this view container. This method is invoked only the first time the getViews() is invoked. The views returned by this method are then stored and returned the next time the getViews() method is called.

Returns:
the array of views of this view container.

activate

public abstract void activate()
Sets the container as active.

Specified by:
activate in interface IlvViewContainer

isContainerVisible

public boolean isContainerVisible()
Determines whether this view container is visible. The default implementation of this method returns false.

Specified by:
isContainerVisible in interface IlvViewContainer
Returns:
true if the container is visible; false otherwise.
See Also:
setContainerVisible(boolean)

setContainerVisible

public void setContainerVisible(boolean visible)
Shows or hides this view container depending on the value of the visible parameter. The default implementation of this method is empty.

Specified by:
setContainerVisible in interface IlvViewContainer
Parameters:
visible - If true the view container is shown; if false the view container is hidden.
See Also:
isContainerVisible()

updateAction

public boolean updateAction(Action action)
Invoked by the application to update the state of the specified action.
By default, this method invokes the list of action handlers added to the view container with the method addActionHandler(ilog.views.appframe.event.ActionHandler) until one action handler can update the action.

Specified by:
updateAction in interface ActionHandler
Parameters:
action - The action to update.
Returns:
true if one action handler can update the specified action; false otherwise.
See Also:
addActionHandler(ilog.views.appframe.event.ActionHandler)

isProcessingAction

public boolean isProcessingAction(String command)
Determines whether the view container can perform the action with the specified command key in its actionPerformed(java.awt.event.ActionEvent) method. By default, this method returns true if one action handler added to the view container can process this action; false otherwise.

Specified by:
isProcessingAction in interface ActionHandler
Parameters:
command - The command key of the action.
Returns:
true if the action listener performs the specified action; false otherwise.
See Also:
addActionHandler(ilog.views.appframe.event.ActionHandler), actionPerformed(java.awt.event.ActionEvent)

actionPerformed

public void actionPerformed(ActionEvent e)
Invoked when an action occurs. If an action handler added to the view container can process this action, its ActionListener.actionPerformed(java.awt.event.ActionEvent) method is invoked; otherwise this method does nothing.

Specified by:
actionPerformed in interface ActionListener
See Also:
addActionHandler(ilog.views.appframe.event.ActionHandler)

addActionHandler

public void addActionHandler(ActionHandler actionHandler)
Adds the specified actionHandler to the list of action handlers of the view container.

Parameters:
actionHandler - The new action handler to add.
See Also:
removeActionHandler(ilog.views.appframe.event.ActionHandler)

removeActionHandler

public boolean removeActionHandler(ActionHandler actionHandler)
Removes the specified actionHandler from the list of action handlers managed by this view container.

Returns:
true if the action handler was previously added; false otherwise.
See Also:
addActionHandler(ilog.views.appframe.event.ActionHandler)

getProperty

public Object getProperty(String key)
Returns the property of this view container with the specified key.

Specified by:
getProperty in interface IlvPropertyManager
Parameters:
key - The non-null property key.
Returns:
The value of the specified property. It returns null if the specified property was not found.
See Also:
setProperty(java.lang.String, java.lang.Object)

setProperty

public Object setProperty(String key,
                          Object value)
Changes the value of one of the properties of this view container. If the value has changed, a PropertyChangeEvent is sent to the property change listeners.

Specified by:
setProperty in interface IlvPropertyManager
Parameters:
key - The non-null property key.
value - An Object value. If it is equal to null, the property with the specified key is removed.
Returns:
The previous value of the property.
See Also:
getProperty(java.lang.String)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener that listens for changes to the properties of this view container.

Specified by:
addPropertyChangeListener in interface IlvPropertyManager
Parameters:
listener - The listener to add
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the specified listener from the list of PropertyChange listeners managed by this object.

Specified by:
removePropertyChangeListener in interface IlvPropertyManager
Parameters:
listener - The listener to remove
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.