Class TextNavigationAction
- All Implemented Interfaces:
- IAction
- Direct Known Subclasses:
- AbstractTextEditor.LineEndAction,- AbstractTextEditor.LineStartAction
Action wrapper for text widget navigation and selection actions.- Since:
- 2.0
- 
Field SummaryFields inherited from interface org.eclipse.jface.action.IActionAS_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 SummaryConstructorsConstructorDescriptionTextNavigationAction(StyledText textWidget, int action) Creates a newTextNavigationAction.
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds a property change listener to this action.protected voidSends a selection event with the current selection to all selection listeners of the action's text widgetprotected voidfireSelectionChanged(Point oldSelection) Fires a selection event to all selection listener of the action's text widget if the current selection differs from the given selection.intReturns the accelerator keycode for this action.Returns the action's description if it has one.Returns the disabled image for this action as an image descriptor.Returns a help listener for this action.Returns the hover image for this action as an image descriptor.Returns the image for this action as an image descriptor.Returns the menu creator for this action.intgetStyle()Return this action's style.getText()Returns the text for this action.protected StyledTextReturns the text widget this actions is bound to.Returns the tool tip text for this action.booleanReturns the checked status of this action.booleanReturns whether this action is enabled.voidRemoves the given listener from this action.voidrun()The default implementation of thisIActionmethod does nothing.voidrunWithEvent(Event event) The default implementation of thisIActionmethod ignores the event argument, and simply callsrun().voidsetAccelerator(int keycode) Sets the accelerator keycode that this action maps to.voidsetChecked(boolean checked) Sets the checked status of this action.voidsetDescription(String text) Sets this action's description.voidsetDisabledImageDescriptor(ImageDescriptor newImage) Sets the disabled image for this action, as an image descriptor.voidsetEnabled(boolean enabled) Sets the enabled state of this action.voidsetHelpListener(HelpListener listener) Sets a help listener for this action.voidsetHoverImageDescriptor(ImageDescriptor newImage) Sets the hover image for this action, as an image descriptor.voidsetImageDescriptor(ImageDescriptor newImage) Sets the image for this action, as an image descriptor.voidsetMenuCreator(IMenuCreator creator) Sets the menu creator for this action.voidSets the text for this action.voidsetToolTipText(String text) Sets the tool tip text for this action.Methods inherited from class org.eclipse.jface.action.ActionconvertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getActionDefinitionId, getId, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, setActionDefinitionId, setIdMethods inherited from class org.eclipse.jface.action.AbstractActionfirePropertyChange, firePropertyChangeMethods inherited from class org.eclipse.core.commands.common.EventManageraddListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
- 
Constructor Details- 
TextNavigationActionCreates a newTextNavigationAction.- Parameters:
- textWidget- the text widget
- action- the styled text widget action
 
 
- 
- 
Method Details- 
getTextWidgetReturns the text widget this actions is bound to.- Returns:
- returns the text widget this actions is bound to
 
- 
runpublic void run()Description copied from class:ActionThe default implementation of thisIActionmethod does nothing. Subclasses should override this method if they do not need information from the triggering event, or overriderunWithEvent(Event)if they do.
- 
fireSelectionChangedprotected void fireSelectionChanged()Sends a selection event with the current selection to all selection listeners of the action's text widget- Since:
- 3.0
 
- 
fireSelectionChangedFires a selection event to all selection listener of the action's text widget if the current selection differs from the given selection.- Parameters:
- oldSelection- the old selection
- Since:
- 3.0
 
- 
runWithEventDescription copied from class:ActionThe default implementation of thisIActionmethod ignores the event argument, and simply callsrun(). Subclasses should override this method if they need information from the triggering event, or overriderun()if not.- Specified by:
- runWithEventin interface- IAction
- Overrides:
- runWithEventin class- Action
- Parameters:
- event- the SWT event which triggered this action being run
- See Also:
 
- 
addPropertyChangeListenerDescription copied from interface:IActionAdds a property change listener to this action. Has no effect if an identical listener is already registered.- Specified by:
- addPropertyChangeListenerin interface- IAction
- Overrides:
- addPropertyChangeListenerin class- AbstractAction
- Parameters:
- listener- a property change listener
 
- 
getAcceleratorpublic int getAccelerator()Description copied from interface:IActionReturns the accelerator keycode for this action. The result is the bit-wise OR of zero or more modifier masks and a key, as explained inMenuItem.getAccelerator.- Specified by:
- getAcceleratorin interface- IAction
- Overrides:
- getAcceleratorin class- Action
- Returns:
- the accelerator keycode
- See Also:
 
- 
getDescriptionDescription copied from interface:IActionReturns the action's description if it has one. Otherwise it returnsgetToolTipText().- Specified by:
- getDescriptionin interface- IAction
- Overrides:
- getDescriptionin class- Action
- Returns:
- a description for the action; may be null
 
- 
getDisabledImageDescriptorDescription copied from interface:IActionReturns the disabled image for this action as an image descriptor.This method is associated with the IMAGEproperty; property change events are reported when its value changes.- Specified by:
- getDisabledImageDescriptorin interface- IAction
- Overrides:
- getDisabledImageDescriptorin class- Action
- Returns:
- the image, or nullif this action has no image
- See Also:
 
- 
getHelpListenerDescription copied from interface:IActionReturns a help listener for this action.- Specified by:
- getHelpListenerin interface- IAction
- Overrides:
- getHelpListenerin class- Action
- Returns:
- a help listener for this action
 
- 
getHoverImageDescriptorDescription copied from interface:IActionReturns the hover image for this action as an image descriptor.Hover images will be used on platforms that support changing the image when the user hovers over the item. This method is associated with the IMAGEproperty; property change events are reported when its value changes.- Specified by:
- getHoverImageDescriptorin interface- IAction
- Overrides:
- getHoverImageDescriptorin class- Action
- Returns:
- the image, or nullif this action has no image
- See Also:
 
- 
getImageDescriptorDescription copied from interface:IActionReturns the image for this action as an image descriptor.This method is associated with the IMAGEproperty; property change events are reported when its value changes.- Specified by:
- getImageDescriptorin interface- IAction
- Overrides:
- getImageDescriptorin class- Action
- Returns:
- the image, or nullif this action has no image
- See Also:
 
- 
getMenuCreatorDescription copied from interface:IActionReturns the menu creator for this action.- Specified by:
- getMenuCreatorin interface- IAction
- Overrides:
- getMenuCreatorin class- Action
- Returns:
- the menu creator, or nullif none
 
- 
getStylepublic int getStyle()Description copied from interface:IActionReturn this action's style.
- 
getTextDescription copied from interface:IActionReturns the text for this action.This method is associated with the TEXTproperty; property change events are reported when its value changes.
- 
getToolTipTextDescription copied from interface:IActionReturns the tool tip text for this action.This method is associated with the TOOL_TIP_TEXTproperty; property change events are reported when its value changes.- Specified by:
- getToolTipTextin interface- IAction
- Overrides:
- getToolTipTextin class- Action
- Returns:
- the tool tip text, or nullif none
- See Also:
 
- 
isCheckedpublic boolean isChecked()Description copied from interface:IActionReturns the checked status of this action. Applicable only if the style isAS_CHECK_BOXorAS_RADIO_BUTTON.This method is associated with the CHECKEDproperty; property change events are reported when its value changes.
- 
isEnabledpublic boolean isEnabled()Description copied from interface:IActionReturns whether this action is enabled.This method is associated with the ENABLEDproperty; property change events are reported when its value changes.
- 
removePropertyChangeListenerDescription copied from interface:IActionRemoves the given listener from this action. Has no effect if an identical listener is not registered.- Specified by:
- removePropertyChangeListenerin interface- IAction
- Overrides:
- removePropertyChangeListenerin class- AbstractAction
- Parameters:
- listener- a property change listener
 
- 
setAcceleratorpublic void setAccelerator(int keycode) Description copied from interface:IActionSets the accelerator keycode that this action maps to. This is a bitwise OR of zero or more SWT key modifier masks (i.e. SWT.CTRL or SWT.ALT) and a character code. For example, for Ctrl+Z, use SWT.CTRL | 'Z'. Use 0 for no accelerator.This method should no longer be used for actions in the Eclipse workbench. IWorkbenchCommandSupportandIWorkbenchContextSupportprovide all the functionality required for key bindings. If you set an accelerator using this method, then it will not work in the workbench if it conflicts any existing key binding, or if there is a different key binding defined for this action's definition id. The definition id should be used instead -- referring to the command in the workbench from which the key binding should be retrieved.- Specified by:
- setAcceleratorin interface- IAction
- Overrides:
- setAcceleratorin class- Action
- Parameters:
- keycode- the keycode to be accepted.
 
- 
setCheckedpublic void setChecked(boolean checked) Description copied from interface:IActionSets the checked status of this action. Applicable for the stylesAS_CHECK_BOXorAS_RADIO_BUTTON.Fires a property change event for the CHECKEDproperty if the checked status actually changes as a consequence.- Specified by:
- setCheckedin interface- IAction
- Overrides:
- setCheckedin class- Action
- Parameters:
- checked- the new checked status
- See Also:
 
- 
setDescriptionDescription copied from interface:IActionSets this action's description. Typically the description is shown as a (longer) help text in the status line.Fires a property change event for the DESCRIPTIONproperty if the description actually changes as a consequence.- Specified by:
- setDescriptionin interface- IAction
- Overrides:
- setDescriptionin class- Action
- Parameters:
- text- the description, or- nullto clear the description
- See Also:
 
- 
setDisabledImageDescriptorDescription copied from interface:IActionSets the disabled image for this action, as an image descriptor.Disabled images will be used on platforms that support changing the image when the item is disabled.Fires a property change event for the IMAGEproperty if the image actually changes as a consequence.- Specified by:
- setDisabledImageDescriptorin interface- IAction
- Overrides:
- setDisabledImageDescriptorin class- Action
- Parameters:
- newImage- the image, or- nullif this action should not have an image
- See Also:
 
- 
setEnabledpublic void setEnabled(boolean enabled) Description copied from interface:IActionSets the enabled state of this action.When an action is in the enabled state, the control associated with it is active; triggering it will end up inkoking this action's runmethod.Fires a property change event for the ENABLEDproperty if the enabled state actually changes as a consequence.- Specified by:
- setEnabledin interface- IAction
- Overrides:
- setEnabledin class- Action
- Parameters:
- enabled-- trueto enable, and- falseto disable
- See Also:
 
- 
setHelpListenerDescription copied from interface:IActionSets a help listener for this action.- Specified by:
- setHelpListenerin interface- IAction
- Overrides:
- setHelpListenerin class- Action
- Parameters:
- listener- a help listener for this action
 
- 
setHoverImageDescriptorDescription copied from interface:IActionSets the hover image for this action, as an image descriptor.Hover images will be used on platforms that support changing the image when the user hovers over the item.Fires a property change event for the IMAGEproperty if the image actually changes as a consequence.- Specified by:
- setHoverImageDescriptorin interface- IAction
- Overrides:
- setHoverImageDescriptorin class- Action
- Parameters:
- newImage- the image, or- nullif this action should not have an image
- See Also:
 
- 
setImageDescriptorDescription copied from interface:IActionSets the image for this action, as an image descriptor.Fires a property change event for the IMAGEproperty if the image actually changes as a consequence.Note: This operation is a hint and is not supported in all contexts on platforms that do not have this concept (for example, Windows NT). Furthermore, some platforms (such as GTK), cannot display both a check box and an image at the same time. Instead, they hide the image and display the check box. - Specified by:
- setImageDescriptorin interface- IAction
- Overrides:
- setImageDescriptorin class- Action
- Parameters:
- newImage- the image, or- nullif this action should not have an image
- See Also:
 
- 
setMenuCreatorDescription copied from class:ActionSets the menu creator for this action.Note that if this method is called, it overrides the check status. - Specified by:
- setMenuCreatorin interface- IAction
- Overrides:
- setMenuCreatorin class- Action
- Parameters:
- creator- the menu creator, or- nullif none
 
- 
setTextDescription copied from interface:IActionSets the text for this action.An accelerator is identified by the last index of a '\t' character. If there are no '\t' characters, then it is identified by the last index of an '@' character. If neither, then there is no accelerator text. Note that if you want to insert an '@' character into the text (but no accelerator), then you can simply insert an '@' or a '\t' at the end of the text. 
 An accelerator specification consists of zero or more modifier tokens followed by a key code token. The tokens are separated by a '+' character.Fires a property change event for the TEXTproperty if the text actually changes as a consequence.
- 
setToolTipTextDescription copied from class:ActionSets the tool tip text for this action.Fires a property change event for the TOOL_TIP_TEXTproperty if the tool tip text actually changes as a consequence.- Specified by:
- setToolTipTextin interface- IAction
- Overrides:
- setToolTipTextin class- Action
- Parameters:
- text- the tool tip text, or- nullif none
- See Also:
 
 
-