Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.flexstor.common.awt
Class TextClipboard  view TextClipboard download TextClipboard.java

java.lang.Object
  extended bycom.flexstor.common.awt.TextClipboard
All Implemented Interfaces:
java.awt.datatransfer.ClipboardOwner

public class TextClipboard
extends java.lang.Object
implements java.awt.datatransfer.ClipboardOwner

A basic clipboard implementation that 1. supports text only. 2. can use a local clipboard or the system clipboard.

Version:
2.0

Field Summary
private  boolean bIsOwner
           
static char cDELIMIT
           
private  java.awt.datatransfer.Clipboard clipboard
           
static java.lang.String DELIMIT
           
 
Constructor Summary
TextClipboard(java.lang.String sName)
          Creates a basic clipboard that supports text only.
 
Method Summary
 void copy(java.lang.String sData)
          Copies sData to the clipboard.
 boolean hasOwnership()
          Returns true if this instance has ownership of the clipboard.
 void lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)
          Required by the ClipboardOwner interface.
 java.lang.String paste()
          Copies data from the clipboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bIsOwner

private boolean bIsOwner

clipboard

private java.awt.datatransfer.Clipboard clipboard

DELIMIT

public static final java.lang.String DELIMIT
See Also:
Constant Field Values

cDELIMIT

public static final char cDELIMIT
See Also:
Constant Field Values
Constructor Detail

TextClipboard

public TextClipboard(java.lang.String sName)
Creates a basic clipboard that supports text only. If trying to access the system clipboard and it is inaccessable, due to an SecurityException, then a local clipboard will be used instead.

Method Detail

lostOwnership

public void lostOwnership(java.awt.datatransfer.Clipboard clipboard,
                          java.awt.datatransfer.Transferable contents)
Required by the ClipboardOwner interface. Called when another application/process gains ownership of the clipboard.

Specified by:
lostOwnership in interface java.awt.datatransfer.ClipboardOwner

hasOwnership

public boolean hasOwnership()
Returns true if this instance has ownership of the clipboard.


copy

public void copy(java.lang.String sData)
Copies sData to the clipboard.


paste

public java.lang.String paste()
Copies data from the clipboard.