Class XulElement

All Implemented Interfaces:
Serializable, Cloneable, Component, Scope, ComponentCtrl
Direct Known Subclasses:
Absolutechildren, Absolutelayout, Anchorchildren, Anchorlayout, Anchornav, Audio, Auxhead, Avatargroup, Badge, Bandpopup, Barcode, Barcodescanner, Biglistbox, Borderlayout, Box, Breadcrumb, Calendar, Camera, Cardlayout, Carousel, Cell, Coachmark, Codeeditor, Colorbox, Columnchildren, Columnlayout, Daterangebox, Detail, Div, Drawer, Dropupload, Fisheyebar, Foot, Frozen, GoldenLayout, GoldenPanel, Groupbox, HeadersElement, Html, Image, Include, InputElement, Inputgroup, Label, LabelElement, Layout, LayoutRegion, Lineitem, Linelayout, Listfoot, Listitem, Menubar, Menuseparator, MeshElement, Navbar, Navseparator, Organigram, Orgchildren, Orgitem, Paging, Panel, Panelchildren, Pdfviewer, Popup, Portalchildren, Portallayout, Progressmeter, Radiogroup, Rangeslider, Row, Rowchildren, Rowlayout, Rows, Scrollview, Separator, Signature, Slider, Sliderbuttons, Span, Splitlayout, Splitter, Step, Stepbar, Tabbox, Tablechildren, Tablelayout, Tabpanel, Tabpanels, Tabs, Tbeditor, Toolbar, Track, Treechildren, Treefoot, Treeitem, Treerow, Video, Window

public abstract class XulElement extends HtmlBasedComponent
The fundamental class for XUL elements.
Author:
tomyeh
See Also:
  • Constructor Details

    • XulElement

      public XulElement()
  • Method Details

    • getCtrlKeys

      public String getCtrlKeys()
      Returns what keystrokes to intercept.

      Default: null.

      Since:
      3.0.6
    • setCtrlKeys

      public void setCtrlKeys(String ctrlKeys) throws UiException
      Sets what keystrokes to intercept.

      The string could be a combination of the following:

      ^k
      A control key, i.e., Ctrl+k, where k could be a~z, 0~9, #n
      @k
      A alt key, i.e., Alt+k, where k could be a~z, 0~9, #n
      $n
      A shift key, i.e., Shift+n, where n could be #n. Note: $a ~ $z are not supported.
      #home
      Home
      #end
      End
      #ins
      Insert
      #del
      Delete
      #bak
      Backspace
      #left
      Left arrow
      #right
      Right arrow
      #up
      Up arrow
      #down
      Down arrow
      #pgup
      PageUp
      #pgdn
      PageDn
      #f1 #f2 ... #f12
      Function keys representing F1, F2, ... F12
      %[?]
      Mac command(⌘), [?] can be a~z, 0~9, #[?]. (since 8.5.0)
      #tab
      Tab (since 9.5.1)

      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.

      Throws:
      UiException
      Since:
      3.0.6
    • getContext

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

      Default: null (no context menu).

    • setContext

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

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

      Note: To simplify the use, it not only searches its ID space, but also all ID spaces in the desktop. It first searches its own ID space, and then the other Id spaces in the same browser window (might have one or multiple desktops).

      (since 3.0.2) If there are two components with the same ID (of course, in different ID spaces), you can specify the UUID with the following format:
      uuid(comp_uuid)

      Example:

      
       <label context="some">
       <label context="uuid(${some.uuid})"/>
       
      Both reference a component whose ID is "some". But, if there are several components with the same ID, the first one can reference to any of them. And, the second one reference to the component in the same ID space (of the label component).

      (since 3.6.3) the context menu can be shown by a position from Popup.open(org.zkoss.zk.ui.Component, String) or the location of x and y, you can specify the following format:

      • id, position
      • id, position=before_start
      • id, x=15, y=20
      • uuid(comp_uuid), position
      • uuid(comp_uuid), x=15, y=20
      For example,
       <button label="show" context="id, start_before"/>
       

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

       <button label="show" context="id, x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)"/>
       
      See Also:
    • setContext

      public void setContext(Popup popup)
      Sets the UUID of the popup that should appear when the user right-clicks on the element (a.k.a., context menu).

      Note: it actually invokes setContext("uuid(" + popup.getUuid() + ")")

      Since:
      3.0.2
      See Also:
    • setContextAttributes

      public void setContextAttributes(Popup popup, String position, String x, String y, String type)
      Sets the Attributes for the Context Popup Note that position will be ignored if coordinates are set.
      Parameters:
      popup - the Context popup component, can be null
      position - e.g. "after_start", can be null
      x - e.g. "50" or "(zk.currentPointer[0] + 10)", can be null
      y - e.g. "50" or "(zk.currentPointer[0] + 10)", can be null
      type - e.g. "toggle", can be null
      Since:
      8.5.0
    • getPopup

      public String getPopup()
      Returns the ID of the popup (Popup) that should appear when the user clicks on the element.

      Default: null (no popup).

    • setPopup

      public void setPopup(String popup)
      Sets the ID of the popup (Popup) that should appear when the user clicks on the element.

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

      Note: To simplify the use, it not only searches its ID space, but also all ID spaces in the desktop. It first searches its own ID space, and then the other Id spaces in the same browser window (might have one or multiple desktops).

      (since 3.0.2) If there are two components with the same ID (of course, in different ID spaces), you can specify the UUID with the following format:
      uuid(comp_uuid)

      (since 3.6.3) the popup can be shown by a position from Popup.open(org.zkoss.zk.ui.Component, String) or the location of x and y, you can specify the following format:

      • id, position
      • id, position=before_start
      • id, x=15, y=20
      • uuid(comp_uuid), position
      • uuid(comp_uuid), x=15, y=20
      For example,
       <button label="show" popup="id, start_before"/>
       

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

       <button label="show" popup="id, x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)"/>
       
      See Also:
    • setPopup

      public void setPopup(Popup popup)
      Sets the UUID of the popup that should appear when the user clicks on the element.

      Note: it actually invokes setPopup("uuid(" + popup.getUuid() + ")")

      Since:
      3.0.2
      See Also:
    • setPopupAttributes

      public void setPopupAttributes(Popup popup, String position, String x, String y, String type)
      Sets the Attributes for the Popup Note that position will be ignored if coordinates are set.
      Parameters:
      popup - the popup component, can be null
      position - e.g. "after_start", can be null
      x - e.g. "50" or "(zk.currentPointer[0] + 10)", can be null
      y - e.g. "50" or "(zk.currentPointer[0] + 10)", can be null
      type - e.g. "toggle", can be null
      Since:
      8.5.0
    • getTooltip

      public String getTooltip()
      Returns the ID of the popup (Popup) that should be used as a tooltip window when the mouse hovers over the element for a moment. The tooltip will automatically disappear when the mouse is moved away.

      Default: null (no tooltip).

    • setTooltip

      public void setTooltip(String tooltip)
      Sets the ID of the popup (Popup) that should be used as a tooltip window when the mouse hovers over the element for a moment.

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

      Note: To simplify the use, it not only searches its ID space, but also all ID spaces in the desktop. It first searches its own ID space, and then the other Id spaces in the same browser window (might have one or multiple desktops).

      (since 3.0.2) If there are two components with the same ID (of course, in different ID spaces), you can specify the UUID with the following format:
      uuid(comp_uuid)

      (since 3.6.3) the tooltip can be shown by a position from Popup.open(org.zkoss.zk.ui.Component, String) 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
      • uuid(comp_uuid2), position
      • uuid(comp_uuid), x=15, y=20
      For example,
       <button label="show" tooltip="id, start_before"/>
       

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

       <button label="show" tooltip="id, x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)"/>
       
      See Also:
    • setTooltip

      public void setTooltip(Popup popup)
      Sets the UUID of the popup that should be used as a tooltip window when the mouse hovers over the element for a moment.

      Note: it actually invokes setTooltip("uuid(" + popup.getUuid() + ")")

      Since:
      3.0.2
      See Also:
    • setTooltipAttributes

      public void setTooltipAttributes(Popup popup, String position, String x, String y, Integer delay)
      Sets the Attributes for the Tooltip Popup Note that position will be ignored if coordinates are set.
      Parameters:
      popup - the tooltip popup component, can be null
      position - e.g. "after_start", can be null
      x - e.g. "50" or "(zk.currentPointer[0] + 10)", can be null
      y - e.g. "50" or "(zk.currentPointer[0] + 10)", can be null
      delay - in milliseconds, can be null
      Since:
      8.5.0
    • renderProperties

      protected void renderProperties(ContentRenderer renderer) throws IOException
      Description copied from class: HtmlBasedComponent
      Renders the content of this component, excluding the enclosing tags and children.

      See also ZK Client-side Reference: Property Rendering

      Overrides:
      renderProperties in class HtmlBasedComponent
      Throws:
      IOException
    • getPropertyAccess

      public PropertyAccess getPropertyAccess(String prop)
      Description copied from interface: ComponentCtrl
      Returns the corresponding property access object from the given property name, if any.
      Specified by:
      getPropertyAccess in interface ComponentCtrl
      Overrides:
      getPropertyAccess in class HtmlBasedComponent
      Parameters:
      prop - the name of the property
      Returns:
      null it means not to support for the property name.
    • clone

      public Object clone()
      Description copied from interface: Component
      Clones the component. All of its children and descendants are cloned. Also, ID are preserved.
      Specified by:
      clone in interface Component
      Overrides:
      clone in class HtmlBasedComponent
      Returns:
      the new component. Notice that it doesn't belong to any page, nor desktop. It doesn't have a parent, either.