edu.princeton.swing
Interface ClipboardTarget

All Known Implementing Classes:
PHighlightedTextArea, PHighlightedTextArea.InternalTextArea, PList, PTextArea, PTextField, PTree

public interface ClipboardTarget

ClipboardTarget is a simple interface that describes possible targets for the standard clipboard operations. This is primarily meant for custom text components. Note that all focusable implementations of ClipboardTarget should register its focus events with the ClipboardTargetManager. In addition, the ClipboardTarget should notify the ClipboardTargetManager of any changes in its canX() methods.

See Also:
ClipboardTargetManager

Method Summary
 boolean canCopy()
          Returns wheter or not the copy operation can be performed on this ClipboardTarget.
 boolean canCut()
          Returns wheter or not the cut operation can be performed on this ClipboardTarget.
 boolean canPaste()
          Returns wheter or not the paste operation can be performed on this ClipboardTarget.
 boolean canSelectAll()
          Returns wheter or not the selectAll operation can be performed on this ClipboardTarget.
 void copy()
          Copies the selection to the clipboard.
 void cut()
          Copies the selection to the clipboard and remove it from the object.
 void paste()
          Inserts the contents of the clipbaord into the object.
 void selectAll()
          Selects everything in the object.
 

Method Detail

canCut

public boolean canCut()
Returns wheter or not the cut operation can be performed on this ClipboardTarget.

Returns:
True iff a call to cut() should be permitted.

cut

public void cut()
Copies the selection to the clipboard and remove it from the object. The clipboard should not be modified if nothing is selected.


canCopy

public boolean canCopy()
Returns wheter or not the copy operation can be performed on this ClipboardTarget.

Returns:
True iff a call to copy() should be permitted.

copy

public void copy()
Copies the selection to the clipboard. The clipboard should not be modified if nothing is selected.


canPaste

public boolean canPaste()
Returns wheter or not the paste operation can be performed on this ClipboardTarget.

Returns:
True iff a call to paste() should be permitted.

paste

public void paste()
Inserts the contents of the clipbaord into the object. Optional: Before inserting the contents of the clipboard, remove the current selection from the object.


canSelectAll

public boolean canSelectAll()
Returns wheter or not the selectAll operation can be performed on this ClipboardTarget.

Returns:
True iff a call to selectAll() should be permitted.

selectAll

public void selectAll()
Selects everything in the object.