String format = propDefinition.getFormat(); TableProperty tableProperty = new TableProperty.TablePropertyBuilder(name, propertyType).value( propertyValue).displayName(displayName).format(format).build();
private void initProperties() { List<TableProperty> definedProperties = new ArrayList<TableProperty>(); ITableProperties tableProperties = table.getProperties(); for (String possiblePropertyName : propertiesManager.getPossibleToAddProperties()) { TablePropertyDefinition propDefinition = TablePropertyDefinitionUtils.getPropertyByName(possiblePropertyName); if (propDefinition != null && !propDefinition.isSystem() && propDefinition.getDeprecation() == null) { Object propertyValue = tableProperties.getPropertyValue(possiblePropertyName) != null ? tableProperties.getPropertyValue(possiblePropertyName) : null; if (tableProperties.getTableProperties().containsKey(possiblePropertyName)) { Class<?> propertyType = null; if (propDefinition.getType() != null) { propertyType = propDefinition.getType().getInstanceClass(); } String displayName = propDefinition.getDisplayName(); String format = propDefinition.getFormat(); boolean dimensional = propDefinition.isDimensional(); TableProperty tableProperty = new TableProperty.TablePropertyBuilder(possiblePropertyName, propertyType).value( propertyValue).displayName(displayName).format(format).dimensional(dimensional).build(); definedProperties.add(tableProperty); } } } propertiesManager.setProperties(definedProperties); }
private void initProperties() { List<TableProperty> definedProperties = new ArrayList<TableProperty>(); ITableProperties tableProperties = table.getProperties(); for (String possiblePropertyName : propertiesManager.getPossibleToAddProperties()) { TablePropertyDefinition propDefinition = TablePropertyDefinitionUtils.getPropertyByName(possiblePropertyName); if (propDefinition != null && !propDefinition.isSystem() && propDefinition.getDeprecation() == null) { Object propertyValue = tableProperties.getPropertyValue(possiblePropertyName) != null ? tableProperties.getPropertyValue(possiblePropertyName) : null; if (tableProperties.getTableProperties().containsKey(possiblePropertyName)) { Class<?> propertyType = null; if (propDefinition.getType() != null) { propertyType = propDefinition.getType().getInstanceClass(); } String displayName = propDefinition.getDisplayName(); String format = propDefinition.getFormat(); boolean dimensional = propDefinition.isDimensional(); TableProperty tableProperty = new TableProperty.TablePropertyBuilder(possiblePropertyName, propertyType).value( propertyValue).displayName(displayName).format(format).dimensional(dimensional).build(); definedProperties.add(tableProperty); } } } propertiesManager.setProperties(definedProperties); }
/** * During the construction, we take all the properties from DefaultPropertyDefinitions * that must be included in business search */ public BussinesSearchPropertyBean() { TablePropertyDefinition[] propDefinitions = DefaultPropertyDefinitions.getDefaultDefinitions(); for (TablePropertyDefinition propDefinition : propDefinitions) { if(propDefinition.isBusinessSearch()) { Class<?> propertyType = propDefinition.getType() == null ? null : propDefinition.getType() .getInstanceClass(); propForSearch.add( new TableProperty.TablePropertyBuilder(propDefinition.getName(), propertyType) .displayName(propDefinition.getDisplayName()).group(propDefinition.getGroup()) .format(propDefinition.getFormat()).constraints(propDefinition.getConstraints()) .build()); } } //busSearchResBean = new BussinessSearchResultBean(propForSearch); }
/** * Action that can be use on form. "propNameToAdd" must be specified. */ public void addProperty() { TablePropertyDefinition propDefinition = getPropByName(propNameToAdd); Class<?> propType = propDefinition.getType() == null ? String.class : propDefinition.getType() .getInstanceClass(); properties .add(new TableProperty.TablePropertyBuilder(propDefinition.getName(), propType) .displayName(propDefinition.getDisplayName()).format(propDefinition.getFormat()).build()); possibleToAddProps.remove(propNameToAdd); }
private void checkVersionPropertyExistance(){ TableProperty versionProperty = super.getVersion(); if(versionProperty == null){ //property "version" is absent in base table versionProperty = new TablePropertyBuilder(VERSION_PROP_NAME, TablePropertyDefinitionUtils.getPropertyTypeByPropertyName(VERSION_PROP_NAME)) .displayName(TablePropertyDefinitionUtils.getPropertyDisplayName(VERSION_PROP_NAME)) .value(INIT_VERSION).build(); getPropertiesManager().addProperty(versionProperty); } }
/** * Action that can be use on form. "propNameToAdd" must be specified. */ public void addProperty() { TablePropertyDefinition propDefinition = getPropByName(propNameToAdd); Class<?> propType = propDefinition.getType() == null ? String.class : propDefinition.getType() .getInstanceClass(); properties .add(new TableProperty.TablePropertyBuilder(propDefinition.getName(), propType) .displayName(propDefinition.getDisplayName()).format(propDefinition.getFormat()).build()); possibleToAddProps.remove(propNameToAdd); }
private void checkPropertiesExistance() { TableProperty versionProperty = super.getVersion(); if (versionProperty == null) { // Property "version" is absent in base table versionProperty = new TablePropertyBuilder(VERSION_PROP_NAME, TablePropertyDefinitionUtils.getPropertyTypeByPropertyName(VERSION_PROP_NAME)) .displayName(TablePropertyDefinitionUtils.getPropertyDisplayName(VERSION_PROP_NAME)) .value(getOriginalVersion().toString()).build(); getPropertiesManager().addProperty(versionProperty); } }
private void checkPropertiesExistance() { TableProperty versionProperty = super.getVersion(); if (versionProperty == null) { // Property "version" is absent in base table versionProperty = new TablePropertyBuilder(VERSION_PROP_NAME, TablePropertyDefinitionUtils.getPropertyTypeByPropertyName(VERSION_PROP_NAME)) .displayName(TablePropertyDefinitionUtils.getPropertyDisplayName(VERSION_PROP_NAME)) .value(getOriginalVersion().toString()).build(); getPropertiesManager().addProperty(versionProperty); } }
/** * Action that can be use on form. "propNameToAdd" must be specified. */ public void addProperty() { TablePropertyDefinition propDefinition = getPropByName(propNameToAdd); Class<?> propType = propDefinition.getType() == null ? String.class : propDefinition.getType() .getInstanceClass(); properties .add(new TableProperty.TablePropertyBuilder(propDefinition.getName(), propType) .displayName(propDefinition.getDisplayName()).format(propDefinition.getFormat()).build()); possibleToAddProps.remove(propNameToAdd); }