Interface IXulElement<I extends IXulElement>

    • Method Detail

      • getCtrlKeys

        @Nullable
        java.lang.String getCtrlKeys()
        Returns what keystrokes to intercept when a user presses the key on the component.

        Default: null.

      • withCtrlKeys

        I withCtrlKeys​(@Nullable
                       java.lang.String ctrlKeys)
        Returns a copy of this immutable component with the specified ctrlKeys.

        Sets what keystrokes to intercept.

        The string could be a combination of the following:

        Key
        Syntax
        Description
        Control
        ^[?]
        [?] can be a~z, 0~9, #[?],

        e.g. ^k represents Ctrl+k

        Alt
        @[?]
        [?] can be a~z, 0~9, #[?],

        e.g. @k represents Alt+k

        Shift
        $[?]
        [?] can be #[?]. Note: $a ~ $z are not supported.

        e.g. $#down represents Shift+↓

        Mac command(⌘)
        %[?]

        [?] can be a~z, 0~9, #[?]. e.g. %k represents command+k

        Navigation key
        #[?]
        the supported value of [?] are listed below:
        Home
        #home
        End
        #end
        Insert
        #ins
        Delete
        #del
        #left
        #right
        #up
        #down
        PgUp
        #pgup
        PgDn
        #pgdn
        Backspace
        #bak
        function key (F1, F2,... F12)
        #f1, #f2, ... #f12
        Tab
        #tab

        For example,

        ^a^d@c#f10#left#right
        It means you want to intercept Ctrl+A, Ctrl+D, Alt+C, F10, Left and Right.
        ^#left
        It means Ctrl+Left.
        ^#f1
        It means Ctrl+F1.
        @#f3
        It means Alt+F3.

        Note: it doesn't support Ctrl+Alt, Shift+Ctrl, Shift+Alt or Shift+Ctrl+Alt.

        Parameters:
        ctrlKeys - The expression of the keystroke combination to intercept with.
        Returns:
        A modified copy of the this object
      • getContext

        @Nullable
        java.lang.String getContext()
        Returns the ID of the popup that should appear when the user right-clicks on the element (a.k.a., context menu).

        Default: null (no context menu).

      • withContext

        I withContext​(@Nullable
                      java.lang.String context)
        Returns a copy of this immutable component with the specified context.

        Sets the ID of the popup that should appear when the user right-clicks on the element (a.k.a., context menu).

        An onOpen action is triggered to the context menu if it is going to appear. Therefore, developers can manipulate it dynamically (perhaps based on OpenData.getReference()) by listening to the onOpen action.

        The context menu can be shown by a position or the location of x and y, you can specify the following format:

        • id, position
        • id, position=before_start
        • id, x=15, y=20
        For example,
         .withContext("id, start_before")
         

        The context menu can also be shown on customized location of x and y by adding parentheses "()", for example,

         .withContext("id, x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)")
         

        Possible values for the position attribute are:

        • before_start
          the popup appears above the anchor, aligned to the left.
        • before_center
          the popup appears above the anchor, aligned to the center.
        • before_end
          the popup appears above the anchor, aligned to the right.
        • after_start
          the popup appears below the anchor, aligned to the left.
        • after_center
          the popup appears below the anchor, aligned to the center.
        • after_end
          the popup appears below the anchor, aligned to the right.
        • start_before
          the popup appears to the left of the anchor, aligned to the top.
        • start_center
          the popup appears to the left of the anchor, aligned to the middle.
        • start_after
          the popup appears to the left of the anchor, aligned to the bottom.
        • end_before
          the popup appears to the right of the anchor, aligned to the top.
        • end_center
          the popup appears to the right of the anchor, aligned to the middle.
        • end_after
          the popup appears to the right of the anchor, aligned to the bottom.
        • overlap/top_left
          the popup overlaps the anchor, with anchor and popup aligned at top-left.
        • top_center
          the popup overlaps the anchor, with anchor and popup aligned at top-center.
        • overlap_end/top_right
          the popup overlaps the anchor, with anchor and popup aligned at top-right.
        • middle_left
          the popup overlaps the anchor, with anchor and popup aligned at middle-left.
        • middle_center
          the popup overlaps the anchor, with anchor and popup aligned at middle-center.
        • middle_right
          the popup overlaps the anchor, with anchor and popup aligned at middle-right.
        • overlap_before/bottom_left
          the popup overlaps the anchor, with anchor and popup aligned at bottom-left.
        • bottom_center
          the popup overlaps the anchor, with anchor and popup aligned at bottom-center.
        • overlap_after/bottom_right
          the popup overlaps the anchor, with anchor and popup aligned at bottom-right.
        • at_pointer
          the popup appears with the upper-left aligned with the mouse cursor.
        • after_pointer
          the popup appears with the top aligned with the bottom of the mouse cursor, with the left side of the popup at the horizontal position of the mouse cursor.

        Note: The position will be ignored if coordinates are set.
        Parameters:
        context - The ID of IPopup
        Returns:
        A modified copy of the this object
      • getPopup

        @Nullable
        java.lang.String getPopup()
        Returns the ID of the popup that should appear when the user clicks on the component.

        Default: null (no popup).

      • withPopup

        I withPopup​(@Nullable
                    java.lang.String popup)
        Returns a copy of this immutable component with the specified popup.

        Sets the ID of the popup that should appear when the user clicks on the component.

        An onOpen action is triggered to the popup menu if it is going to appear. Therefore, developers can manipulate it dynamically (perhaps based on OpenData.getReference()) by listening to the onOpen action.

        The popup can be shown by a position or the location of x and y, you can specify the following format:

        • id, position
        • id, position=before_start
        • id, x=15, y=20
        For example,
         .withPopup("id, start_before")
         

        The popup can also be shown on customized location of x and y by adding parentheses "()", for example,

         .withPopup("id, x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)")
         

        Possible values for the position attribute are:

        • before_start
          the popup appears above the anchor, aligned to the left.
        • before_center
          the popup appears above the anchor, aligned to the center.
        • before_end
          the popup appears above the anchor, aligned to the right.
        • after_start
          the popup appears below the anchor, aligned to the left.
        • after_center
          the popup appears below the anchor, aligned to the center.
        • after_end
          the popup appears below the anchor, aligned to the right.
        • start_before
          the popup appears to the left of the anchor, aligned to the top.
        • start_center
          the popup appears to the left of the anchor, aligned to the middle.
        • start_after
          the popup appears to the left of the anchor, aligned to the bottom.
        • end_before
          the popup appears to the right of the anchor, aligned to the top.
        • end_center
          the popup appears to the right of the anchor, aligned to the middle.
        • end_after
          the popup appears to the right of the anchor, aligned to the bottom.
        • overlap/top_left
          the popup overlaps the anchor, with anchor and popup aligned at top-left.
        • top_center
          the popup overlaps the anchor, with anchor and popup aligned at top-center.
        • overlap_end/top_right
          the popup overlaps the anchor, with anchor and popup aligned at top-right.
        • middle_left
          the popup overlaps the anchor, with anchor and popup aligned at middle-left.
        • middle_center
          the popup overlaps the anchor, with anchor and popup aligned at middle-center.
        • middle_right
          the popup overlaps the anchor, with anchor and popup aligned at middle-right.
        • overlap_before/bottom_left
          the popup overlaps the anchor, with anchor and popup aligned at bottom-left.
        • bottom_center
          the popup overlaps the anchor, with anchor and popup aligned at bottom-center.
        • overlap_after/bottom_right
          the popup overlaps the anchor, with anchor and popup aligned at bottom-right.
        • at_pointer
          the popup appears with the upper-left aligned with the mouse cursor.
        • after_pointer
          the popup appears with the top aligned with the bottom of the mouse cursor, with the left side of the popup at the horizontal position of the mouse cursor.

        Note: The position will be ignored if coordinates are set.
        Parameters:
        popup - The ID of IPopup
        Returns:
        A modified copy of the this object
      • getTooltip

        @Nullable
        java.lang.String getTooltip()
        Returns the ID of the popup (IPopup) that should be used as a tooltip window when the mouse hovers over the component for a moment. The tooltip will automatically disappear when the mouse is moved away.

        Default: null (no tooltip).

      • withTooltip

        I withTooltip​(@Nullable
                      java.lang.String tooltip)
        Returns a copy of this immutable component with the specified tooltip.

        Sets the ID of the popup that should be used as a tooltip window when the mouse hovers over the component for a moment.

        An onOpen action is triggered to the tooltip if it is going to appear. Therefore, developers can manipulate it dynamically (perhaps based on OpenData.getReference()) by listening to the onOpen action.

        The tooltip can be shown by a position or the location of x and y, and can be specified with a delay time (in millisecond), you can specify the following format:

        • id, position
        • id, position=before_start, delay=500
        • id, x=15, y=20
        For example,
         .withTooltip("id, start_before")
         

        The tooltip can also be shown on customized location of x and y by adding parentheses "()", for example,

         .withTooltip("id, x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)")
         

        Possible values for the position attribute are:

        • before_start
          the popup appears above the anchor, aligned to the left.
        • before_center
          the popup appears above the anchor, aligned to the center.
        • before_end
          the popup appears above the anchor, aligned to the right.
        • after_start
          the popup appears below the anchor, aligned to the left.
        • after_center
          the popup appears below the anchor, aligned to the center.
        • after_end
          the popup appears below the anchor, aligned to the right.
        • start_before
          the popup appears to the left of the anchor, aligned to the top.
        • start_center
          the popup appears to the left of the anchor, aligned to the middle.
        • start_after
          the popup appears to the left of the anchor, aligned to the bottom.
        • end_before
          the popup appears to the right of the anchor, aligned to the top.
        • end_center
          the popup appears to the right of the anchor, aligned to the middle.
        • end_after
          the popup appears to the right of the anchor, aligned to the bottom.
        • overlap/top_left
          the popup overlaps the anchor, with anchor and popup aligned at top-left.
        • top_center
          the popup overlaps the anchor, with anchor and popup aligned at top-center.
        • overlap_end/top_right
          the popup overlaps the anchor, with anchor and popup aligned at top-right.
        • middle_left
          the popup overlaps the anchor, with anchor and popup aligned at middle-left.
        • middle_center
          the popup overlaps the anchor, with anchor and popup aligned at middle-center.
        • middle_right
          the popup overlaps the anchor, with anchor and popup aligned at middle-right.
        • overlap_before/bottom_left
          the popup overlaps the anchor, with anchor and popup aligned at bottom-left.
        • bottom_center
          the popup overlaps the anchor, with anchor and popup aligned at bottom-center.
        • overlap_after/bottom_right
          the popup overlaps the anchor, with anchor and popup aligned at bottom-right.
        • at_pointer
          the popup appears with the upper-left aligned with the mouse cursor.
        • after_pointer
          the popup appears with the top aligned with the bottom of the mouse cursor, with the left side of the popup at the horizontal position of the mouse cursor.

        Note: The position will be ignored if coordinates are set.
        Parameters:
        tooltip - The ID of IPopup
        Returns:
        A modified copy of the this object