private PropertySet createPropertySet(AggregatorConfig config) { return PropertyContainer.createMapBacked(new HashMap<>(), config.getClass(), new ParameterDescriptorFactory()); }
private static PropertyContainer createParameterMap(Map<String, Object> map) { ParameterDescriptorFactory parameterDescriptorFactory = new ParameterDescriptorFactory(); final PropertyContainer container = PropertyContainer.createMapBacked(map, PixExOp.class, parameterDescriptorFactory); container.setDefaultValues(); return container; }
protected void initializeOperatorUI(final String operatorName, final Map<String, Object> parameterMap) { this.operatorName = operatorName; this.paramMap = parameterMap; final OperatorSpi operatorSpi = GPF.getDefaultInstance().getOperatorSpiRegistry().getOperatorSpi(operatorName); if (operatorSpi == null) { throw new IllegalArgumentException("operator " + operatorName + " not found"); } final ParameterDescriptorFactory descriptorFactory = new ParameterDescriptorFactory(); final OperatorDescriptor operatorDescriptor = operatorSpi.getOperatorDescriptor(); final PropertySetDescriptor propertySetDescriptor; try { propertySetDescriptor = PropertySetDescriptorFactory.createForOperator(operatorDescriptor, descriptorFactory.getSourceProductMap()); } catch (ConversionException e) { throw new IllegalStateException("Not able to init OperatorParameterSupport.", e); } propertySet = PropertyContainer.createMapBacked(paramMap, propertySetDescriptor); if (paramMap.isEmpty()) { try { propertySet.setDefaultValues(); } catch (IllegalStateException e) { // todo - handle exception here e.printStackTrace(); } } }
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());
private BindingContext createBindingContext() { final PropertyContainer container = PropertyContainer.createObjectBacked(variableItem.variableConfig, new ParameterDescriptorFactory()); final BindingContext context = new BindingContext(container); PropertyDescriptor descriptor = container.getDescriptor(PROPERTY_VARIABLE_NAME); descriptor.setDescription("The name for the source band."); descriptor.setValidator(new VariableNameValidator()); container.setDefaultValues(); return context; }
Assert.argument(parameterMap != null || propertySet == null, "parameterMap != null || propertySet == null"); this.descriptorFactory = new ParameterDescriptorFactory();
public MetadataPlotSettings() { context = new BindingContext(PropertyContainer.createObjectBacked(this, new ParameterDescriptorFactory())); Property propertyRecordStart = context.getPropertySet().getProperty(PROP_NAME_RECORD_START_INDEX); propertyRecordStart.getDescriptor().setAttribute("stepSize", 1);
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());
if (operatorSpi == null) return; final ParameterDescriptorFactory parameterDescriptorFactory = new ParameterDescriptorFactory(); final PropertyContainer valueContainer = PropertyContainer.createMapBacked(parameterMap, operatorSpi.getOperatorClass(), parameterDescriptorFactory);
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);