org.zkoss.zul.impl
Class LabelImageElement

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.impl.LabelElement
                  extended by org.zkoss.zul.impl.LabelImageElement
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.sys.ComponentCtrl
Direct Known Subclasses:
Button, Caption, Checkbox, Comboitem, Footer, HeaderElement, Listcell, Listfooter, Menu, Menuitem, Tab, Toolbarbutton, Treecell, Treefooter

public class LabelImageElement
extends LabelElement

A HTML element with a label (LabelElement.getLabel())and an image (getImage()).

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
protected  class LabelImageElement.ExtraCtrl
          A utility class to implement AbstractComponent.getExtraCtrl().
 
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
LabelImageElement()
           
 
Method Summary
 java.lang.String getImage()
          Returns the image URI.
 org.zkoss.image.Image getImageContent()
          Returns the content set by setImageContent(org.zkoss.image.Image).
 java.lang.String getImgTag()
          Returns the HTML IMG tag for the image part, or null if no image is assigned (isImageAssigned()) Used only for component template, not for application developers.
 java.lang.String getSrc()
          Returns the src (an image URI).
 boolean isImageAssigned()
          Returns whether the image is available.
protected  java.lang.Object newExtraCtrl()
           
 void setImage(java.lang.String src)
          Sets the image URI.
 void setImageContent(org.zkoss.image.Image image)
          Sets the content directly.
 void setSrc(java.lang.String src)
          Sets the src (the image URI).
 
Methods inherited from class org.zkoss.zul.impl.LabelElement
getLabel, setLabel
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getAllOnClickAttrs, getContext, getInnerAttrs, getOuterAttrs, getPopup, getTooltip, setAction, setContext, setPopup, setTooltip
 
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, 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

LabelImageElement

public LabelImageElement()
Method Detail

getImage

public java.lang.String getImage()
Returns the image URI.

Default: null.

The same as getSrc().


setImage

public void setImage(java.lang.String src)
Sets the image URI.

If src is changed, the component's inner is invalidate. Thus, you want to smart-update, you have to override this method.

The same as setSrc(java.lang.String).


getSrc

public java.lang.String getSrc()
Returns the src (an image URI).

Default: null.

The same as getImage().


setSrc

public void setSrc(java.lang.String src)
Sets the src (the image URI).

If src is changed, the component's inner is invalidate. Thus, you want to smart-update, you have to override this method.

The same as setImage(java.lang.String).


setImageContent

public void setImageContent(org.zkoss.image.Image image)
Sets the content directly. Default: null.

Parameters:
image - the image to display. If not null, it has higher priority than getSrc().

getImageContent

public org.zkoss.image.Image getImageContent()
Returns the content set by setImageContent(org.zkoss.image.Image).

Note: it won't fetch what is set thru by setSrc(java.lang.String). It simply returns what is passed to setImageContent(org.zkoss.image.Image).


isImageAssigned

public boolean isImageAssigned()
Returns whether the image is available. In other words, it return true if setImage(java.lang.String) or setImageContent(org.zkoss.image.Image) is called with non-null.


getImgTag

public java.lang.String getImgTag()
Returns the HTML IMG tag for the image part, or null if no image is assigned (isImageAssigned())

Used only for component template, not for application developers.

Note: the component template shall use this method to generate the HTML tag, instead of using getImage().


newExtraCtrl

protected java.lang.Object newExtraCtrl()
Overrides:
newExtraCtrl in class org.zkoss.zk.ui.HtmlBasedComponent


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