scalafx.scene.input

Clipboard

class Clipboard extends SFXDelegate[javafx.scene.input.Clipboard]

Represents an operating system clipboard, on which data may be placed during, for example, cut, copy, and paste operations.

To access the general system clipboard, use the following code:

val clipboard = Clipboard.systemClipboard

There is only ever one instance of the system clipboard in the application, so it is perfectly acceptable to stash a reference to it somewhere handy if you so choose.

The Clipboard operates on the concept of having a single conceptual item on the clipboard at any one time -- though it may be placed on the clipboard in different formats.

Example use:

val clipboard = Clipboard.systemClipboard
val content = new ClipboardContent()
content.putString("Some text")
content.putHtml("Some text")
clipboard.content = content

Alternative use:

Clipboard.systemClipboard.content = ClipboardContent(
DataFormat.PlainText -> "Some text",
DataFormat.Html -> "Some text"
)

Caution when putting files into the clipboard. The recommended method is:

val content = new ClipboardContent()
content.putString("Some text")

Wraps a JavaFX http://docs.oracle.com/javase/8/javafx/api/javafx/scene/input/Clipboard.html Clipboard.

Source
Clipboard.scala
Linear Supertypes
SFXDelegate[javafx.scene.input.Clipboard], AnyRef, Any
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Clipboard
  2. SFXDelegate
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Clipboard(delegate: javafx.scene.input.Clipboard)

    Creates a new Clipboard from a JavaFX one.

    Creates a new Clipboard from a JavaFX one.

    delegate

    A JavaFX Clipboard to be wrapped. Its default value is a new JavaFX Clipboard.

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. def clear(): Unit

    Clears the clipboard of any and all content.

  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  9. def content: ClipboardContent

    Return a copy of the clipboard content.

  10. def content(dataFormat: DataFormat): AnyRef

    Returns the content stored in this clipboard of the given type, or null if there is no content with this type.

  11. def contentTypes: Set[javafx.scene.input.DataFormat]

    Gets the set of DataFormat types on this Clipboard instance which have associated data registered on the clipboard.

  12. def content_=(content: ClipboardContent): Unit

    Puts content onto the clipboard.

    Puts content onto the clipboard.

    This call will always result in clearing all previous content from the clipboard, and replacing it with whatever content is specified in the supplied ClipboardContent map.

    Exceptions thrown
    java.lang.NullPointerException

    - if null data reference is passed for any format

  13. val delegate: javafx.scene.input.Clipboard

    A JavaFX Clipboard to be wrapped.

    A JavaFX Clipboard to be wrapped. Its default value is a new JavaFX Clipboard.

    Definition Classes
    ClipboardSFXDelegate
  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def equals(ref: Any): Boolean

    Verifies if a object is equals to this delegate.

    Verifies if a object is equals to this delegate.

    ref

    Object to be compared.

    returns

    if the other object is equals to this delegate or not.

    Definition Classes
    SFXDelegate → AnyRef → Any
  16. def files: Seq[File]

    Gets the list of files from the clipboard which had previously been registered.

  17. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  18. def hasContent(dataFormat: DataFormat): Boolean

    Tests whether there is any content on this clipboard of the given DataFormat type.

  19. def hasFiles: Boolean

    Gets whether an list of files (DataFormat.Files) has been registered on this Clipboard.

  20. def hasHtml: Boolean

    Gets whether an HTML text String (DataFormat.Html) has been registered on this Clipboard.

  21. def hasImage: Boolean

    Gets whether an Image (DataFormat.Image) has been registered on this Clipboard.

  22. def hasRtf: Boolean

    Gets whether an RTF String (DataFormat.Rtf) has been registered on this Clipboard.

  23. def hasString: Boolean

    Gets whether a plain text String (DataFormat.PlainText) has been registered on this Clipboard.

  24. def hasUrl: Boolean

    Gets whether a url String (DataFormat.Url) has been registered on this Clipboard.

  25. def hashCode(): Int

    returns

    The delegate hashcode

    Definition Classes
    SFXDelegate → AnyRef → Any
  26. def html: String

    Gets the HTML text String from the clipboard which had previously been registered.

  27. def image: Image

    Gets the Image from the clipboard which had previously been registered.

  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  31. final def notifyAll(): Unit

    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  32. def rtf: String

    Gets the RTF text String from the clipboard which had previously been registered.

  33. def string: String

    Gets the plain text String from the clipboard which had previously been registered.

  34. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  35. def toString(): String

    returns

    Returns the original delegate's toString() adding a [SFX] prefix.

    Definition Classes
    SFXDelegate → AnyRef → Any
  36. def url: String

    Gets the URL String from the clipboard which had previously been registered.

  37. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  39. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from SFXDelegate[javafx.scene.input.Clipboard]

Inherited from AnyRef

Inherited from Any

Ungrouped