Package org.eclipse.ui.actions
Class TextActionHandler
java.lang.Object
org.eclipse.ui.actions.TextActionHandler
Handles the redirection of the global Cut, Copy, Paste, and Select All
actions to either the current inline text control or the part's supplied
action handler.
This class may be instantiated; it is not intended to be subclassed.
Example usage:
textActionHandler = new TextActionHandler(this.getViewSite().getActionBars()); textActionHandler.addText((Text) textCellEditor1.getControl()); textActionHandler.addText((Text) textCellEditor2.getControl()); textActionHandler.setSelectAllAction(selectAllAction);
- Restriction:
- This class is not intended to be subclassed by clients.
-
Constructor Summary
ConstructorDescriptionTextActionHandler
(IActionBars actionBar) Creates aText
control action handler for the global Cut, Copy, Paste, Delete, and Select All of the action bar.TextActionHandler
(IActionBars actionBar, boolean autoMode) Creates aText
control action handler for the global Cut, Copy, Paste, Delete, and Select All of the action bar. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add aText
control to the handler so that the Cut, Copy, Paste, Delete, and Select All actions are redirected to it when active.void
dispose()
Dispose of this action handlervoid
removeText
(Text textControl) Removes aText
control from the handler so that the Cut, Copy, Paste, Delete, and Select All actions are no longer redirected to it when active.void
setCopyAction
(IAction action) Set the defaultIAction
handler for the Copy action.void
setCutAction
(IAction action) Set the defaultIAction
handler for the Cut action.void
setDeleteAction
(IAction action) Set the defaultIAction
handler for the Delete action.void
setPasteAction
(IAction action) Set the defaultIAction
handler for the Paste action.void
setSelectAllAction
(IAction action) Set the defaultIAction
handler for the Select All action.void
Updates the actions bars.
-
Constructor Details
-
TextActionHandler
Creates aText
control action handler for the global Cut, Copy, Paste, Delete, and Select All of the action bar.- Parameters:
actionBar
- the action bar to register global action handlers for Cut, Copy, Paste, Delete, and Select All
-
TextActionHandler
Creates aText
control action handler for the global Cut, Copy, Paste, Delete, and Select All of the action bar.- Parameters:
actionBar
- the action bar to register global action handlers for Cut, Copy, Paste, Delete, and Select AllautoMode
- Iftrue
the actions (copy, past, ...) to use while no text widget is active are automatically populated from the actionBars global action handles which are active at the time an inline text control is activated.The setXxxAction methods have no use if autoMode is
true
.- Since:
- 3.18
-
-
Method Details
-
updateActionBars
public void updateActionBars()Updates the actions bars.- Since:
- 3.6
-
addText
Add aText
control to the handler so that the Cut, Copy, Paste, Delete, and Select All actions are redirected to it when active.- Parameters:
textControl
- the inlineText
control
-
dispose
public void dispose()Dispose of this action handler -
removeText
Removes aText
control from the handler so that the Cut, Copy, Paste, Delete, and Select All actions are no longer redirected to it when active.- Parameters:
textControl
- the inlineText
control
-
setCopyAction
Set the defaultIAction
handler for the Copy action. ThisIAction
is run only if no active inline text control.- Parameters:
action
- theIAction
to run for the Copy action, ornull
if not interested.
-
setCutAction
Set the defaultIAction
handler for the Cut action. ThisIAction
is run only if no active inline text control.- Parameters:
action
- theIAction
to run for the Cut action, ornull
if not interested.
-
setPasteAction
Set the defaultIAction
handler for the Paste action. ThisIAction
is run only if no active inline text control.- Parameters:
action
- theIAction
to run for the Paste action, ornull
if not interested.
-
setSelectAllAction
Set the defaultIAction
handler for the Select All action. ThisIAction
is run only if no active inline text control.- Parameters:
action
- theIAction
to run for the Select All action, ornull
if not interested.
-
setDeleteAction
Set the defaultIAction
handler for the Delete action. ThisIAction
is run only if no active inline text control.- Parameters:
action
- theIAction
to run for the Delete action, ornull
if not interested.
-