@Override public int compareTo(TablePropertyDefinition to) { return displayName.compareTo(to.getDisplayName()); }
public String getTitle() { return getProperty().getDisplayName(); }
public String getTitle() { return getProperty().getDisplayName(); }
/** * @return List of {@link SelectItem} that represents all properties that * can be added to bean. */ public List<SelectItem> getPropertiesThatCanBeAdded() { List<SelectItem> propertyNames = new ArrayList<SelectItem>(); for (String propName : possibleToAddProps) { propertyNames.add(new SelectItem(propName, getPropByName(propName).getDisplayName())); } return propertyNames; }
/** * @return List of {@link SelectItem} that represents all properties that * can be added to bean. */ public List<SelectItem> getPropertiesThatCanBeAdded() { List<SelectItem> propertyNames = new ArrayList<SelectItem>(); for (String propName : possibleToAddProps) { propertyNames.add(new SelectItem(propName, getPropByName(propName).getDisplayName())); } return propertyNames; }
/** * @return List of {@link SelectItem} that represents all properties that * can be added to bean. */ public List<SelectItem> getPropertiesThatCanBeAdded() { List<SelectItem> propertyNames = new ArrayList<SelectItem>(); for (String propName : possibleToAddProps) { propertyNames.add(new SelectItem(propName, getPropByName(propName).getDisplayName())); } return propertyNames; }
/** * Gets the name of the property by the given display name * * @param displayName * @return name */ public static String getPropertyName(String displayName) { for (TablePropertyDefinition propDefinition : DefaultPropertyDefinitions.getDefaultDefinitions()) { if (propDefinition.getDisplayName().equals(displayName)) { return propDefinition.getName(); } } return null; }
/** * Gets the display name of the property by the given name * * @param name * @return diplayName */ public static String getPropertyDisplayName(String name) { for (TablePropertyDefinition propDefinition : DefaultPropertyDefinitions.getDefaultDefinitions()) { if (propDefinition.getName().equals(name)) { return propDefinition.getDisplayName(); } } return null; }
public List<SelectItem> getPropertyList() { List<SelectItem> propertyNames = new ArrayList<SelectItem>(); TablePropertyDefinition[] propDefinitions = TablePropertyDefinitionUtils .getDefaultDefinitionsForTable(TABLE_TYPE, InheritanceLevel.TABLE, true); SelectItem selectItem = new SelectItem(""); selectItem.setLabel(""); propertyNames.add(selectItem); Map<String, List<TablePropertyDefinition>> propGroups = TablePropertyDefinitionUtils .groupProperties(propDefinitions); for (Map.Entry<String, List<TablePropertyDefinition>> entry : propGroups.entrySet()) { List<SelectItem> items = new ArrayList<SelectItem>(); for (TablePropertyDefinition propDefinition : entry.getValue()) { String propName = propDefinition.getName(); if (propDefinition.getDeprecation() == null) { items.add(new SelectItem(propName, propDefinition.getDisplayName())); } } if (!items.isEmpty()) { SelectItemGroup itemGroup = new SelectItemGroup(entry.getKey()); itemGroup.setSelectItems(items.toArray(new SelectItem[items.size()])); propertyNames.add(itemGroup); } } return propertyNames; }
public List<SelectItem> getPropertyList() { List<SelectItem> propertyNames = new ArrayList<SelectItem>(); TablePropertyDefinition[] propDefinitions = TablePropertyDefinitionUtils .getDefaultDefinitionsForTable(TABLE_TYPE, InheritanceLevel.TABLE, true); SelectItem selectItem = new SelectItem(""); selectItem.setLabel(""); propertyNames.add(selectItem); Map<String, List<TablePropertyDefinition>> propGroups = TablePropertyDefinitionUtils .groupProperties(propDefinitions); for (Map.Entry<String, List<TablePropertyDefinition>> entry : propGroups.entrySet()) { List<SelectItem> items = new ArrayList<SelectItem>(); for (TablePropertyDefinition propDefinition : entry.getValue()) { String propName = propDefinition.getName(); if (propDefinition.getDeprecation() == null) { items.add(new SelectItem(propName, propDefinition.getDisplayName())); } } if (!items.isEmpty()) { SelectItemGroup itemGroup = new SelectItemGroup(entry.getKey()); itemGroup.setSelectItems(items.toArray(new SelectItem[items.size()])); propertyNames.add(itemGroup); } } return propertyNames; }
&& !"version".equals(propName) && propDefinition.getDeprecation() == null) { items.add(new SelectItem(propName, propDefinition.getDisplayName()));
/** * 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); }
/** * 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); }
/** * 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); }
public TableProperty(TablePropertyDefinition propDefinition) { this.name = propDefinition.getName(); this.displayName = propDefinition.getDisplayName(); this.type = propDefinition.getType() == null ? String.class : propDefinition.getType().getInstanceClass(); this.group = propDefinition.getGroup(); this.format = propDefinition.getFormat(); this.deprecation = propDefinition.getDeprecation(); this.constraints = propDefinition.getConstraints(); this.description = propDefinition.getDescription(); this.system = propDefinition.isSystem(); this.dimensional = propDefinition.isDimensional(); }
public TableProperty(TablePropertyDefinition propDefinition) { this.name = propDefinition.getName(); this.displayName = propDefinition.getDisplayName(); this.type = propDefinition.getType() == null ? String.class : propDefinition.getType().getInstanceClass(); this.group = propDefinition.getGroup(); this.format = propDefinition.getFormat(); this.deprecation = propDefinition.getDeprecation(); this.constraints = propDefinition.getConstraints(); this.description = propDefinition.getDescription(); this.system = propDefinition.isSystem(); this.dimensional = propDefinition.isDimensional(); }
String displayName = propDefinition.getDisplayName(); String format = propDefinition.getFormat();
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); }