org.zkoss.zul.impl.api
Interface LabelImageElement

All Superinterfaces:
java.lang.Cloneable, Component, HtmlBasedComponent, LabelElement, Scope, java.io.Serializable, XulElement
All Known Subinterfaces:
A, Auxheader, Button, Caption, Checkbox, Column, Comboitem, Footer, HeaderElement, Listcell, Listfooter, Listheader, Menu, Menuitem, Radio, Tab, Toolbarbutton, Treecell, Treecol, Treefooter
All Known Implementing Classes:
A, Auxheader, Button, Caption, Checkbox, Column, Comboitem, Fileupload, Fileupload, Fisheye, Footer, HeaderElement, LabelImageElement, Listcell, Listfooter, Listheader, Menu, Menuitem, MessageboxDlg.Button, Radio, Tab, Toolbarbutton, Treecell, Treecol, Treefooter

public interface LabelImageElement
extends LabelElement

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

Since:
3.5.2
Author:
tomyeh

Field Summary
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Method Summary
 java.lang.String getHoverImage()
          Returns the URI of the hover image.
 java.lang.String getImage()
          Returns the image URI.
 Image getImageContent()
          Returns the image content set by setImageContent(Image) or setImageContent(RenderedImage).
 void setHoverImage(java.lang.String src)
          Sets the image URI.
 void setHoverImageContent(Image image)
          Sets the content of the hover image directly.
 void setHoverImageContent(java.awt.image.RenderedImage image)
          Sets the content of the hover image directly with the rendered image.
 void setImage(java.lang.String src)
          Sets the image URI.
 void setImageContent(Image image)
          Sets the content directly.
 void setImageContent(java.awt.image.RenderedImage image)
          Sets the content directly with the rendered image.
 
Methods inherited from interface org.zkoss.zul.impl.api.LabelElement
getLabel, setLabel
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

Method Detail

getImage

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

Default: null.


setImage

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

Calling this method implies setImageContent(null). In other words, the last invocation of setImage(java.lang.String) overrides the previous setImageContent(org.zkoss.image.Image), if any.

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

See Also:
setImageContent(Image), setImageContent(RenderedImage)

setImageContent

void setImageContent(Image image)
Sets the content directly.

Default: null.

Calling this method implies setImage(null). In other words, the last invocation of setImageContent(org.zkoss.image.Image) overrides the previous setImage(java.lang.String), if any.

Parameters:
image - the image to display.
See Also:
setImage(java.lang.String)

setImageContent

void setImageContent(java.awt.image.RenderedImage image)
Sets the content directly with the rendered image. It actually encodes the rendered image to an PNG image (Image) with Images.encode(java.lang.String, java.awt.image.RenderedImage, float, boolean), and then invoke setImageContent(org.zkoss.image.Image).

If you want more control such as different format, quality, and naming, you can use Images directly.


getImageContent

Image getImageContent()
Returns the image content set by setImageContent(Image) or setImageContent(RenderedImage).

Note: it won't load the content specified by setImage(java.lang.String). Actually, it returns null if setImage(java.lang.String) was called.


getHoverImage

java.lang.String getHoverImage()
Returns the URI of the hover image. The hover image is used when the mouse is moving over this component.

Default: null.


setHoverImage

void setHoverImage(java.lang.String src)
Sets the image URI. The hover image is used when the mouse is moving over this component.

Calling this method implies setHoverImageContent(null). In other words, the last invocation of setHoverImage(java.lang.String) overrides the previous setHoverImageContent(org.zkoss.image.Image), if any.


setHoverImageContent

void setHoverImageContent(Image image)
Sets the content of the hover image directly. The hover image is used when the mouse is moving over this component.

Default: null.

Calling this method implies setHoverImage(null). In other words, the last invocation of setHoverImageContent(org.zkoss.image.Image) overrides the previous setHoverImage(java.lang.String), if any.

Parameters:
image - the image to display.

setHoverImageContent

void setHoverImageContent(java.awt.image.RenderedImage image)
Sets the content of the hover image directly with the rendered image. The hover image is used when the mouse is moving over this component.

It actually encodes the rendered image to an PNG image ( Image) with Images.encode(java.lang.String, java.awt.image.RenderedImage, float, boolean), and then invoke setHoverImageContent(org.zkoss.image.Image).

If you want more control such as different format, quality, and naming, you can use Images directly.



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