public class IlvComponentVisibilityActionHandler extends IlvCheckableActionHandler
By default, the action handler manages the visibility of two kinds of object:
Component.isVisible()
method.IlvViewContainer.isContainerVisible()
method.
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:
IlvComponentVisibilityActionHandler(String)
.isVisible()
and setVisible(boolean)
.Modifier | Constructor and Description |
---|---|
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. |
Modifier and Type | Method and Description |
---|---|
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. |
checkStateChanged, getGroup, isChecked, isLocked, isOneShot, lockStateChanged, setAction, setChecked, setLocked, setOneShot
getAction, getCommand, isProcessingAction, setCommand, updateAction
protected IlvComponentVisibilityActionHandler(String command)
IlvComponentVisibilityActionHandler
that
processes the action with the specified command
key.
This constructor should be used by classes that inherit from this class.command
- The command key of the action this handler processes.public IlvComponentVisibilityActionHandler(String command, Component component)
IlvComponentVisibilityActionHandler
that
processes the action with the specified command
key.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.public IlvComponentVisibilityActionHandler(String command, IlvViewContainer viewContainer)
IlvComponentVisibilityActionHandler
that
processes the action with the specified command
key.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.public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
actionPerformed
in class IlvSingleActionHandler
e
- The action event.protected boolean updateSingleAction(Action action)
IlvSingleActionHandler.updateAction(javax.swing.Action)
method.
Checks the action depending on the visibility state of the component
associated with this action handler.updateSingleAction
in class IlvSingleActionHandler
action
- The action to update the state of.true
.protected boolean isVisible()
true
if the component is visible;
false
otherwise.setVisible(boolean)
protected void setVisible(boolean visible)
visible
parameter.visible
- If true
, the component will be shown;
if false
, the component will be hidden.isVisible()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.