edu.northwestern.at.utils.swing
Class CutCopyPasteAdapter

java.lang.Object
  extended by edu.northwestern.at.utils.swing.CutCopyPasteAdapter

public class CutCopyPasteAdapter
extends java.lang.Object

CutCopyPasteAdapter adds CutCopyPaste interface methods to a text component.


Field Summary
protected  javax.swing.text.JTextComponent textComponent
          The text component to make CutCopyPaste compatible.
 
Constructor Summary
CutCopyPasteAdapter(javax.swing.text.JTextComponent textComponent)
          Add CutCopyPaste to a JTextComponent.
 
Method Summary
 void clearSelection()
          Clear selection.
 boolean clipboardHasPasteableData()
          Check if clipboard has pasteable data.
 void copy()
          Copy to clipboard.
 void cut()
          Cut to clipboard.
 boolean isCopyEnabled()
          Is copy enabled?
 boolean isCutEnabled()
          Is cut enabled?
 boolean isPasteEnabled()
          Is paste enabled?
 boolean isTextSelected()
          Is anything selected which can be cut/copied?
 void paste()
          Paste from clipboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textComponent

protected javax.swing.text.JTextComponent textComponent
The text component to make CutCopyPaste compatible.

Constructor Detail

CutCopyPasteAdapter

public CutCopyPasteAdapter(javax.swing.text.JTextComponent textComponent)
Add CutCopyPaste to a JTextComponent.

Parameters:
textComponent - A JTextComponent to which to attach CutCopyPaste interface methods.
Method Detail

clipboardHasPasteableData

public boolean clipboardHasPasteableData()
Check if clipboard has pasteable data.

Returns:
true if clipboard has pasteable text recognized by XTextArea.

clearSelection

public void clearSelection()
Clear selection.


cut

public void cut()
Cut to clipboard.


copy

public void copy()
Copy to clipboard.


paste

public void paste()
Paste from clipboard.


isCutEnabled

public boolean isCutEnabled()
Is cut enabled?


isCopyEnabled

public boolean isCopyEnabled()
Is copy enabled?


isPasteEnabled

public boolean isPasteEnabled()
Is paste enabled?


isTextSelected

public boolean isTextSelected()
Is anything selected which can be cut/copied?