public class XCVManager extends Object
JTextComponent
available for a menu.
The XCVManager will generate Cut/Copy/Paste actions which delegate to the corresponding actions of a JTextComponent. The state of the generated actions will be updated according to the state of the text component and the clipboard.
An XCVManager can manage more than one text component. In this case, the last component which got the input focus is the active component, and actions will be delegated to it.
Constructor and Description |
---|
XCVManager() |
Modifier and Type | Method and Description |
---|---|
void |
addManagedComponent(JComboBox source) |
void |
addManagedComponent(JTextComponent source)
Adds a text field managed by this XCVManager.
|
Action |
getCopyAction() |
Action |
getCutAction() |
MenuListener |
getEditMenuListener()
Returns a menu listener which will update the action state if the menu is selected.
|
Action |
getPasteAction() |
void |
removeManagedComponent(JComboBox source) |
void |
removeManagedComponent(JTextComponent source)
Removes a component from the list of managed components.
|
protected void |
setActiveSource(JTextComponent source)
Sets the currently active text field and updates the delegatee actions accordingly.
|
void |
updateActions(JTextComponent source)
Initializes the delegatee cut/copy/paste actions by looking them up from
DefaultEditorKit . |
void |
updateActionState() |
public Action getCutAction()
public Action getCopyAction()
public Action getPasteAction()
public MenuListener getEditMenuListener()
public void addManagedComponent(JComboBox source)
public void addManagedComponent(JTextComponent source)
public void removeManagedComponent(JComboBox source)
public void removeManagedComponent(JTextComponent source)
public void updateActions(JTextComponent source)
DefaultEditorKit
. This should be called if the editor kit of
the JTextComponent
has been changed.DefaultEditorKit
protected void setActiveSource(JTextComponent source)
source
- The new active source; or null
if there is no active source.public void updateActionState()
Copyright © 2001-2013 the JGloss developers. All Rights Reserved.