package edu.princeton.swing; /** * 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 edu.princeton.swing.ClipboardTargetManager * @author btsang * @version 7.1 */ public interface ClipboardTarget { /** * Returns wheter or not the cut operation can be performed on this ClipboardTarget. * * @return True iff a call to cut() should be permitted. */ public abstract boolean canCut(); /** * Copies the selection to the clipboard and remove it from the object. The clipboard should * not be modified if nothing is selected. */ public abstract void cut(); /** * Returns wheter or not the copy operation can be performed on this ClipboardTarget. * * @return True iff a call to copy() should be permitted. */ public abstract boolean canCopy(); /** * Copies the selection to the clipboard. The clipboard should not be modified if nothing is * selected. */ public abstract void copy(); /** * Returns wheter or not the paste operation can be performed on this ClipboardTarget. * * @return True iff a call to paste() should be permitted. */ public abstract boolean canPaste(); /** * Inserts the contents of the clipbaord into the object. Optional: Before inserting * the contents of the clipboard, remove the current selection from the object. */ public abstract void paste(); /** * Returns wheter or not the selectAll operation can be performed on this ClipboardTarget. * * @return True iff a call to selectAll() should be permitted. */ public abstract boolean canSelectAll(); /** * Selects everything in the object. */ public abstract void selectAll(); }