throws IOException { if ( getChildren().isEmpty() ) { writeStartTag( writer ); if ( !isSelfClosing() ) { if ( mTagName != null ) { writer.append( ">" ); ( (IndentedWriter) writer ).indent(); writeEndTag( writer ); } else { if ( mTagName != null ) { writeStartTag( writer ); if ( mTagName != null ) { writer.append( ">" ); if ( getTextContent() != null && getTextContent().length() > 0 ) { writer.append( mTextContent ); if ( writer instanceof IndentedWriter ) { writeEndTag( writer );
private void writeStartTag( Writer writer ) throws IOException { if ( mTagName == null ) { return; } writer.append( '<' ); if ( mPrefix != null ) { writer.append( mPrefix ); writer.append( StringUtils.SEPARATOR_COLON_CHAR ); } writer.append( mTagName ); if ( mAttributes != null ) { for ( Map.Entry<String, String> entry : mAttributes.entrySet() ) { writeAttribute( new LeadingSpaceWriter( writer ), entry.getKey(), entry.getValue() ); } } }
/** * Overrriden to enhance the default f:selectItem widget with more suitable item labels */ @Override protected void addSelectItems( HtmlSelectOneMenu select, String valueExpression, Map<String, String> attributes ) { // Empty option // // Note: a 'null' value (rather than an empty String') renders an <f:selectItem/> rather // than an <f:selectItem itemValue=""/>. This works out better if the HtmlSelectOneMenu has // a converter, because the empty String may not be a compatible value if ( WidgetBuilderUtils.needsEmptyLookupItem( attributes ) ) { addSelectItem( select, null, null ); } // Add the select items SelectItems selectItems = new SelectItems(); selectItems.putAttribute("value", valueExpression); // For each item to be displayed, set the label to the reverse primary key value if (attributes.containsKey(REVERSE_PRIMARY_KEY)) { selectItems.putAttribute("var", SELECT_ITEM); selectItems.putAttribute("itemValue", StaticFacesUtils.wrapExpression(SELECT_ITEM)); String displayExpression = "forgeview:display(_item)"; ((BaseStaticXmlWidget) selectItems).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view"); selectItems.putAttribute("itemLabel", StaticFacesUtils.wrapExpression(displayExpression)); } select.getChildren().add( selectItems ); }
/** * Returns true if this widget is self closing (i.e. will be written as <foo/> rather than * <foo></foo>). * * @return true if this widget is self closing. */ protected boolean isSelfClosing() { return getTextContent() == null || getTextContent().length() == 0; }
/** * Overrriden to enhance the default f:selectItem widget with more suitable item labels */ @Override protected void addSelectItems(HtmlSelectOneMenu select, String valueExpression, Map<String, String> attributes) { // Empty option // // Note: a 'null' value (rather than an empty String') renders an <f:selectItem/> rather // than an <f:selectItem itemValue=""/>. This works out better if the HtmlSelectOneMenu has // a converter, because the empty String may not be a compatible value if (WidgetBuilderUtils.needsEmptyLookupItem(attributes)) { addSelectItem(select, null, null); } // Add the select items SelectItems selectItems = new SelectItems(); selectItems.putAttribute("value", valueExpression); // For each item to be displayed, set the label to the reverse primary key value if (attributes.containsKey(REVERSE_PRIMARY_KEY)) { selectItems.putAttribute("var", SELECT_ITEM); selectItems.putAttribute("itemValue", StaticFacesUtils.wrapExpression(SELECT_ITEM)); String displayExpression = "forgeview:display(_item)"; ((BaseStaticXmlWidget) selectItems).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view"); selectItems.putAttribute("itemLabel", StaticFacesUtils.wrapExpression(displayExpression)); } select.getChildren().add(selectItems); }
/** * Returns true if this widget is self closing (i.e. will be written as <foo/> rather than * <foo></foo>). * * @return true if this widget is self closing. */ protected boolean isSelfClosing() { return getTextContent() == null || getTextContent().length() == 0; }
throws IOException { if ( getChildren().isEmpty() ) { writeStartTag( writer ); if ( !isSelfClosing() ) { if ( mTagName != null ) { writer.append( ">" ); ( (IndentedWriter) writer ).indent(); writeEndTag( writer ); } else { if ( mTagName != null ) { writeStartTag( writer ); if ( mTagName != null ) { writer.append( ">" ); if ( getTextContent() != null && getTextContent().length() > 0 ) { writer.append( mTextContent ); if ( writer instanceof IndentedWriter ) { writeEndTag( writer );
+ StringUtils.SEPARATOR_DOT_CHAR + StringUtils.decapitalize(columnAttributes.get(NAME)) + ")"; ((BaseStaticXmlWidget) link).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view"); output.setValue(StaticFacesUtils.wrapExpression(displayExpression));
private void writeStartTag( Writer writer ) throws IOException { if ( mTagName == null ) { return; } writer.append( '<' ); if ( mPrefix != null ) { writer.append( mPrefix ); writer.append( StringUtils.SEPARATOR_COLON_CHAR ); } writer.append( mTagName ); if ( mAttributes != null ) { for ( Map.Entry<String, String> entry : mAttributes.entrySet() ) { writeAttribute( new LeadingSpaceWriter( writer ), entry.getKey(), entry.getValue() ); } } }
+ ")"; valueHolderTable.setValue(StaticFacesUtils.wrapExpression(asListValueExpression)); ((BaseStaticXmlWidget) dataTable).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");
+ ")"; valueHolderTable.setValue(StaticFacesUtils.wrapExpression(asListValueExpression)); ((BaseStaticXmlWidget) dataTable).putAdditionalNamespaceURI("forgeview", "http://jboss.org/forge/view");