home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / VCAFE.3.0A / Main.bin / VisualCafeClipboard.java < prev    next >
Text File  |  1998-10-25  |  4KB  |  88 lines

  1. /*
  2.  * Copyright 1998 Symantec Corporation, All Rights Reserved.
  3.  */
  4.  
  5. package com.symantec.itools.vcafe.openapi.datatransfer;
  6.  
  7. import com.symantec.itools.vcafe.openapi.*;
  8. import java.awt.datatransfer.*;
  9.  
  10. /**
  11.  * Implements the mechanism used to hold and transfer data via
  12.  * cut/copy/paste operations.
  13.  *
  14.  * <p>The implementation of this class forces the native clipboard to be up to date
  15.  * with the java clipboard, and is extended for support of <code>VisualObjects</code>.
  16.  * 
  17.  * <p>When placing a <code>Transferable</code> onto the clipboard, if it doesn't extend from
  18.  * <code>StringSelection</code> a new <code>TransferableProxy</code> object is created that wraps
  19.  * the <code>Transferable</code>.
  20.  * This ensures that the System Clipboard contents reflect the transferable data, 
  21.  * even if it doesn't actually understand the 'real' contents.
  22.  *
  23.  * <p>When <code>VisualObject[s]</code> are placed onto the clipboard, a <code>TransferableVisualObjects</code>
  24.  * is created that wraps the <code>VisualObject[s]</code>.
  25.  *
  26.  * @see TransferableVisualObjects
  27.  * @see TransferableProxy
  28.  * @see com.symantec.itools.vcafe.openapi.VisualCafe#getClipboard
  29.  *
  30.  * @author Symantec Internet Tools Division
  31.  * @version 1.0
  32.  * @since VCafe 3.0
  33.  */
  34.  
  35. public abstract class VisualCafeClipboard extends Clipboard
  36. {
  37.     /**
  38.      * Constructs the <code>VisualCafeClipboard</code>.
  39.      */
  40.     public VisualCafeClipboard() {
  41.         super("Visual Cafe");
  42.     }
  43.  
  44.     /**
  45.      * Determines if the contents of Visual Cafe's native clipboard can
  46.      * be pasted onto/into the given <code>VisualObject</code>.
  47.      * @param the given <code>VisualObject</code>.
  48.      * @return <code>false</code> if the clipboard doesn't contain <code>VisualObjects</code>, or the given
  49.      * <code>VisualObject</code> cannot accept the <code>VisualObjects</code> on the clipboard.
  50.      */
  51.     public abstract boolean canPasteInto(VisualObject visualObject);
  52.  
  53.     /**
  54.      * Determines if Visual Cafe's clipboard currently contains <code>VisualObjects</code>.
  55.      * @return <code>true</code> if the clipboard contains <code>VisualObjects</code>, <code>false</code> otherwise.
  56.      */
  57.     public abstract boolean containsVisualObjects();
  58.  
  59.     /**
  60.      * Copies the array of <code>VisualObjects</code> onto Visual Cafe's native clipboard.
  61.      * <p>This function is provided to simplify the common task of putting a set
  62.      * of <code>VisualObjects</code> onto the clipboard.
  63.      * @param visualObjects the array of <code>VisualObjects</code> to copy onto the native clipboard.
  64.      * @param textValue the value to provide for the <code>StringSelection</code> flavors of the
  65.      * <code>TransferableVisualObjects</code> that is created.
  66.      * @see TransferableVisualObjects
  67.      */
  68.     public abstract void setContents(VisualObject[] visualObjects, String textValue);
  69.  
  70.     /**
  71.      * Copies the <code>VisualObject</code> onto Visual Cafe's native clipboard.
  72.      * This function is provided to simplify the common task of putting a
  73.      * <code>VisualObject</code> onto the clipboard.
  74.      * @param visualObject the <code>VisualObject</code> to copy onto the native clipboard.
  75.      * @param textValue the value to provide for the <code>StringSelection</code> flavors of the
  76.      * <code>TransferableVisualObjects</code> that is created.
  77.      * @see TransferableVisualObjects
  78.      */
  79.     public abstract void setContents(VisualObject visualObject, String textValue);
  80.  
  81.     /**
  82.      * Gets the <code>VisualObjects</code> on Visual Cafe's native clipboard.
  83.      * If the clipboard doesn't contain <code>VisualObjects</code>, <code>null</code> is returned.
  84.      * @return the clipboard's <code>VisualObjects</code>, or <code>null</code> if none.
  85.      */
  86.     public abstract VisualObject[] getContents();
  87. }
  88.