public abstract class Icon extends Object
Icon implementations which are capable of providing an image representation of the icon should override getImageURI(), getImageWidth() and getImageHeight(). The default implementations of these methods return null, which is an acceptable default for Icons which do not make use of images (ie. for text-based Icon implementations).
Modifier and Type | Field and Description |
---|---|
static String |
ALIGN_KEY |
static String |
EMBEDDED_KEY |
static String |
HEIGHT_KEY |
static String |
ID_KEY |
static String |
INLINE_STYLE_KEY |
static String |
SHORT_DESC_KEY |
static String |
STYLE_CLASS_KEY |
static String |
WIDTH_KEY |
Constructor and Description |
---|
Icon() |
Modifier and Type | Method and Description |
---|---|
Integer |
getImageHeight(RenderingContext arc)
Returns the height of the image.
|
Object |
getImageURI(javax.faces.context.FacesContext context,
RenderingContext arc)
Returns a URI to the image that is used as the icon's content.
|
Integer |
getImageWidth(RenderingContext arc)
Returns the width of the image.
|
boolean |
isNull()
Returns true if the icon is non-existent, and will render no content
at all.
|
InputStream |
openStream(javax.faces.context.FacesContext context,
RenderingContext arc)
Returns an InputStream which provides access to the
image data for image-based Icons.
|
abstract void |
renderIcon(javax.faces.context.FacesContext context,
RenderingContext arc,
Map<String,? extends Object> attrs)
Renders the Icon.
|
public static final String SHORT_DESC_KEY
public static final String ALIGN_KEY
public static final String WIDTH_KEY
public static final String HEIGHT_KEY
public static final String EMBEDDED_KEY
public static final String ID_KEY
public static final String STYLE_CLASS_KEY
public static final String INLINE_STYLE_KEY
public abstract void renderIcon(javax.faces.context.FacesContext context, RenderingContext arc, Map<String,? extends Object> attrs) throws IOException
context
- FacesContextarc
- The RenderingContext for the
current request.attrs
- A Map which which provides access to
values that might be useful to Icon implementations,
such as "id" and "shortDesc".IOException
public Object getImageURI(javax.faces.context.FacesContext context, RenderingContext arc)
context
- FacesContextarc
- The RenderingContext for the
current request.public Integer getImageWidth(RenderingContext arc)
arc
- RenderingContextpublic Integer getImageHeight(RenderingContext arc)
arc
- RenderingContextpublic InputStream openStream(javax.faces.context.FacesContext context, RenderingContext arc) throws IOException
context
- FacesContextarc
- The RenderingContext for the
current request.IOException
public boolean isNull()
Copyright © 2001-2016 The Apache Software Foundation. All Rights Reserved.