public void addParameterToTable(ToolParameterDescriptor param, int index) { try { operator.getToolParameterDescriptors().add(index, param); PropertyDescriptor propertyDescriptor = ParameterDescriptorFactory.convert(param, new ParameterDescriptorFactory().getSourceProductMap()); propertyDescriptor.setDefaultValue(param.getDefaultValue()); DefaultPropertySetDescriptor propertySetDescriptor = new DefaultPropertySetDescriptor(); propertySetDescriptor.addPropertyDescriptor(propertyDescriptor); PropertyContainer container = PropertyContainer.createMapBacked(new HashMap<>(), propertySetDescriptor); context.getPropertySet().addProperties(container.getProperties()); createDefaultComponent(param, propertyDescriptor); fireTableRowsChanged(); } catch (Exception ex){ logger.warning(ex.getMessage()); } }
Object dirAttr = null; if(oldProp != null) { PropertyDescriptor descriptor = ParameterDescriptorFactory.convert(property, new ParameterDescriptorFactory().getSourceProductMap()); dirAttr = descriptor.getAttribute("directory"); context.getPropertySet().removeProperty(oldProp); descriptor = ParameterDescriptorFactory.convert(property, new ParameterDescriptorFactory().getSourceProductMap()); } catch (Exception ex) { property.setDefaultValue(null); descriptor = ParameterDescriptorFactory.convert(property, new ParameterDescriptorFactory().getSourceProductMap());
propertyDescriptor = ParameterDescriptorFactory.convert(descriptor, new ParameterDescriptorFactory().getSourceProductMap()); } catch (ConversionException ex) { logger.warning(ex.getMessage());
propertySet.removeProperty(property); PropertyDescriptor propertyDescriptor = ParameterDescriptorFactory.convert(this.parameter, new ParameterDescriptorFactory().getSourceProductMap());
PropertyDescriptor propertyDescriptor = ParameterDescriptorFactory.convert(descriptor, new ParameterDescriptorFactory().getSourceProductMap()); if (defaultValue != null) { String defaultValueAsString = ToolParameterEditorDialog.processDefaultValue(defaultValue);
PropertyDescriptor propertyDescriptor = ParameterDescriptorFactory.convert(this.modifiedParameter, new ParameterDescriptorFactory().getSourceProductMap()); DefaultPropertySetDescriptor propertySetDescriptor = new DefaultPropertySetDescriptor(); propertySetDescriptor.addPropertyDescriptor(propertyDescriptor);