|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.common.ui.action.actions.global.ClipboardManager
public final class ClipboardManager
This class is used to add/retrieve data to/from the system clipboard. This class should be used within the global action infrastructure framework.
Field Summary | |
---|---|
static java.lang.String |
COMMON_FORMAT
String constant for the common format (paste on ME or a daigram (usually as a result of Harvesting) |
Method Summary | |
---|---|
void |
addToCache(java.lang.Object data,
Transfer dataType)
Adds data to the internal cache. |
void |
addToCache(java.lang.Object data,
Transfer dataType,
ClipboardState state)
Adds data to the internal cache. |
protected void |
clearCache()
Clear the cache |
boolean |
doesCacheHaveType(Transfer dataType)
Checks if the cache has the specified transfer agent |
boolean |
doesClipboardHaveData(java.lang.String format,
ClipboardContentsHelper contentsHelper)
Checks if the system clipboard has any ICustomData with the specified format |
boolean |
doesClipboardHaveData(Transfer dataType,
ClipboardContentsHelper contentsHelper)
Checks if the system clipboard has any data with the specified transfer agent |
void |
flushCacheToClipboard()
Flushes the chache to the system clipboard and clears the cache NOTE: visibility changed from (protected) to (public) to support Harvesting feature |
java.lang.String[] |
getAvailableTypeNames()
Returns a platform specific list of the data types currently available on the system clipboard. |
java.lang.Object |
getClipboardContents(Transfer dataType,
ClipboardContentsHelper helper)
Returns the system clipboard contents |
ICustomData[] |
getClipboardData(java.lang.String format,
ClipboardContentsHelper contentsHelper)
Gets the ICustomData associated with the specified format from the system clipboard. |
ClipboardState |
getClipboardState()
|
static ClipboardManager |
getInstance()
Return the singleton. |
void |
removeFromCache(Transfer dataType)
Removes the transfer agent from the cache |
void |
setClipboardState(ClipboardState clipboardState)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COMMON_FORMAT
Method Detail |
---|
public static ClipboardManager getInstance()
ClipboardManager
public java.lang.Object getClipboardContents(Transfer dataType, ClipboardContentsHelper helper)
dataType
- The transfer agent
public void addToCache(java.lang.Object data, Transfer dataType)
data
- The data for the transfer agentdataType
- The transfer agentpublic void addToCache(java.lang.Object data, Transfer dataType, ClipboardState state)
data
- The data for the transfer agentdataType
- The transfer agentstate
- The clipboard statepublic void flushCacheToClipboard()
protected void clearCache()
public java.lang.String[] getAvailableTypeNames()
Note: getAvailableTypeNames
is a utility for writing a
Transfer sub-class. It should NOT be used within an application because
it provides platform specific information.
public void removeFromCache(Transfer dataType)
dataType
- The transfer agentpublic boolean doesCacheHaveType(Transfer dataType)
dataType
- The transfer agent
public boolean doesClipboardHaveData(java.lang.String format, ClipboardContentsHelper contentsHelper)
format
- The format
public boolean doesClipboardHaveData(Transfer dataType, ClipboardContentsHelper contentsHelper)
dataType
- The transfer agent
public ICustomData[] getClipboardData(java.lang.String format, ClipboardContentsHelper contentsHelper)
format
- The format
public ClipboardState getClipboardState()
public void setClipboardState(ClipboardState clipboardState)
clipboardState
- The clipboard state to set.
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.