edu.princeton.swing
Interface ClipboardTarget

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

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

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

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

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

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


canPaste

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

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

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

void selectAll()
Selects everything in the object.