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, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl
Direct Known Subclasses:
Audio, Bandpopup, Box, Calendar, Div, Foot, Grid, Groupbox, HeadersElement, Html, Iframe, Image, Include, InputElement, Label, LabelElement, Listbox, Listfoot, Listitem, Menubar, Menuseparator, Paging, Popup, Progressmeter, Radiogroup, Row, Rows, Separator, Slider, Splitter, Tabbox, Tabpanel, Tabpanels, Tabs, Timer, Toolbar, Tree, Treechildren, Treefoot, Treeitem, Treerow, Window

public abstract class XulElement
extends org.zkoss.zk.ui.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
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl
 
Field Summary
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
XulElement()
           
 
Method Summary
 java.lang.String getAction()
          Returns the client-side action (CSA).
protected  java.lang.String getAllOnClickAttrs(boolean ignoreOnClick)
          Returns the attributes for onClick, onRightClick and onDoubleClick by checking whether the corresponding listeners are added, or null if none is added.
 java.lang.String getContext()
          Returns the ID of Popup that should appear when the user right-clicks on the element (aka., context menu).
 java.lang.String getInnerAttrs()
          Generates the Client-Side-Action attributes to the interior tag.
 java.lang.String getOuterAttrs()
           
 java.lang.String getPopup()
          Returns the ID of Popup that should appear when the user clicks on the element.
 java.lang.String getTooltip()
          Returns the ID of Popup that should be used as a tooltip window when the mouse hovers over the element for a moment.
 void setAction(java.lang.String action)
          Sets the client-side action.
 void setContext(java.lang.String context)
          Sets the ID of Popup that should appear when the user right-clicks on the element (aka., context menu).
 void setPopup(java.lang.String popup)
          Sets the ID of Popup that should appear when the user clicks on the element.
 void setTooltip(java.lang.String tooltip)
          Sets the ID of 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
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getLeft, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, newExtraCtrl, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addSharedAnnotationMap, addSharedEventHandlerMap, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getEventHandler, getExtraCtrl, getFellow, getFellowIfAny, getId, getListenerIterator, getMold, getMoldURI, getNamespace, getPage, getParent, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isChildable, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

XulElement

public XulElement()
Method Detail

getContext

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

Default: null (no context menu).


setContext

public void setContext(java.lang.String context)
Sets the ID of Popup that should appear when the user right-clicks on the element (aka., 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.


getPopup

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

Default: null (no poppup).


setPopup

public void setPopup(java.lang.String popup)
Sets the ID of 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.


getTooltip

public java.lang.String getTooltip()
Returns the ID of 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.

Default: null (no tooltip).


setTooltip

public void setTooltip(java.lang.String tooltip)
Sets the ID of 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.


getAction

public java.lang.String getAction()
Returns the client-side action (CSA).

The format:
action1: javascript1; javascript2; action2: javascript3

You could specify any action as long as JavaScript supports, such as onfocus, onblur, onmouseover and onmousout.


setAction

public void setAction(java.lang.String action)
Sets the client-side action.


getAllOnClickAttrs

protected java.lang.String getAllOnClickAttrs(boolean ignoreOnClick)
Returns the attributes for onClick, onRightClick and onDoubleClick by checking whether the corresponding listeners are added, or null if none is added.

Parameters:
ignoreOnClick - whether to ignore onClick

getOuterAttrs

public java.lang.String getOuterAttrs()
Overrides:
getOuterAttrs in class org.zkoss.zk.ui.HtmlBasedComponent

getInnerAttrs

public java.lang.String getInnerAttrs()
Generates the Client-Side-Action attributes to the interior tag. Reason: onfocus is the main use.

Overrides:
getInnerAttrs in class org.zkoss.zk.ui.HtmlBasedComponent


Copyright © 2005-2007 Potix Corporation. All Rights Reserved.