@Override public void onStartBuild(StaticMetawidget metawidget) { metawidget.putClientProperty(UnsearchableWidgetProcessor.class, 0); }
protected void startBuild() { getChildren().clear(); }
@Override protected String getDefaultConfiguration() { return StaticMetawidget.this.getDefaultConfiguration(); }
/** * Useful for WidgetBuilders to setup nested Metawidgets (eg. for wrapping them in a * panelGroup). */ public void initNestedMetawidget( StaticMetawidget nestedMetawidget, Map<String, String> attributes ) { // Don't reconfigure... nestedMetawidget.setConfig( null ); // ...instead, copy runtime values mPipeline.initNestedPipeline( nestedMetawidget.mPipeline, attributes ); if ( nestedMetawidget.getPath() == null ) { nestedMetawidget.setPath( mPath + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + attributes.get( NAME ) ); } }
@Override protected State getState( StaticWidget containerTag, StaticMetawidget metawidgetTag ) { State state = (State) metawidgetTag.getClientProperty( getClass() ); if ( state == null ) { state = new State(); metawidgetTag.putClientProperty( getClass(), state ); } return state; }
@Override protected void buildCompoundWidget( Element element ) throws Exception { StaticMetawidget.this.beforeBuildCompoundWidget( element ); super.buildCompoundWidget( element ); }
@Override protected StaticMetawidget buildNestedMetawidget( final Map<String, String> attributes ) throws Exception { StaticMetawidget metawidgetTag = StaticMetawidget.this.getClass().newInstance(); StaticMetawidget.this.initNestedMetawidget( metawidgetTag, attributes ); return metawidgetTag; }
public StaticMetawidget() { mPipeline = newPipeline(); }
/** * Write the Metawidget output using the given Writer. * * @param initialIndent * the initialIndent that will be applied to every line. 0 for no initial indent. -1 * for no subsequent indenting either */ public void write( Writer writer, int initialIndent ) { try { mPipeline.buildWidgets( inspect() ); Writer writerToUse = writer; if ( initialIndent >= 0 ) { writerToUse = new IndentedWriter( writer, initialIndent ); } super.write( writerToUse ); } catch ( Exception e ) { throw MetawidgetException.newException( e ); } }
@Override protected State getState( StaticWidget containerTag, StaticMetawidget metawidgetTag ) { State state = (State) metawidgetTag.getClientProperty( getClass() ); if ( state == null ) { state = new State(); metawidgetTag.putClientProperty( getClass(), state ); } return state; }
/** * Useful for WidgetBuilders to setup nested Metawidgets (eg. for wrapping them in a * panelGroup). */ public void initNestedMetawidget( StaticMetawidget nestedMetawidget, Map<String, String> attributes ) { // Don't reconfigure... nestedMetawidget.setConfig( null ); // ...instead, copy runtime values mPipeline.initNestedPipeline( nestedMetawidget.mPipeline, attributes ); if ( nestedMetawidget.getPath() == null ) { nestedMetawidget.setPath( mPath + StringUtils.SEPARATOR_FORWARD_SLASH_CHAR + attributes.get( NAME ) ); } }
@Override protected void buildCompoundWidget( Element element ) throws Exception { StaticMetawidget.this.beforeBuildCompoundWidget( element ); super.buildCompoundWidget( element ); }
@Override protected StaticMetawidget buildNestedMetawidget( final Map<String, String> attributes ) throws Exception { StaticMetawidget metawidgetTag = StaticMetawidget.this.getClass().newInstance(); StaticMetawidget.this.initNestedMetawidget( metawidgetTag, attributes ); return metawidgetTag; }
public StaticMetawidget() { mPipeline = newPipeline(); }
/** * Write the Metawidget output using the given Writer. * * @param initialIndent * the initialIndent that will be applied to every line. 0 for no initial indent. -1 * for no subsequent indenting either */ public void write( Writer writer, int initialIndent ) { try { mPipeline.buildWidgets( inspect() ); Writer writerToUse = writer; if ( initialIndent >= 0 ) { writerToUse = new IndentedWriter( writer, initialIndent ); } super.write( writerToUse ); } catch ( Exception e ) { throw MetawidgetException.newException( e ); } }
@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 void onStartBuild(StaticMetawidget metawidget) { metawidget.putClientProperty(UnsearchableWidgetProcessor.class, 0); }
@Override protected String getDefaultConfiguration() { return StaticMetawidget.this.getDefaultConfiguration(); }
protected void startBuild() { getChildren().clear(); }
@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; }