public Composite startBuildWidget( String elementName, Map<String, String> attributes, Composite container, SwtMetawidget metawidget ) { String section = stripSection( attributes ); State<Composite> state = getState( container, metawidget ); // Stay where we are? if ( section == null || section.equals( state.getCurrentSection() ) ) { if ( state.getCurrentSectionWidget() == null ) { return delegateStartBuildWidget( elementName, attributes, container, metawidget ); } return delegateStartBuildWidget( elementName, attributes, state.getCurrentSectionWidget(), metawidget ); } state.setCurrentSection( section ); Composite previousSectionWidget = state.getCurrentSectionWidget(); // End current section if ( state.getCurrentSectionWidget() != null ) { super.endContainerLayout( state.getCurrentSectionWidget(), metawidget ); } state.setCurrentSectionWidget( null ); // No new section? if ( "".equals( section ) ) { return delegateStartBuildWidget( elementName, attributes, container, metawidget ); } state.setCurrentSectionWidget( createSectionWidget( previousSectionWidget, section, attributes, container, metawidget )); super.startContainerLayout( state.getCurrentSectionWidget(), metawidget ); return delegateStartBuildWidget( elementName, attributes, state.getCurrentSectionWidget(), metawidget ); }
state.setCurrentSection( section ); state.setCurrentSectionWidget( null );
state.setCurrentSection( section ); state.setCurrentSectionWidget( null );
@Override public void endContainerLayout( C container, M metawidget ) { // End hanging layouts State<C> state = getState( container, metawidget ); if ( state.getCurrentSectionWidget()!= null ) { super.endContainerLayout( state.getCurrentSectionWidget(), metawidget ); } super.endContainerLayout( container, metawidget ); state.setCurrentSection( null ); state.setCurrentSectionWidget( null ); }
@Override public void startContainerLayout( C container, M metawidget ) { super.startContainerLayout( container, metawidget ); State<C> state = getState( container, metawidget ); state.setCurrentSection( null ); state.setCurrentSectionWidget( null ); }
@Override public void endContainerLayout( C container, M metawidget ) { // End hanging layouts State<C> state = getState( container, metawidget ); if ( state.getCurrentSectionWidget()!= null ) { super.endContainerLayout( state.getCurrentSectionWidget(), metawidget ); } super.endContainerLayout( container, metawidget ); state.setCurrentSection( null ); state.setCurrentSectionWidget( null ); }
@Override public void startContainerLayout( C container, M metawidget ) { super.startContainerLayout( container, metawidget ); State<C> state = getState( container, metawidget ); state.setCurrentSection( null ); state.setCurrentSectionWidget( null ); }
@Override public void startContainerLayout( BodyTag container, MetawidgetTag metawidget ) { // Suppress super.startContainerLayout( container, metawidget ), because we want <fieldset> // to come before <table> or <div> State<BodyTag> state = getState( container, metawidget ); state.setCurrentSection( null ); state.setCurrentSectionWidget( null ); }