private void fillTable(Table table) { List<PropertyDTO> props = new ArrayList<PropertyDTO>(); String[] names = value.getPropertyNames(); for (int i = 0; i < names.length; i++) { PropertyDTO p = new PropertyDTO(); p.setProperty(names[i]); p.setValue(value.getProperty(names[i])); props.add(p); } tableViewer.setInput(props); }
protected void exportProperties(JRPropertiesHolder propertiesHolder) throws IOException { if (propertiesHolder.hasProperties()) { JRPropertiesMap propertiesMap = propertiesHolder.getPropertiesMap(); String[] propertyNames = propertiesMap.getPropertyNames(); if (propertyNames != null && propertyNames.length > 0) { for (int i = 0; i < propertyNames.length; i++) { xmlWriter.startElement(JRXmlConstants.ELEMENT_property); xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_name, propertyNames[i]); String value = propertiesMap.getProperty(propertyNames[i]); if (value != null) { xmlWriter.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_value, value); } xmlWriter.closeElement(); } } } }
public Object getValue() throws IllegalAccessException, InvocationTargetException { JRPropertiesMap map = element.getPropertiesMap(); List properties = new ArrayList(); String[] names = map.getPropertyNames(); for (int i = 0; i < names.length; ++i) { properties.add(new GenericProperty(names[i], map.getProperty(names[i]))); } // add to the list the expression properties... JRPropertyExpression[] expProperties = element.getPropertyExpressions(); for (int i = 0; expProperties != null && i < expProperties.length; ++i) { properties.add( new GenericProperty( expProperties[i].getName(), (JRDesignExpression) expProperties[i].getValueExpression())); } return properties; }