public class HtmlTableLayout extends HtmlLayout implements AdvancedLayout<StaticXmlWidget,StaticXmlWidget,StaticHtmlMetawidget>
Constructor and Description |
---|
HtmlTableLayout() |
HtmlTableLayout(HtmlTableLayoutConfig config) |
Modifier and Type | Method and Description |
---|---|
void |
endContainerLayout(StaticXmlWidget container,
StaticHtmlMetawidget metawidget)
Finish the given container, using the given Metawidget to access additional services if
needed (such as state saving).
|
protected boolean |
layoutLabel(HtmlTag row,
StaticXmlWidget widgetNeedingLabel,
String elementName,
Map<String,String> attributes,
StaticHtmlMetawidget metawidget) |
void |
layoutWidget(StaticXmlWidget widget,
String elementName,
Map<String,String> attributes,
StaticXmlWidget container,
StaticHtmlMetawidget metawidget)
Layout the given widget within the given container, using the given
elementName and attributes as a guide and the given Metawidget to access
additional services if needed (such as state saving)
|
void |
onEndBuild(StaticHtmlMetawidget metawidget)
Event called at the end of widget building, after all widgets have been built and added to
the
Layout . |
void |
onStartBuild(StaticHtmlMetawidget metawidget)
Event called at the start of the widget building process, before the
WidgetBuilder is called. |
void |
startContainerLayout(StaticXmlWidget container,
StaticHtmlMetawidget metawidget)
Initialise the given container, using the given Metawidget to access additional services if
needed (such as state saving).
|
createLabel, getWidgetId
public HtmlTableLayout()
public HtmlTableLayout(HtmlTableLayoutConfig config)
public void onStartBuild(StaticHtmlMetawidget metawidget)
AdvancedLayout
WidgetBuilder
is called. Layout
s may wish to act on this event to
initialize themselves ready for processing, or to perform 'outermost-container-only'
processing, such as adding facets. This event is only called once per inspection, not once
per widget built.onStartBuild
in interface AdvancedLayout<StaticXmlWidget,StaticXmlWidget,StaticHtmlMetawidget>
metawidget
- the parent Metawidget. Never nullpublic void startContainerLayout(StaticXmlWidget container, StaticHtmlMetawidget metawidget)
AdvancedLayout
startContainerLayout
in interface AdvancedLayout<StaticXmlWidget,StaticXmlWidget,StaticHtmlMetawidget>
container
- the container to layout. This is often the same as the given Metawidgetmetawidget
- the parent Metawidget. Never nullpublic void layoutWidget(StaticXmlWidget widget, String elementName, Map<String,String> attributes, StaticXmlWidget container, StaticHtmlMetawidget metawidget)
Layout
layoutWidget is called immediately after WidgetBuilder.buildWidget and WidgetProcessor.processWidget, and before the next widget is generated. An alternate design would be to 'collect' all widgets generated by buildWidget and processWidget, then iterate over them separately for the layout. If you prefer this approach, you can simulate it by having layoutWidget do nothing but 'remember' each widget, then iterate over them in endContainerLayout (see the AdvancedLayout interface). However not all UI frameworks allow this approach, because they do not suport widgets being instantiated independent of a layout, nor moved between layouts (e.g. SWT)
layoutWidget
in interface Layout<StaticXmlWidget,StaticXmlWidget,StaticHtmlMetawidget>
widget
- the widget to layout. Never nullelementName
- XML node name of the business field. Typically 'entity',
'property' or 'action'. Never nullattributes
- attributes of the widget to layout. Never null. This Map is
modifiable - changes will be passed to subsequent
WidgetProcessors and Layoutscontainer
- the container to add to. This is often the same as the given
Metawidgetmetawidget
- the Metawidget to use to access additional services. Never
nullpublic void endContainerLayout(StaticXmlWidget container, StaticHtmlMetawidget metawidget)
AdvancedLayout
endContainerLayout
in interface AdvancedLayout<StaticXmlWidget,StaticXmlWidget,StaticHtmlMetawidget>
container
- the container to layout. This is often the same as the given Metawidgetmetawidget
- the Metawidget to use to access additional services. Never nullpublic void onEndBuild(StaticHtmlMetawidget metawidget)
AdvancedLayout
Layout
. Layout
s may wish to act on this event to clean
themselves up after processing, or to perform 'outermost-container-only' processing, such as
adding facets. This event is only called once per inspection, not once per widget built.onEndBuild
in interface AdvancedLayout<StaticXmlWidget,StaticXmlWidget,StaticHtmlMetawidget>
metawidget
- the parent Metawidget. Never nullprotected boolean layoutLabel(HtmlTag row, StaticXmlWidget widgetNeedingLabel, String elementName, Map<String,String> attributes, StaticHtmlMetawidget metawidget)
layoutLabel
in class HtmlLayout
elementName
- can be useful if the Layout needs to call a WidgetProcessorCopyright © 2015. All Rights Reserved.