Java 类net.sf.jasperreports.engine.design.JRDesignPropertyExpression 实例源码

项目:PDFReporter-Studio    文件:JRPropertyExpressionPage.java   
@Override
public void dispose() {
    // clear all properties
    List<PropertyDTO> props = (List<PropertyDTO>) tableViewer.getInput();
    List<JRPropertyExpression> pexpr = new ArrayList<JRPropertyExpression>();
    for (String str : value.getPropMap().getPropertyNames())
        value.getPropMap().removeProperty(str);
    value.setPropExpressions(null);
    for (PropertyDTO p : props) {
        if (p.getValue() instanceof JRExpression) {
            JRDesignPropertyExpression jrpexp = new JRDesignPropertyExpression();
            jrpexp.setName(p.getProperty());
            jrpexp.setValueExpression((JRExpression) p.getValue());
            pexpr.add(jrpexp);
        } else if (p.getValue() instanceof String) {
            value.getPropMap().setProperty(p.getProperty(), (String) p.getValue());
        }
    }
    if (pexpr != null && !pexpr.isEmpty())
        value.setPropExpressions(pexpr.toArray(new JRPropertyExpression[pexpr.size()]));
    super.dispose();
}
项目:ireport-fork    文件:ColumnPropertyExpressionsProperty.java   
/**
 * replace the expression properties in element with the ones found in newExpressionProperties.
 */
public static void replaceExpressionProperties(StandardBaseColumn column, List<GenericProperty> newExpressionProperties)
{
    // Update names.

    List usedProps = new ArrayList();
    List propertyExpressions = column.getPropertyExpressionsList();

    for(int i = 0; i < propertyExpressions.size(); i++)
    {
        column.removePropertyExpression((JRPropertyExpression)propertyExpressions.get(i));
    }

    if (newExpressionProperties == null) return;
    for(GenericProperty prop : newExpressionProperties)
    {
        if (!prop.isUseExpression()) continue;
        JRDesignPropertyExpression newProp = new JRDesignPropertyExpression();
        newProp.setName(prop.getKey());
        newProp.setValueExpression(prop.getExpression());
        column.addPropertyExpression(newProp);
    }

}
项目:ireport-fork    文件:ModelUtils.java   
/**
     * replace the expression properties in element with the ones found in newExpressionProperties.
     */
    public static void replaceExpressionProperties(JRDesignElement element, List<GenericProperty> newExpressionProperties)
    {
        // Update names.

        List usedProps = new ArrayList();
//        List propertyExpressions = element.getPropertyExpressionsList();

        while(element.getPropertyExpressionsList().size() > 0)
        {
            element.removePropertyExpression((JRPropertyExpression)element.getPropertyExpressionsList().get(0));
        }

        if (newExpressionProperties == null) return;
        for(GenericProperty prop : newExpressionProperties)
        {
            if (!prop.isUseExpression()) continue;
            JRDesignPropertyExpression newProp = new JRDesignPropertyExpression();
            newProp.setName(prop.getKey());
            newProp.setValueExpression(prop.getExpression());
            element.addPropertyExpression(newProp);
        }

    }
项目:jasperreports    文件:JRPropertyExpressionFactory.java   
@Override
public Object createObject(Attributes attrs) throws Exception
{
    JRDesignPropertyExpression propertyExpression = new JRDesignPropertyExpression();

    String name = attrs.getValue(JRXmlConstants.ATTRIBUTE_name);
    propertyExpression.setName(name);

    return propertyExpression;
}
项目:jasperreports    文件:JRFillElement.java   
protected void addDynamicProperty(String name, JRExpression expression)
{
    JRDesignPropertyExpression prop = new JRDesignPropertyExpression();
    prop.setName(name);
    prop.setValueExpression(expression);

    propertyExpressions.add(prop);
    // recomputing
    dynamicTransferProperties = findDynamicTransferProperties();
}
项目:ireport-fork    文件:GenericProperty.java   
public JRDesignPropertyExpression toPropertyExpression()
{
    JRDesignPropertyExpression pp = new JRDesignPropertyExpression();
    pp.setName(key);
    pp.setValueExpression(getExpression());
    return pp;
}
项目:dynamicreports-jasper    文件:AbstractExpressionTransform.java   
protected JRPropertyExpression getPropertyExpression(DRIDesignPropertyExpression propertyExpression) {
    JRDesignPropertyExpression jrPropertyExpression = new JRDesignPropertyExpression();
    jrPropertyExpression.setName(propertyExpression.getName());
    jrPropertyExpression.setValueExpression(getExpression(propertyExpression.getValueExpression()));
    return jrPropertyExpression;
}