|
EchoPoint API - 3.0.0b5 App Webcontainer |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnextapp.echo.app.Component
echopoint.internal.AbstractContainer
echopoint.internal.AbstractHtmlComponent
echopoint.HtmlLayout
public class HtmlLayout
A container component that uses user specified XHTML layout to render components. Provides a more flexible and powerful alternative to usual layout containers.
The following code shows sample use of this component:
import echopoint.HtmlLayout;
import echopoint.layout.HtmlLayoutData;
import nextapp.echo.app.Button;
import nextapp.echo.app.Component;
import nextapp.echo.app.Label;
...
final String text = "<table border='1'>" +
"<tr>" +
"<td colspan='2'>" +
"This is regular HTML text in layout component!" +
"</td>" +
"</tr>" +
"<tr>" +
"<td id='one' colspan='2'></td>" +
"</tr>" +
"<tr>" +
"<td id='two'></td>" +
"<td id='three'></td>" +
"</tr>" +
"</table>";
final HtmlLayout container = new HtmlLayout( text );
Component child = new Button( "Button One" );
// Layout data that specified that component is child of td with id one
HtmlLayoutData layout = new HtmlLayoutData( "one" );
child.setLayoutData( layout );
container.add( child );
child = new Label( "Label One" );
layout = new HtmlLayoutData( "two" );
child.setLayoutData( layout );
container.add( child );
child = new Label( "Label Two" );
layout = new HtmlLayoutData( "three" );
child.setLayoutData( layout );
container.add( child );
...
parent.add( container );
...
final HtmlLayout fromFile = new HtmlLayout( "/tmp/test.html", "UTF-8" );
| Field Summary |
|---|
| Fields inherited from class echopoint.internal.AbstractHtmlComponent |
|---|
PROPERTY_TARGET, PROPERTY_TEXT |
| Fields inherited from class echopoint.internal.AbstractContainer |
|---|
ACTION_COMMAND_PROPERTY, ACTION_LISTENERS_CHANGED_PROPERTY, INPUT_ACTION, PROPERTY_ALIGNMENT, PROPERTY_BACKGROUND_IMAGE, PROPERTY_BORDER, PROPERTY_HEIGHT, PROPERTY_INSETS, PROPERTY_WIDTH |
| Constructor Summary | |
|---|---|
HtmlLayout()
Default constructor. |
|
HtmlLayout(InputStream instream,
String charset)
Create a new instance using the XHTML layout data specified in the input stream (file or resource usually). |
|
HtmlLayout(String text)
Create a new instance using the specified XHTML layout code. |
|
| Method Summary | |
|---|---|
boolean |
isValidChild(Component component)
Over-ridden to return true since this component allows children. |
void |
setTarget(String target)
Over-ridden to make no-op. |
| Methods inherited from class echopoint.internal.AbstractHtmlComponent |
|---|
append, getTarget, getText, setText |
| Methods inherited from class echopoint.internal.AbstractContainer |
|---|
addActionListener, fireActionPerformed, getAlignment, getBackgroundImage, getBorder, getHeight, getInsets, getWidth, hasActionListeners, removeActionListener, setAlignment, setBackgroundImage, setBorder, setHeight, setInsets, setWidth |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HtmlLayout()
AbstractHtmlComponent.setText(java.lang.String) before the layout container is rendered to avoid a
client-side exception.
public HtmlLayout(String text)
text - The layout code to use to embed components.
public HtmlLayout(InputStream instream,
String charset)
throws IOException
instream - The input stream from which to read the XHTML layout data.charset - The character set to use to read the input stream.
IOException - If errors are encountered while reading the
contents of the input stream.| Method Detail |
|---|
public boolean isValidChild(Component component)
true since this component allows children.
isValidChild in class AbstractHtmlComponentcomponent - The component to check.
true.public void setTarget(String target)
setTarget in class AbstractHtmlComponenttarget - The value to set.
|
EchoPoint API - 3.0.0b5 App Webcontainer |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||