|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.jface.action.AbstractAction
org.eclipse.jface.action.Action
org.eclipse.ui.texteditor.TextNavigationAction
public class TextNavigationAction
An Action wrapper for text widget navigation and selection actions.
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.jface.action.IAction |
|---|
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 Summary | |
|---|---|
TextNavigationAction(StyledText textWidget,
int action)
Creates a new TextNavigationAction. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(IPropertyChangeListener listener)
Adds a property change listener to this action. |
protected void |
fireSelectionChanged()
Sends a selection event with the current selection to all selection listeners of the action's text widget |
protected void |
fireSelectionChanged(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. |
int |
getAccelerator()
Returns the accelerator keycode for this action. |
String |
getDescription()
Returns the action's description if it has one. |
ImageDescriptor |
getDisabledImageDescriptor()
Returns the disabled image for this action as an image descriptor. |
HelpListener |
getHelpListener()
Returns a help listener for this action. |
ImageDescriptor |
getHoverImageDescriptor()
Returns the hover image for this action as an image descriptor. |
ImageDescriptor |
getImageDescriptor()
Returns the image for this action as an image descriptor. |
IMenuCreator |
getMenuCreator()
Returns the menu creator for this action. |
int |
getStyle()
Return this action's style. |
String |
getText()
Returns the text for this action. |
protected StyledText |
getTextWidget()
Returns the text widget this actions is bound to. |
String |
getToolTipText()
Returns the tool tip text for this action. |
boolean |
isChecked()
Returns the checked status of this action. |
boolean |
isEnabled()
Returns whether this action is enabled. |
void |
removePropertyChangeListener(IPropertyChangeListener listener)
Removes the given listener from this action. |
void |
run()
The default implementation of this IAction method does
nothing. |
void |
runWithEvent(Event event)
The default implementation of this IAction method ignores
the event argument, and simply calls run(). |
void |
setAccelerator(int keycode)
Sets the accelerator keycode that this action maps to. |
void |
setChecked(boolean checked)
Sets the checked status of this action. |
void |
setDescription(String text)
Sets this action's description. |
void |
setDisabledImageDescriptor(ImageDescriptor newImage)
Sets the disabled image for this action, as an image descriptor. |
void |
setEnabled(boolean enabled)
Sets the enabled state of this action. |
void |
setHelpListener(HelpListener listener)
Sets a help listener for this action. |
void |
setHoverImageDescriptor(ImageDescriptor newImage)
Sets the hover image for this action, as an image descriptor. |
void |
setImageDescriptor(ImageDescriptor newImage)
Sets the image for this action, as an image descriptor. |
void |
setMenuCreator(IMenuCreator creator)
Sets the menu creator for this action. |
void |
setText(String text)
Sets the text for this action. |
void |
setToolTipText(String text)
Sets the tool tip text for this action. |
| Methods inherited from class org.eclipse.jface.action.Action |
|---|
convertAccelerator, convertAccelerator, findKeyCode, findKeyString, findModifier, findModifierString, getActionDefinitionId, getId, isHandled, notifyResult, removeAcceleratorText, removeMnemonics, setActionDefinitionId, setId |
| Methods inherited from class org.eclipse.jface.action.AbstractAction |
|---|
firePropertyChange, firePropertyChange |
| Methods inherited from class org.eclipse.core.commands.common.EventManager |
|---|
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextNavigationAction(StyledText textWidget,
int action)
TextNavigationAction.
textWidget - the text widgetaction - the styled text widget action| Method Detail |
|---|
protected StyledText getTextWidget()
public void run()
ActionIAction method does
nothing. Subclasses should override this method if they do not need
information from the triggering event, or override
runWithEvent(Event) if they do.
run in interface IActionrun in class Actionprotected void fireSelectionChanged()
protected void fireSelectionChanged(Point oldSelection)
oldSelection - the old selectionpublic void runWithEvent(Event event)
ActionIAction method ignores
the event argument, and simply calls run(). Subclasses
should override this method if they need information from the triggering
event, or override run() if not.
runWithEvent in interface IActionrunWithEvent in class Actionevent - the SWT event which triggered this action being runpublic void addPropertyChangeListener(IPropertyChangeListener listener)
IAction
addPropertyChangeListener in interface IActionaddPropertyChangeListener in class AbstractActionlistener - a property change listenerpublic int getAccelerator()
IActionMenuItem.getAccelerator.
getAccelerator in interface IActiongetAccelerator in class ActionMenuItem.getAccelerator()public String getDescription()
IActiongetToolTipText().
getDescription in interface IActiongetDescription in class Actionnullpublic ImageDescriptor getDisabledImageDescriptor()
IAction
This method is associated with the IMAGE property;
property change events are reported when its value changes.
getDisabledImageDescriptor in interface IActiongetDisabledImageDescriptor in class Actionnull if this action has no imageIAction.IMAGEpublic HelpListener getHelpListener()
IAction
getHelpListener in interface IActiongetHelpListener in class Actionpublic ImageDescriptor getHoverImageDescriptor()
IAction
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 IMAGE property;
property change events are reported when its value changes.
getHoverImageDescriptor in interface IActiongetHoverImageDescriptor in class Actionnull if this action has no imageIAction.IMAGEpublic ImageDescriptor getImageDescriptor()
IAction
This method is associated with the IMAGE property;
property change events are reported when its value changes.
getImageDescriptor in interface IActiongetImageDescriptor in class Actionnull if this action has no imageIAction.IMAGEpublic IMenuCreator getMenuCreator()
IAction
getMenuCreator in interface IActiongetMenuCreator in class Actionnull if nonepublic int getStyle()
IAction
getStyle in interface IActiongetStyle in class ActionAS_PUSH_BUTTON, AS_CHECK_BOX,
AS_RADIO_BUTTON and AS_DROP_DOWN_MENU.public String getText()
IAction
This method is associated with the TEXT property;
property change events are reported when its value changes.
getText in interface IActiongetText in class Actionnull if noneIAction.TEXTpublic String getToolTipText()
IAction
This method is associated with the TOOL_TIP_TEXT property;
property change events are reported when its value changes.
getToolTipText in interface IActiongetToolTipText in class Actionnull if noneIAction.TOOL_TIP_TEXTpublic boolean isChecked()
IActionAS_CHECK_BOX or AS_RADIO_BUTTON.
This method is associated with the CHECKED property;
property change events are reported when its value changes.
isChecked in interface IActionisChecked in class ActionIAction.CHECKEDpublic boolean isEnabled()
IAction
This method is associated with the ENABLED property;
property change events are reported when its value changes.
isEnabled in interface IActionisEnabled in class Actiontrue if enabled, and
false if disabledIAction.ENABLEDpublic void removePropertyChangeListener(IPropertyChangeListener listener)
IAction
removePropertyChangeListener in interface IActionremovePropertyChangeListener in class AbstractActionlistener - a property change listenerpublic void setAccelerator(int keycode)
IAction
Sets 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.
IWorkbenchCommandSupport and
IWorkbenchContextSupport provide 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.
setAccelerator in interface IActionsetAccelerator in class Actionkeycode - the keycode to be accepted.public void setChecked(boolean checked)
IActionAS_CHECK_BOX or AS_RADIO_BUTTON.
Fires a property change event for the CHECKED property
if the checked status actually changes as a consequence.
setChecked in interface IActionsetChecked in class Actionchecked - the new checked statusIAction.CHECKEDpublic void setDescription(String text)
IAction
Fires a property change event for the DESCRIPTION property
if the description actually changes as a consequence.
setDescription in interface IActionsetDescription in class Actiontext - the description, or null to clear the descriptionIAction.DESCRIPTIONpublic void setDisabledImageDescriptor(ImageDescriptor newImage)
IAction
Disabled images will be used on platforms that support changing the image
when the item is disabled.Fires a property change event for
the IMAGE property
if the image actually changes as a consequence.
setDisabledImageDescriptor in interface IActionsetDisabledImageDescriptor in class ActionnewImage - the image, or null if this
action should not have an imageIAction.IMAGEpublic void setEnabled(boolean enabled)
IAction
When an action is in the enabled state, the control associated with
it is active; triggering it will end up inkoking this action's
run method.
Fires a property change event for the ENABLED property
if the enabled state actually changes as a consequence.
setEnabled in interface IActionsetEnabled in class Actionenabled - true to enable, and
false to disableIAction.ENABLEDpublic void setHelpListener(HelpListener listener)
IAction
setHelpListener in interface IActionsetHelpListener in class Actionlistener - a help listener for this actionpublic void setHoverImageDescriptor(ImageDescriptor newImage)
IAction
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 IMAGE property
if the image actually changes as a consequence.
setHoverImageDescriptor in interface IActionsetHoverImageDescriptor in class ActionnewImage - the image, or null if this
action should not have an imageIAction.IMAGEpublic void setImageDescriptor(ImageDescriptor newImage)
IAction
Fires a property change event for the IMAGE property 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.
setImageDescriptor in interface IActionsetImageDescriptor in class ActionnewImage - the image, or null if this action should not have
an imageIAction.IMAGEpublic void setMenuCreator(IMenuCreator creator)
ActionNote that if this method is called, it overrides the check status.
setMenuCreator in interface IActionsetMenuCreator in class Actioncreator - the menu creator, or null if nonepublic void setText(String text)
Action
Fires a property change event for the TEXT property if the
text actually changes as a consequence.
The accelerator is identified by the last index of a tab character. If there are no tab characters, then it is identified by the last index of a '@' character. If neither, then there is no accelerator text. Note that if you want to insert a '@' character into the text (but no accelerator, you can simply insert a '@' or a tab at the end of the text.
setText in interface IActionsetText in class Actiontext - the text, or null if noneIAction.TEXT,
Action.findModifier(java.lang.String),
Action.findKeyCode(java.lang.String)public void setToolTipText(String text)
Action
Fires a property change event for the TOOL_TIP_TEXT
property if the tool tip text actually changes as a consequence.
setToolTipText in interface IActionsetToolTipText in class Actiontext - the tool tip text, or null if noneIAction.TOOL_TIP_TEXT
|
Eclipse Platform Release 3.7 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2011. All rights reserved.