@Override public void initNestedMetawidget( StaticMetawidget nestedMetawidget, Map<String, String> attributes ) { super.initNestedMetawidget( nestedMetawidget, attributes ); if ( ( (StaticHtmlMetawidget) nestedMetawidget ).getId() == null ) { String nestedId = attributes.get( NAME ); if ( getId() != null ) { nestedId = getId() + '-' + nestedId; } ( (StaticHtmlMetawidget) nestedMetawidget ).setId( nestedId ); } }
/** * Recurse over all children and retrieve the namespaces they use. * * @return map of prefix and namespace */ public Map<String, String> getNamespaces() { Map<String, String> namespaces = CollectionUtils.newHashMap(); populateNamespaces( this, namespaces ); return namespaces; }
public void startContainerLayout( StaticXmlWidget container, StaticXmlMetawidget metawidget ) { try { HtmlPanelGrid panelGrid = new HtmlPanelGrid(); panelGrid.putAttribute( "columns", "3" ); panelGrid.putAttribute( "id", metawidget.getAttribute( "id" ) ); panelGrid.putAttribute( "columnClasses", mColumnStyleClasses ); if ( container instanceof StaticXmlMetawidget ) { panelGrid.putAttribute( "rendered", metawidget.getAttribute( "rendered" ) ); } container.getChildren().add( panelGrid ); } catch ( Exception e ) { throw LayoutException.newException( e ); } }
String inspectedType = metawidget.inspect(null, columnType); String inspectedType = metawidget.inspect(null, componentType); if (tableAttributes.containsKey(INVERSE_RELATIONSHIP) && !metawidget.isReadOnly()) metawidget.initNestedMetawidget(footerMetawidget, footerAttributes); footerFacet.getChildren().add(footerMetawidget); ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class);
if (!attributes.containsKey(N_TO_MANY) || metawidget.isReadOnly()) "target", StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + inverseRelationship)); StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class);
&& metawidget.getParent() != null) if (metawidget.getParent() instanceof HtmlOutcomeTargetLink) StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class); .getWidgetProcessor(StandardBindingProcessor.class); metawidget.initNestedMetawidget(nestedMetawidget, attributes); String unwrappedExpression = StaticFacesUtils.unwrapExpression(nestedMetawidget.getValue()); nestedMetawidget.putAttribute("rendered",
label.putAttribute( "for", id ); String labelText = metawidget.getLabelString( attributes ); label.putAttribute( "value", labelText + StringUtils.SEPARATOR_COLON ); panelGrid.getChildren().add( label ); if ( !( widget instanceof EditableValueHolder ) || metawidget.isReadOnly() || WidgetBuilderUtils.isReadOnly( attributes ) ) { if ( TRUE.equals( attributes.get( REQUIRED ) ) && !WidgetBuilderUtils.isReadOnly( attributes ) && !metawidget.isReadOnly() ) { required.putAttribute( "value", "*" );
metawidget.initNestedMetawidget( columnMetawidget, columnAttributes ); columnMetawidget.setLayout( new SimpleLayout() ); columnMetawidget.setReadOnly( true ); headerText.putAttribute( "value", metawidget.getLabelString( columnAttributes ) ); Facet headerFacet = new Facet(); headerFacet.putAttribute( "name", "header" );
inspectedType = metawidget.inspect( null, componentType );
protected void addColumnHeader( HtmlTable table, Map<String, String> attributes, StaticXmlMetawidget metawidget ) { HtmlTableHeader header = new HtmlTableHeader(); header.setTextContent( metawidget.getLabelString( attributes ) ); table.getChildren().get( 0 ).getChildren().get( 0 ).getChildren().add( header ); }
if ( TRUE.equals( attributes.get( DONT_EXPAND ) ) || metawidget.getLayout() instanceof SimpleLayout ) { return new HtmlOutput();
String inspectedType = metawidget.inspect(null, columnType); String inspectedType = metawidget.inspect(null, componentType); if (tableAttributes.containsKey(INVERSE_RELATIONSHIP) && !metawidget.isReadOnly()) metawidget.initNestedMetawidget(footerMetawidget, footerAttributes); footerFacet.getChildren().add(footerMetawidget); ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class);
if (!attributes.containsKey(N_TO_MANY) || metawidget.isReadOnly()) "target", StaticFacesUtils.wrapExpression(controllerName + "Bean.add." + inverseRelationship)); StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class);
&& metawidget.getParent() != null) if (metawidget.getParent() instanceof HtmlOutcomeTargetLink) link.putAttribute("outcome", getTargetDir() + "/" + controllerName + "/view"); StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class); .getWidgetProcessor(StandardBindingProcessor.class); metawidget.initNestedMetawidget(nestedMetawidget, attributes); String unwrappedExpression = StaticFacesUtils.unwrapExpression(nestedMetawidget.getValue()); nestedMetawidget.putAttribute("rendered",
inspectedType = metawidget.inspect( null, componentType, (String[]) null );
protected void addColumnHeader( HtmlTable table, Map<String, String> attributes, StaticXmlMetawidget metawidget ) { HtmlTableHeader header = new HtmlTableHeader(); String id = attributes.get( NAME ); String tableId = table.getAttribute( "id" ); if ( tableId != null ) { id = tableId + '-' + id; } header.putAttribute( "id", id ); header.setTextContent( metawidget.getLabelString( attributes ) ); table.getChildren().get( 0 ).getChildren().get( 0 ).getChildren().add( header ); }
if ( TRUE.equals( attributes.get( DONT_EXPAND ) ) || metawidget.getLayout() instanceof SimpleLayout ) { return new HtmlOutputText();
StandardBindingProcessor bindingProcessor = metawidget.getWidgetProcessor(StandardBindingProcessor.class); ReadableIdProcessor readableIdProcessor = metawidget.getWidgetProcessor(ReadableIdProcessor.class); if (!TRUE.equals(attributes.get(N_TO_MANY)) || metawidget.isReadOnly())
@Override public void initNestedMetawidget( StaticMetawidget nestedMetawidget, Map<String, String> attributes ) { super.initNestedMetawidget( nestedMetawidget, attributes ); if ( ( (StaticUIMetawidget) nestedMetawidget ).getValue() == null ) { String valueExpression = getValue(); valueExpression = StaticFacesUtils.unwrapExpression( valueExpression ); valueExpression += StringUtils.SEPARATOR_DOT_CHAR + attributes.get( NAME ); valueExpression = StaticFacesUtils.wrapExpression( valueExpression ); ( (StaticUIMetawidget) nestedMetawidget ).setValue( valueExpression ); } } }
/** * Recurse over all children and retrieve the namespaces they use. * * @return map of prefix and namespace */ public Map<String, String> getNamespaces() { Map<String, String> namespaces = CollectionUtils.newHashMap(); populateNamespaces( this, namespaces ); return namespaces; }