.setAttributeExpression( AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, bshExpression ); imageElement.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.IMAGE_ENCODING_QUALITY, "9" ); imageElement.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.IMAGE_ENCODING_TYPE, "PNG" );
final AttributeExpressionReadHandler handler = attributeExpressions.get( i ); final Expression expression = handler.getExpression(); element.setAttributeExpression( handler.getNamespace(), handler.getName(), expression );
public void testGetAttributeExpressions() { Expression expression = mock( Expression.class ); Element elem = new Element(); elem.setAttributeExpression( "namespace", "test_name", expression ); assertNotNull( elem.getAttributeExpressions() ); assertEquals( expression, elem.getAttributeExpressions().getAttribute( "namespace", "test_name" ) ); }
continue; target.setAttributeExpression( namespace, name, getAttributeExpression( namespace, name ) );
/** * Creates the text field element. * * @return the generated text field element * @see org.pentaho.reporting.engine.classic.core.elementfactory.ElementFactory#createElement() */ public Element createElement() { final Element element = new Element(); applyElementName( element ); applyStyle( element.getStyle() ); element.setElementType( new TextFieldType() ); if ( getFieldname() != null ) { element.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, getFieldname() ); } if ( getFormula() != null ) { final FormulaExpression formulaExpression = new FormulaExpression(); formulaExpression.setFormula( getFormula() ); element.setAttributeExpression( AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression ); } element.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.NULL_VALUE, getNullString() ); return element; }
final FormulaExpression formulaExpression = new FormulaExpression(); formulaExpression.setFormula( getFormula() ); element.setAttributeExpression( AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression );
private Element createFieldItem( final String fieldName, final Class aggregationType, final Color background ) { final ElementType targetType; if ( dataSchemaModel != null ) { final DataAttributeContext context = dataSchemaModel.getDataAttributeContext(); final DataAttributes attributes = dataSchemaModel.getDataSchema().getAttributes( fieldName ); targetType = AutoGeneratorUtility.createFieldType( attributes, context ); } else { targetType = TextFieldType.INSTANCE; } final Element element = new Element(); element.setAttributeExpression( "test-run", "test-value", new CopyValueAsTextExpression( fieldName ) ); element.setElementType( targetType ); element.getElementType().configureDesignTimeDefaults( element, Locale.getDefault() ); element.getStyle().setStyleProperty( ElementStyleKeys.BACKGROUND_COLOR, background ); if ( targetType instanceof NumberFieldType ) { element.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.FORMAT_STRING, "0.00;-0.00" ); } element.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, fieldName ); element.getStyle().setStyleProperty( ElementStyleKeys.MIN_WIDTH, 80f ); element.getStyle().setStyleProperty( ElementStyleKeys.MIN_HEIGHT, 20f ); element.setAttribute( AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.AGGREGATION_TYPE, aggregationType ); element.setAttribute( AttributeNames.Wizard.NAMESPACE, AttributeNames.Wizard.ALLOW_METADATA_STYLING, Boolean.FALSE ); return element; }
final FormulaExpression formulaExpression = new FormulaExpression(); formulaExpression.setFormula( getFormula() ); element.setAttributeExpression( AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression );
final FormulaExpression formulaExpression = new FormulaExpression(); formulaExpression.setFormula( getFormula() ); element.setAttributeExpression( AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression );