public void layoutWidget( StaticWidget widget, String elementName, Map<String, String> attributes, StaticWidget container, StaticMetawidget metawidget ) { // Ignore stubs if ( widget instanceof StaticXmlStub && widget.getChildren().isEmpty() ) { return; } container.getChildren().add( widget ); } }
@Override protected State<StaticWidget> getState( StaticWidget container, StaticMetawidget metawidget ) { @SuppressWarnings( "unchecked" ) State<StaticWidget> state = (State<StaticWidget>) container.getClientProperty( getClass() ); if ( state == null ) { state = new State<StaticWidget>(); container.putClientProperty( getClass(), state ); } return state; }
public void write( Writer writer ) throws IOException { for ( StaticWidget child : mChildren ) { child.write( writer ); } }
@Override public void startContainerLayout( StaticWidget container, StaticMetawidget metawidget ) { super.startContainerLayout( container, metawidget ); container.putClientProperty( getClass(), null ); }
@Override public void startContainerLayout( StaticWidget container, StaticMetawidget metawidget ) { super.startContainerLayout( container, metawidget ); container.putClientProperty( getClass(), null ); }
public void layoutWidget( StaticWidget widget, String elementName, Map<String, String> attributes, StaticWidget container, StaticMetawidget metawidget ) { // Ignore stubs if ( widget instanceof StaticXmlStub && widget.getChildren().isEmpty() ) { return; } container.getChildren().add( widget ); } }
@Override protected State<StaticWidget> getState( StaticWidget container, StaticMetawidget metawidget ) { @SuppressWarnings( "unchecked" ) State<StaticWidget> state = (State<StaticWidget>) container.getClientProperty( getClass() ); if ( state == null ) { state = new State<StaticWidget>(); container.putClientProperty( getClass(), state ); } return state; }
public void write( Writer writer ) throws IOException { for ( StaticWidget child : mChildren ) { child.write( writer ); } }
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 ); }
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 ); }
HtmlTableRow headerRow = (HtmlTableRow) table.getChildren().get( 0 ).getChildren().get( 0 );
@Override public StaticWidget processWidget(StaticWidget widget, String elementName, Map<String, String> attributes, StaticMetawidget metawidget) { Integer widgetsProcessed = metawidget.getClientProperty(UnsearchableWidgetProcessor.class); // Ignore empty stubs if (widget instanceof StaticXmlStub || widget instanceof StaticJavaStub) { if (widget.getChildren().isEmpty()) { return widget; } } // Too many? if (widgetsProcessed == MAXIMUM_SEARCH_FIELDS) { return null; } // Wrong type? if (!isSearchable(attributes)) { return null; } // Pass through metawidget.putClientProperty(UnsearchableWidgetProcessor.class, widgetsProcessed + 1); return widget; }
@Override public StaticWidget processWidget(StaticWidget widget, String elementName, Map<String, String> attributes, StaticMetawidget metawidget) { Integer widgetsProcessed = metawidget.getClientProperty(UnsearchableWidgetProcessor.class); // Ignore empty stubs if (widget instanceof StaticXmlStub || widget instanceof StaticJavaStub) { if (widget.getChildren().isEmpty()) { return widget; } } // Too many? if (widgetsProcessed == MAXIMUM_SEARCH_FIELDS) { return null; } // Wrong type? if (!isSearchable(attributes)) { return null; } // Pass through metawidget.putClientProperty(UnsearchableWidgetProcessor.class, widgetsProcessed + 1); return widget; }
public void layoutWidget( StaticXmlWidget widget, String elementName, Map<String, String> attributes, StaticXmlWidget container, StaticHtmlMetawidget metawidget ) { try { // Ignore stubs if ( widget instanceof StaticXmlStub && widget.getChildren().isEmpty() ) { return; } HtmlTableBody body = (HtmlTableBody) container.getChildren().get( 0 ).getChildren().get( 0 ); HtmlTableRow row = new HtmlTableRow(); // Label layoutLabel( row, widget, elementName, attributes, metawidget ); // Add widget to layout HtmlTableCell cell = new HtmlTableCell(); cell.getChildren().add( widget ); cell.putAttribute( "class", mComponentColumnClass ); row.getChildren().add( cell ); // Indicate whether the field is required or not. HtmlTableCell requiredCell = new HtmlTableCell(); requiredCell.putAttribute( "class", mRequiredColumnClass ); if ( TRUE.equals( attributes.get( REQUIRED ) ) && !WidgetBuilderUtils.isReadOnly( attributes ) && !TRUE.equals( attributes.get( HIDDEN ) ) ) { requiredCell.setTextContent( "*" ); } row.getChildren().add( requiredCell ); body.getChildren().add( row ); } catch ( Exception e ) { throw LayoutException.newException( e ); } }