Package com.luciad.lucy.gui.status
Class TLcyInterruptTaskAction
java.lang.Object
com.luciad.gui.ALcdAction
com.luciad.lucy.gui.status.TLcyInterruptTaskAction
- All Implemented Interfaces:
ILcdAction
,ILcyCustomizableRepresentationAction
,ILcdPropertyChangeSource
,ILcdStatusListener
,ActionListener
,Serializable
,EventListener
public class TLcyInterruptTaskAction
extends ALcdAction
implements ILcdStatusListener, ILcyCustomizableRepresentationAction
Action to interrupt the current task using Thread#interrupt
.
It is up to the user of this class to attach this ILcdStatusListener
to a source
of status events, so it can monitor the current tasks.
This action sets its ILcdAction.VISIBLE
property to false
when it is
not applicable. This means no task is ongoing, or the task is blocking. Blocking tasks block
user input (e.g. by using TLcyUserInteractionBlocker
), and
therefore the user cannot click the button anyway.
- See Also:
-
Field Summary
Fields inherited from class com.luciad.gui.ALcdAction
changeSupport
Fields inherited from interface com.luciad.gui.ILcdAction
DEFAULT, LONG_DESCRIPTION, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, VISIBLE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent event) customizeRepresentation
(Component aDefaultComponent, ILcdAction aWrapperAction, ILcyActionBar aActionBar) Allows to customize or replace the default component that is used to represent thisILcdAction
(typically aJButton
).void
statusChanged
(TLcdStatusEvent event) This method will be called when the status of anObject
to which this ILcdStatusListener has been registered has changed.Methods inherited from class com.luciad.gui.ALcdAction
addPropertyChangeListener, firePropertyChange, getDisplayName, getIcon, getLongDescription, getName, getShortDescription, getValue, isEnabled, isTraceOn, putValue, registerInstance, removePropertyChangeListener, setClassTraceOn, setDisplayName, setEnabled, setIcon, setLongDescription, setName, setShortDescription, setTraceOn
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.gui.ILcdAction
getValue, isEnabled, putValue, setEnabled
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
TLcyInterruptTaskAction
-
-
Method Details
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-
statusChanged
Description copied from interface:ILcdStatusListener
This method will be called when the status of anObject
to which this ILcdStatusListener has been registered has changed.- Specified by:
statusChanged
in interfaceILcdStatusListener
- Parameters:
event
- a TLcdStatusEvent detailing the status changes.
-
customizeRepresentation
public Component customizeRepresentation(Component aDefaultComponent, ILcdAction aWrapperAction, ILcyActionBar aActionBar) Description copied from interface:ILcyCustomizableRepresentationAction
Allows to customize or replace the default component that is used to represent this
ILcdAction
(typically aJButton
).- Specified by:
customizeRepresentation
in interfaceILcyCustomizableRepresentationAction
- Parameters:
aDefaultComponent
- The component that normally represents this action.aWrapperAction
- In case this action is wrapped (for example when using (TLcyActionBarUtil
), this parameter is the wrapper action, if not, it is this action. This is useful to retrieve properties such as the name or the icon of the action which can be different for different wrapper instances. E.g., a tool bar might use a different icon as a menu bar. And if the action is customized for the tool bar, it might be required to retrieve the tool bar icon.aActionBar
- The action bar in which this action is going to be inserted, provided as contextual information.- Returns:
- A customized or new component to represent this action. The simplest (but not useful)
implementation of this method would be
return aDefaultComponent;
. - See Also:
-