/** * Checks if properties were deprecated. */ private static void checkForDeprecation(IBindingContext bindingContext, Set<String> propertyNamesToCheck, TableSyntaxNode tableSyntaxNode) { for (String propertyNameToCheck : propertyNamesToCheck) { TablePropertyDefinition propertyDefinition = TablePropertyDefinitionUtils.getPropertyByName(propertyNameToCheck); if (propertyDefinition != null && propertyDefinition.getDeprecation() != null && !propertyDefinition.getDeprecation().isEmpty()) { String message = String.format("Property '%s' was deprecated. Please remove it!", propertyNameToCheck); bindingContext.addMessage(OpenLMessagesUtils.newWarnMessage(message, tableSyntaxNode)); } } }
private void initProperties() { TablePropertyDefinition[] propDefinitions = DefaultPropertyDefinitions.getDefaultDefinitions(); for (TablePropertyDefinition propDefinition : propDefinitions) { if (propDefinition.getDeprecation() == null) { TableProperty prop = new TableProperty(propDefinition); properties.add(prop); } } }
private void initProperties() { TablePropertyDefinition[] propDefinitions = DefaultPropertyDefinitions.getDefaultDefinitions(); for (TablePropertyDefinition propDefinition : propDefinitions) { if (propDefinition.getDeprecation() == null) { TableProperty prop = new TableProperty(propDefinition); properties.add(prop); } } }
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; }
if (!currentProps.contains(propName) && !"version".equals(propName) && propDefinition.getDeprecation() == null) { items.add(new SelectItem(propName, propDefinition.getDisplayName()));
if (!currentProps.contains(propName) && !"version".equals(propName) && propDefinition.getDeprecation() == null) { items.add(new SelectItem(propName, propDefinition.getDisplayName()));
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(); }
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); }