|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.system.Clipboard
public final class Clipboard
Provides a global clipboard for cut and paste operations.
// Retrieve the Clipboard object. Clipboard cp = Clipboard.getClipboard(); // Copy to clipboard. cp.put(str); // Retrieve the clipboard's current contents String str = (String) cp.get(); // Clean the clipboard. cp.put(null);
Method Summary | ||
---|---|---|
Object |
get()
Retrieves the clipboard's current contents. |
|
static Clipboard |
getClipboard()
Retrieves the system's clipboard object. |
|
Object |
put(Object o)
Copies an object to the clipboard. |
|
String |
toString()
Retrieves string equivalent of clipboard's contents. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public Object get()
Notice that this get is not destructive: the clipboard remains loaded with this object until a new one gets put to replace it.
public static Clipboard getClipboard()
public Object put(Object o)
This operation replaces the existing object with your new one. Accordingly, you can clear out the clipboard by passing null into this method.
Note: This method throws a SecurityException
if
third-party applications provide an object other than a String
or
StringBuffer
as parameter to this method.
o
- New object to put on the clipboard.
public String toString()
This method invokes toString() on the clipboard's current contained object. If the contents are null, then an empty string is returned.
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal