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
ConstructorsConstructorDescriptionTextActionHandler(IActionBars actionBar) Creates aTextcontrol action handler for the global Cut, Copy, Paste, Delete, and Select All of the action bar.TextActionHandler(IActionBars actionBar, boolean autoMode) Creates aTextcontrol action handler for the global Cut, Copy, Paste, Delete, and Select All of the action bar. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd aTextcontrol to the handler so that the Cut, Copy, Paste, Delete, and Select All actions are redirected to it when active.voiddispose()Dispose of this action handlervoidremoveText(Text textControl) Removes aTextcontrol from the handler so that the Cut, Copy, Paste, Delete, and Select All actions are no longer redirected to it when active.voidsetCopyAction(IAction action) Set the defaultIActionhandler for the Copy action.voidsetCutAction(IAction action) Set the defaultIActionhandler for the Cut action.voidsetDeleteAction(IAction action) Set the defaultIActionhandler for the Delete action.voidsetPasteAction(IAction action) Set the defaultIActionhandler for the Paste action.voidsetSelectAllAction(IAction action) Set the defaultIActionhandler for the Select All action.voidUpdates the actions bars.
-
Constructor Details
-
TextActionHandler
Creates aTextcontrol 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 aTextcontrol 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- Iftruethe 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 aTextcontrol to the handler so that the Cut, Copy, Paste, Delete, and Select All actions are redirected to it when active.- Parameters:
textControl- the inlineTextcontrol
-
dispose
public void dispose()Dispose of this action handler -
removeText
Removes aTextcontrol 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 inlineTextcontrol
-
setCopyAction
Set the defaultIActionhandler for the Copy action. ThisIActionis run only if no active inline text control.- Parameters:
action- theIActionto run for the Copy action, ornullif not interested.
-
setCutAction
Set the defaultIActionhandler for the Cut action. ThisIActionis run only if no active inline text control.- Parameters:
action- theIActionto run for the Cut action, ornullif not interested.
-
setPasteAction
Set the defaultIActionhandler for the Paste action. ThisIActionis run only if no active inline text control.- Parameters:
action- theIActionto run for the Paste action, ornullif not interested.
-
setSelectAllAction
Set the defaultIActionhandler for the Select All action. ThisIActionis run only if no active inline text control.- Parameters:
action- theIActionto run for the Select All action, ornullif not interested.
-
setDeleteAction
Set the defaultIActionhandler for the Delete action. ThisIActionis run only if no active inline text control.- Parameters:
action- theIActionto run for the Delete action, ornullif not interested.
-