public class ClipboardAssistance
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap<java.lang.String,java.lang.Object> |
cacheData |
private Clipboard |
clipboard |
private int |
supportedActions |
Constructor and Description |
---|
ClipboardAssistance(java.lang.String cipboardName)
Creates clipboard with mentioned name
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(int action)
Called by system and notifies about successful data transfer.
|
void |
close()
Close the notification channel
|
void |
contentChanged()
Called by system and notifies that data set in shared buffer were changed
|
void |
emptyCache()
Cleans the local cache.
|
void |
flush()
Synchronize prepared dataset with local/global clipboard content.
|
java.lang.Object |
getData(java.lang.String mimeType)
Returns the data from clipboard by mime type key.
|
java.lang.String[] |
getMimeTypes() |
int |
getSupportedSourceActions()
Gets the actions that are supported by source.
|
boolean |
isCacheEmpty() |
void |
setData(java.lang.String mimeType,
java.lang.Object data)
Fills the cache by a new (mime type, data) pair.
|
void |
setSupportedActions(int supportedActions)
Sets the actions that are supported by source.
|
void |
setTargetAction(int actionDone)
Sets the action that clipboard target performed of DnD target can.
|
java.lang.String |
toString() |
private final java.util.HashMap<java.lang.String,java.lang.Object> cacheData
private final Clipboard clipboard
private int supportedActions
public ClipboardAssistance(java.lang.String cipboardName)
cipboardName
- the clipboard namepublic void close()
public void flush()
public void emptyCache()
public boolean isCacheEmpty()
public void setData(java.lang.String mimeType, java.lang.Object data)
mimeType
- data
- public java.lang.Object getData(java.lang.String mimeType)
mimeType
- public void setSupportedActions(int supportedActions)
supportedActions
- combination of Clipboard.ACTION_XXXX constantspublic int getSupportedSourceActions()
public void setTargetAction(int actionDone)
actionDone
- Clipboard.ACTION_COPY, or Clipboard.ACTION_MOVE, or Clipboard.ACTION_REFERENCEpublic void contentChanged()
public void actionPerformed(int action)
action
- Clipboard.ACTION_COPY, or Clipboard.ACTION_MOVE, or Clipboard.ACTION_REFERENCEpublic java.lang.String[] getMimeTypes()
public java.lang.String toString()
toString
in class java.lang.Object