Class ClipboardEvent

    • Field Detail

      • GSON

        protected static final com.google.gson.Gson GSON
    • Constructor Detail

      • ClipboardEvent

        public ClipboardEvent​(ClipboardResult result,
                              org.zkoss.zk.ui.Component target)
        Creates a ClipboardEvent with an optional target component. If target is null, the event is broadcast to all root components (desktop event queue). If target is specified, the event is delivered only to that component.
        Parameters:
        result - the clipboard operation result
        target - the target component to receive this event, or null to broadcast to desktop
      • ClipboardEvent

        public ClipboardEvent​(ClipboardResult result)
        Creates a ClipboardEvent that broadcasts to all root components (desktop event queue). This constructor maintains backward compatibility with existing code.
        Parameters:
        result - the clipboard operation result
    • Method Detail

      • getEvent

        public static ClipboardEvent getEvent​(org.zkoss.zk.au.AuRequest request)
      • isSuccess

        public boolean isSuccess()
        Checks if the clipboard operation was successful.
        Returns:
        true if the operation succeeded, false otherwise
      • getResult

        public ClipboardResult getResult()
        Gets the clipboard result.
        Returns:
        the clipboard result (ClipboardText or ClipboardImage)
      • isTextResult

        public boolean isTextResult()
        Checks if this is a text result.
        Returns:
        true if the result contains text data
      • getClipboardText

        public ClipboardText getClipboardText()
        Calling isTextResult() before calling this method. Gets the clipboard text if available.
        Returns:
        the ClipboardText result, or null if this is not a text result
      • getClipboardImage

        public ClipboardImage getClipboardImage()
        Calling isTextResult() before calling this method. Gets the clipboard image if available.
        Returns:
        the ClipboardImage result, or null if this is not an image result
      • parseResponse

        protected static ClipboardResult parseResponse​(Map<String,​Object> data)
        Parses the AU request data from JavaScript clipboard operations into a ClipboardResult object.
        Parameters:
        data - The AU request data map
        Returns:
        ClipboardResult containing the parsed data