ilog.views.appframe.event
Class IlvComponentVisibilityActionHandler

java.lang.Object
  extended by ilog.views.appframe.event.IlvSingleActionHandler
      extended by ilog.views.appframe.event.IlvCheckableActionHandler
          extended by ilog.views.appframe.event.IlvComponentVisibilityActionHandler
All Implemented Interfaces:
ActionHandler, ActionListener, EventListener

public class IlvComponentVisibilityActionHandler
extends IlvCheckableActionHandler

Defines action handlers associated with the visibility of a component or a document view container. Checking the action toggles the visibility of the associated component. When the visibility of the component is changed by code or through a UI interaction, the check state of the action is automatically updated.

By default, the action handler manages the visibility of two kinds of object:

This class can be overridden to reflect the state of visibility of other kinds of graphical component. For example, the action handler class that reflects the visibility of dockable panes in a docking area (see IlvDockingArea) inherits from this class. In this case, you are recommended to implement the derived class following these steps:

  1. Have a constructor that invokes the constructor IlvComponentVisibilityActionHandler(String).
  2. Add the appropriate listeners to your graphical components that notify the handler that the visibility state of the component has changed due to a graphical interaction.
  3. Override the methods isVisible() and setVisible(boolean).


Constructor Summary
protected IlvComponentVisibilityActionHandler(String command)
          Constructs a new IlvComponentVisibilityActionHandler that processes the action with the specified command key.
  IlvComponentVisibilityActionHandler(String command, Component component)
          Constructs a new IlvComponentVisibilityActionHandler that processes the action with the specified command key.
  IlvComponentVisibilityActionHandler(String command, IlvViewContainer viewContainer)
          Construct a new IlvComponentVisibilityActionHandler that processes the action with the specified command key.
 
Method Summary
 void actionPerformed(ActionEvent e)
          Invoked when an action occurs.
protected  boolean isVisible()
          Determines whether the component associated with the action handler is visible.
protected  void setVisible(boolean visible)
          Shows or hides the component associated with this action handler depending on the value of the visible parameter.
protected  boolean updateSingleAction(Action action)
          Invoked by the IlvSingleActionHandler.updateAction(javax.swing.Action) method.
 
Methods inherited from class ilog.views.appframe.event.IlvCheckableActionHandler
checkStateChanged, getGroup, isChecked, isLocked, isOneShot, lockStateChanged, setAction, setChecked, setLocked, setOneShot
 
Methods inherited from class ilog.views.appframe.event.IlvSingleActionHandler
getAction, getCommand, isProcessingAction, setCommand, updateAction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvComponentVisibilityActionHandler

protected IlvComponentVisibilityActionHandler(String command)
Constructs a new IlvComponentVisibilityActionHandler that processes the action with the specified command key. This constructor should be used by classes that inherit from this class.

Parameters:
command - The command key of the action this handler processes.

IlvComponentVisibilityActionHandler

public IlvComponentVisibilityActionHandler(String command,
                                           Component component)
Constructs a new IlvComponentVisibilityActionHandler that processes the action with the specified command key.

Parameters:
command - The command key of the action that this handler processes.
component - The component with the visibility state associated with the check state of the action that this handler processes.

IlvComponentVisibilityActionHandler

public IlvComponentVisibilityActionHandler(String command,
                                           IlvViewContainer viewContainer)
Construct a new IlvComponentVisibilityActionHandler that processes the action with the specified command key.

Parameters:
command - The command key of the action this handler processes.
viewContainer - The document view container with the visibility state associated with the check state of the action that this handler processes.
Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
Invoked when an action occurs. The action handler toggles the visibility state of its associated component.

Specified by:
actionPerformed in interface ActionListener
Specified by:
actionPerformed in class IlvSingleActionHandler
Parameters:
e - The action event.

updateSingleAction

protected boolean updateSingleAction(Action action)
Invoked by the IlvSingleActionHandler.updateAction(javax.swing.Action) method. Checks the action depending on the visibility state of the component associated with this action handler.

Overrides:
updateSingleAction in class IlvSingleActionHandler
Parameters:
action - The action to update the state of.
Returns:
true.

isVisible

protected boolean isVisible()
Determines whether the component associated with the action handler is visible. This method should be overridden if the action handler is associated with a new kind of component not processed by default.

Returns:
true if the component is visible; false otherwise.
See Also:
setVisible(boolean)

setVisible

protected void setVisible(boolean visible)
Shows or hides the component associated with this action handler depending on the value of the visible parameter.

Parameters:
visible - If true, the component will be shown; if false, the component will be hidden.
See Also:
isVisible()


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