org.zkoss.zul.impl
Class XulElement

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Component, Scope, ComponentCtrl
Direct Known Subclasses:
Absolutechildren, Absolutelayout, Anchorchildren, Anchorlayout, Audio, Auxhead, Bandpopup, Biglistbox, Box, Calendar, Cardlayout, Cell, Colorbox, Columnchildren, Columnlayout, Detail, Div, Dropupload, Fisheyebar, Foot, Frozen, Groupbox, HeadersElement, Html, Image, Include, InputElement, Label, LabelElement, LayoutRegion, Listfoot, Listitem, Menubar, Menuseparator, MeshElement, Navbar, Navseparator, Paging, Panel, Panelchildren, Popup, Portalchildren, Portallayout, Progressmeter, Radiogroup, Row, Rows, Scrollview, Separator, Slider, Span, Splitter, Tabbox, Tablechildren, Tablelayout, Tabpanel, Tabpanels, Tabs, Toolbar, Treechildren, Treefoot, Treeitem, Treerow, Window

public abstract class XulElement
extends HtmlBasedComponent

The fundamental class for XUL elements.

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
HtmlBasedComponent.ExtraCtrl
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
AbstractComponent.Children
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
 
Constructor Summary
XulElement()
           
 
Method Summary
 java.lang.Object clone()
          Clones the component.
 java.lang.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).
 java.lang.String getCtrlKeys()
          Returns what keystrokes to intercept.
 java.lang.String getPopup()
          Returns the ID of the popup (Popup) that should appear when the user clicks on the element.
 java.lang.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.
protected  void renderProperties(ContentRenderer renderer)
          Renders the content of this component, excluding the enclosing tags and children.
 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).
 void setContext(java.lang.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).
 void setCtrlKeys(java.lang.String ctrlKeys)
          Sets what keystrokes to intercept.
 void setPopup(Popup popup)
          Sets the UUID of the popup that should appear when the user clicks on the element.
 void setPopup(java.lang.String popup)
          Sets the ID of the popup (Popup) that should appear when the user clicks on the element.
 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.
 void setTooltip(java.lang.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.
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XulElement

public XulElement()
Method Detail

getCtrlKeys

public java.lang.String getCtrlKeys()
Returns what keystrokes to intercept.

Default: null.

Since:
3.0.6

setCtrlKeys

public void setCtrlKeys(java.lang.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

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 java.lang.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(java.lang.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:

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(Popup)

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:
setContext(String), Popup.open(org.zkoss.zk.ui.Component, String)

getPopup

public java.lang.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(java.lang.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:

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" context="id, x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)"/>
 

See Also:
setPopup(Popup), Popup.open(org.zkoss.zk.ui.Component, String)

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:
setPopup(String)

getTooltip

public java.lang.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(java.lang.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:

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" context="id, x=(zk.currentPointer[0] + 10), y=(zk.currentPointer[1] - 10)"/>
 

See Also:
setTooltip(Popup), Popup.open(org.zkoss.zk.ui.Component, String)

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:
setTooltip(String)

renderProperties

protected void renderProperties(ContentRenderer renderer)
                         throws java.io.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:
java.io.IOException

clone

public java.lang.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.


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo