public abstract class AbstractAnnotationAction extends Action
com.ibm.rational.test.lt.recorder.ui.annotationContribution
. Implementations
must implement Action.run()
, and may override AbstractAnnotationAction.canEmitAnnotation()
.AS_CHECK_BOX, AS_DROP_DOWN_MENU, AS_PUSH_BUTTON, AS_RADIO_BUTTON, AS_UNSPECIFIED, CHECKED, DESCRIPTION, ENABLED, HANDLED, IMAGE, RESULT, TEXT, TOOL_TIP_TEXT
Constructor and Description |
---|
AbstractAnnotationAction(String text,
ImageDescriptor image)
Instantiates a new annotation action.
|
AbstractAnnotationAction(String text,
int hotkeyModifier,
int hotkeyValue)
Instantiates a new annotation action.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canEmitAnnotation()
Determines whether an annotation can be emitted at this time.
|
void |
dispose()
Disposes any control/resource allocated by this action.
|
IRecorder |
getAnnotationRecorder()
Returns the annotation recorder where any annotation emitted by this action should
be sent.
|
protected IAnnotationStateHandler |
getAnnotationStateHandler(String annotationType)
Returns the state handler for the specified annotation type.
|
Shell |
getShell()
Returns the shell that should be used as parent shell to any new window created by
the action.
|
protected void |
recorderChanged()
Allows the action to initialize its state once it is connected to the annotation
recorder.
|
void |
registerHotkey()
Register the associated system-level hotkey if non-zero
|
void |
setAnnotationRecorder(IRecorder recorder)
Sets the annotation recorder where any annotation emitted by this action should
be sent.
|
void |
setShell(Shell shell)
Sets the shell that should be used as parent shell to any new window created by
the action.
|
void |
unregisterHotkey()
Unregister the associated system-level hotkey if non-zero
|
void |
update()
Updates the enablement of this action.
|
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getAccelerator, getActionDefinitionId, getDescription, getDisabledImageDescriptor, getHelpListener, getHoverImageDescriptor, getId, getImageDescriptor, getMenuCreator, getStyle, getText, getToolTipText, isChecked, isEnabled, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, run, runWithEvent, setAccelerator, setActionDefinitionId, setChecked, setDescription, setDisabledImageDescriptor, setEnabled, setHelpListener, setHoverImageDescriptor, setId, setImageDescriptor, setMenuCreator, setText, setToolTipText
addPropertyChangeListener, firePropertyChange, firePropertyChange, removePropertyChangeListener
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
public AbstractAnnotationAction(String text, int hotkeyModifier, int hotkeyValue)
text
- The action label.hotkeyModifier
- The bitwise combination of modifiershotkeyValue
- The hotkey value. 0 means none.public AbstractAnnotationAction(String text, ImageDescriptor image)
text
- The action label.image
- The action icon.public Shell getShell()
AbstractAnnotationAction.setShell(Shell)
.public void setShell(Shell shell)
AbstractAnnotationAction.getShell()
.public IRecorder getAnnotationRecorder()
AbstractAnnotationAction.setAnnotationRecorder(IRecorder)
.public final void setAnnotationRecorder(IRecorder recorder)
AbstractAnnotationAction.getAnnotationRecorder()
. Sub-classes must invoke the super implementation
of this method if it overridden.recorder
- protected void recorderChanged()
protected boolean canEmitAnnotation()
true
provided that the annotation recorder is active. Sub-classes must
invoke the super implementation of this method if it overridden.public void update()
AbstractAnnotationAction.canEmitAnnotation()
and updates enablement accordingly.protected final IAnnotationStateHandler getAnnotationStateHandler(String annotationType) throws UnsupportedPropertyException
annotationType
- An annotation typenull
if the annotation type has no state handler.UnsupportedPropertyException
- If the annotation type does not exist.public void dispose()
public void registerHotkey()
public void unregisterHotkey()
© Copyright IBM Corp. 2013. All rights reserved.