Search in sources :

Example 1 with BuilderSerializer

use of com.revolsys.ui.html.serializer.BuilderSerializer in project com.revolsys.open by revolsys.

the class HtmlUiBuilder method newView.

protected void newView(final String name, final List<?> elements) {
    final List<KeySerializer> serializers = new ArrayList<>();
    this.viewSerializers.put(name, serializers);
    for (final Object element : elements) {
        if (element != null) {
            KeySerializer serializer = null;
            if (element instanceof KeySerializer) {
                serializer = (KeySerializer) element;
            } else {
                final String key = element.toString();
                serializer = this.keySerializers.get(key);
                if (serializer == null) {
                    final String title = getLabel(key);
                    serializer = new BuilderSerializer(key, title, this);
                }
            }
            if (serializer instanceof HtmlUiBuilderAware) {
                @SuppressWarnings("unchecked") final HtmlUiBuilderAware<HtmlUiBuilder<?>> builderAware = (HtmlUiBuilderAware<HtmlUiBuilder<?>>) serializer;
                builderAware.setHtmlUiBuilder(this);
            }
            serializers.add(serializer);
        }
    }
}
Also used : BuilderSerializer(com.revolsys.ui.html.serializer.BuilderSerializer) ArrayList(java.util.ArrayList) KeySerializer(com.revolsys.ui.html.serializer.key.KeySerializer)

Aggregations

BuilderSerializer (com.revolsys.ui.html.serializer.BuilderSerializer)1 KeySerializer (com.revolsys.ui.html.serializer.key.KeySerializer)1 ArrayList (java.util.ArrayList)1