@Override public IPropertyDescriptor[] getPropertyDescriptors() { ArrayList<IPropertyDescriptor> properties = new ArrayList<IPropertyDescriptor>(); properties.add(new TextPropertyDescriptor(TYPE, "Type")); if (link.getSource() instanceof ModuleOperationNode) { properties.add(new ComboBoxPropertyDescriptor(SINST, "Source Instance Name", getInstances((ModuleTypeNode) link.getSource().getParent()))); } else { properties.add(new TextPropertyDescriptor(SINST, "Source Instance Name")); } if (link.getTarget() instanceof ModuleOperationNode) { properties.add(new ComboBoxPropertyDescriptor(TINST, "Target Instance Name", getInstances((ModuleTypeNode) link.getTarget().getParent()))); } else { properties.add(new TextPropertyDescriptor(TINST, "Target Instance Name")); } if (link.getSource() instanceof TriggerInstanceTerminalNode || link.getTarget() instanceof TriggerInstanceTerminalNode) properties.add(new TextPropertyDescriptor(PERIOD, "Period")); return properties.toArray(new IPropertyDescriptor[0]); }
@Override public IPropertyDescriptor[] getPropertyDescriptors() { ArrayList<IPropertyDescriptor> properties = new ArrayList<IPropertyDescriptor>(); if (node instanceof LogicalSystemNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_ID, "System Id")); } else if (node instanceof LogicalComputingPlatformNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_ID, "Platform Id")); } else if (node instanceof LogicalComputingNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_ID, "Node Id")); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.LOG_SYS_NODE_ENDIAN, "Endianess", ENDIAN_OPTS)); properties.add(new TextPropertyDescriptor(NodeConstants.LOG_SYS_OS_NAME, "OS Name")); properties.add(new TextPropertyDescriptor(NodeConstants.LOG_SYS_OS_VER, "OS Version")); properties.add(new TextPropertyDescriptor(NodeConstants.LOG_SYS_AVAIL_MEM_GB, "Available Memory (GB)")); properties.add(new TextPropertyDescriptor(NodeConstants.LOG_SYS_MOD_SWITCH_TIME, "Switch Time (�s)")); } else if (node instanceof LogicalProcessorsNode) { properties.add(new TextPropertyDescriptor(NodeConstants.LOG_SYS_PROC_NUM, "Number")); properties.add(new TextPropertyDescriptor(NodeConstants.LOG_SYS_PROC_TYPE, "Type")); properties.add(new TextPropertyDescriptor(NodeConstants.LOG_SYS_STEP_DUR, "Step Duration (ns)")); } return properties.toArray(new IPropertyDescriptor[0]); }
@Override public IPropertyDescriptor[] getPropertyDescriptors() { ArrayList<IPropertyDescriptor> properties = new ArrayList<IPropertyDescriptor>(); if (node instanceof CompositeNode) { properties.add(new TextPropertyDescriptor(NodeConstants.COMPOSITE_NAME, "Composite Name")); } else if (node instanceof ComponentNode) { properties.add(new TextPropertyDescriptor(NodeConstants.COMPONENT_NAME, "Component Name")); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.COMPONENT_TYPE, "Component Type", getComponentDefs())); } else if (node instanceof ComponentPropertyNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_PROP, "Property Name")); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.GENERIC_TYPE, "Type", sdtTypes)); properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_VAL, "Property Value")); } else if (node instanceof CompositePropertyNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_PROP, "Property Name")); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.GENERIC_TYPE, "Type", sdtTypes)); properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_VAL, "Property Value")); } else if (node instanceof ServiceNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_NAME, "Name")); properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_INTF, "Definition")); } else if (node instanceof ReferenceNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_NAME, "Name")); properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_INTF, "Definition")); } return properties.toArray(new IPropertyDescriptor[0]); }
public IPropertySheetPage getPropertySheetPage() { if (propertySheetPage == null) { propertySheetPage = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePropertySheetPage(); // add a slightly modified adapter factory that does not return any editors for // properties. this way, a model can never be modified through the properties view. AdapterFactory adapterFactory = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileAdapterFactoryProvider().getAdapterFactory(); propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) { protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) { return new PropertySource(object, itemPropertySource) { protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) { return new PropertyDescriptor(object, itemPropertyDescriptor) { public CellEditor createPropertyEditor(Composite composite) { return null; } }; } }; } }); highlighting.addSelectionChangedListener(propertySheetPage); } return propertySheetPage; }
public IPropertySheetPage getPropertySheetPage() { if (propertySheetPage == null) { propertySheetPage = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPropertySheetPage(); // add a slightly modified adapter factory that does not return any editors for // properties. this way, a model can never be modified through the properties view. AdapterFactory adapterFactory = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionAdapterFactoryProvider().getAdapterFactory(); propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) { protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) { return new PropertySource(object, itemPropertySource) { protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) { return new PropertyDescriptor(object, itemPropertyDescriptor) { public CellEditor createPropertyEditor(Composite composite) { return null; } }; } }; } }); highlighting.addSelectionChangedListener(propertySheetPage); } return propertySheetPage; }
public IPropertySheetPage getPropertySheetPage() { if (propertySheetPage == null) { propertySheetPage = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPropertySheetPage(); // add a slightly modified adapter factory that does not return any editors for // properties. this way, a model can never be modified through the properties view. AdapterFactory adapterFactory = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaAdapterFactoryProvider().getAdapterFactory(); propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) { protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) { return new PropertySource(object, itemPropertySource) { protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) { return new PropertyDescriptor(object, itemPropertyDescriptor) { public CellEditor createPropertyEditor(Composite composite) { return null; } }; } }; } }); highlighting.addSelectionChangedListener(propertySheetPage); } return propertySheetPage; }
public IPropertySheetPage getPropertySheetPage() { if (propertySheetPage == null) { propertySheetPage = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePropertySheetPage(); // add a slightly modified adapter factory that does not return any editors for // properties. this way, a model can never be modified through the properties view. AdapterFactory adapterFactory = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueAdapterFactoryProvider().getAdapterFactory(); propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) { protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) { return new PropertySource(object, itemPropertySource) { protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) { return new PropertyDescriptor(object, itemPropertyDescriptor) { public CellEditor createPropertyEditor(Composite composite) { return null; } }; } }; } }); highlighting.addSelectionChangedListener(propertySheetPage); } return propertySheetPage; }
public IPropertySheetPage getPropertySheetPage() { if (propertySheetPage == null) { propertySheetPage = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPropertySheetPage(); // add a slightly modified adapter factory that does not return any editors for // properties. this way, a model can never be modified through the properties view. AdapterFactory adapterFactory = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingAdapterFactoryProvider().getAdapterFactory(); propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) { protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) { return new PropertySource(object, itemPropertySource) { protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) { return new PropertyDescriptor(object, itemPropertyDescriptor) { public CellEditor createPropertyEditor(Composite composite) { return null; } }; } }; } }); highlighting.addSelectionChangedListener(propertySheetPage); } return propertySheetPage; }
public IPropertySheetPage getPropertySheetPage() { if (propertySheetPage == null) { propertySheetPage = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPropertySheetPage(); // add a slightly modified adapter factory that does not return any editors for // properties. this way, a model can never be modified through the properties view. AdapterFactory adapterFactory = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsAdapterFactoryProvider().getAdapterFactory(); propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) { protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) { return new PropertySource(object, itemPropertySource) { protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) { return new PropertyDescriptor(object, itemPropertyDescriptor) { public CellEditor createPropertyEditor(Composite composite) { return null; } }; } }; } }); highlighting.addSelectionChangedListener(propertySheetPage); } return propertySheetPage; }
public IPropertySheetPage getPropertySheetPage() { if (propertySheetPage == null) { propertySheetPage = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPropertySheetPage(); // add a slightly modified adapter factory that does not return any editors for // properties. this way, a model can never be modified through the properties view. AdapterFactory adapterFactory = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestAdapterFactoryProvider().getAdapterFactory(); propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory) { protected IPropertySource createPropertySource(Object object, IItemPropertySource itemPropertySource) { return new PropertySource(object, itemPropertySource) { protected IPropertyDescriptor createPropertyDescriptor(IItemPropertyDescriptor itemPropertyDescriptor) { return new PropertyDescriptor(object, itemPropertyDescriptor) { public CellEditor createPropertyEditor(Composite composite) { return null; } }; } }; } }); highlighting.addSelectionChangedListener(propertySheetPage); } return propertySheetPage; }
/** * Return the Property Descriptors for the receiver. */ public IPropertyDescriptor[] getPropertyDescriptors() { if (resource instanceof RemoteFile) { RemoteFile remoteFile = (RemoteFile)resource; if (remoteFile.getLock() != null) { IPropertyDescriptor[] descriptorsWithLocks = new IPropertyDescriptor[9]; descriptorsWithLocks[0] = propertyDescriptors[0]; descriptorsWithLocks[1] = propertyDescriptors[1]; descriptorsWithLocks[2] = propertyDescriptors[2]; descriptorsWithLocks[3] = propertyDescriptors[3]; descriptorsWithLocks[4] = lockPropertyDescriptors[0]; descriptorsWithLocks[5] = lockPropertyDescriptors[1]; descriptorsWithLocks[6] = lockPropertyDescriptors[2]; descriptorsWithLocks[7] = lockPropertyDescriptors[3]; descriptorsWithLocks[8] = lockPropertyDescriptors[4]; return descriptorsWithLocks; } } return propertyDescriptors; }
@Override public IPropertyDescriptor[] getPropertyDescriptors() { Bookmark bookmark = bookmarkDatabase.getBookmarksTree().getBookmark(bookmarkId); List<IPropertyDescriptor> propertyDescriptors = bookmark.getProperties().keySet().stream() .map(propertyName -> getPropertyDescriptorFromBookmarkProperty(propertyName)) .collect(Collectors.toList()); Optional<BookmarkProblem> mayUpdateProblem = getBookmarkProblem(TYPE_PROPERTIES_MAY_UPDATE); if (mayUpdateProblem.isPresent()) { propertyDescriptors.addAll(mayUpdateProblem.get().getProperties().keySet().stream() .filter(propertyName -> bookmark.getPropertyValue(propertyName) == null) .map(propertyName -> getPropertyDescriptorFromProblemProperty(mayUpdateProblem.get(), propertyName)) .collect(Collectors.toList())); } Optional<BookmarkProblem> needUpdateProblem = getBookmarkProblem(TYPE_PROPERTIES_NEED_UPDATE); if (needUpdateProblem.isPresent()) { propertyDescriptors.addAll(needUpdateProblem.get().getProperties().keySet().stream() .filter(propertyName -> bookmark.getPropertyValue(propertyName) == null) .map(propertyName -> getPropertyDescriptorFromProblemProperty(needUpdateProblem.get(), propertyName)) .collect(Collectors.toList())); } return propertyDescriptors.toArray(new IPropertyDescriptor[0]); }
@Test public void testPropertiesWithoutProblems() throws Exception { // Given addBookmark(new BookmarkId("rootFolder"), bookmark("bookmark1").withProperty(PROP_LINE_CONTENT, "first content").build()); // When IPropertyDescriptor[] propertyDescriptors = bookmarkPropertySource.getPropertyDescriptors(); // Then assertThat(propertyDescriptors).hasSize(2); IPropertyDescriptor namePropertyDescriptor = getPropertyDescriptor(propertyDescriptors, Bookmark.PROPERTY_NAME); assertThat(namePropertyDescriptor.getCategory()).isEqualTo("default"); assertThat(bookmarkPropertySource.getPropertyValue(Bookmark.PROPERTY_NAME)).isEqualTo("bookmark1"); IPropertyDescriptor contentPropertyDescriptor = getPropertyDescriptor(propertyDescriptors, PROP_LINE_CONTENT); assertThat(contentPropertyDescriptor.getCategory()).isEqualTo("texteditor"); assertThat(bookmarkPropertySource.getPropertyValue(PROP_LINE_CONTENT)).isEqualTo("first content"); }
@Test public void testPropertyWithPropertyNeedingUpdate() throws Exception { // Given addBookmark(new BookmarkId("rootFolder"), bookmark("bookmark1").withProperty(PROP_LINE_NUMBER, "10").build()); bookmarkProblemsDatabase.add(new BookmarkProblem(new BookmarkId("bookmark1"), BookmarkProblem.TYPE_PROPERTIES_NEED_UPDATE, ImmutableMap.of(PROP_LINE_NUMBER, "120"))); // When IPropertyDescriptor[] propertyDescriptors = bookmarkPropertySource.getPropertyDescriptors(); IPropertyDescriptor propertyDescriptor = getPropertyDescriptor(propertyDescriptors, PROP_LINE_NUMBER); Object propertyValue = bookmarkPropertySource.getPropertyValue(PROP_LINE_NUMBER); // Then assertThat(propertyDescriptor.getDisplayName()).isEqualTo(PROP_LINE_NUMBER); assertThat(propertyValue).isInstanceOf(IPropertySource.class); IPropertySource valuePropertySource = (IPropertySource) propertyValue; IPropertyDescriptor updatePropertyDescriptor = getPropertyDescriptor( valuePropertySource.getPropertyDescriptors(), PROP_LINE_NUMBER); assertThat(valuePropertySource.getPropertyValue(PROP_LINE_NUMBER)).isEqualTo(new UpdatedPropertyValue("120")); assertThat(updatePropertyDescriptor.getDisplayName()).isEqualTo("Updated value"); }
@Test public void testPropertyWithPropertyMayUpdate() throws Exception { // Given addBookmark(new BookmarkId("rootFolder"), bookmark("bookmark1").withProperty(PROP_LINE_NUMBER, "10").build()); bookmarkProblemsDatabase.add(new BookmarkProblem(new BookmarkId("bookmark1"), BookmarkProblem.TYPE_PROPERTIES_MAY_UPDATE, ImmutableMap.of(PROP_LINE_NUMBER, "11"))); // When IPropertyDescriptor[] propertyDescriptors = bookmarkPropertySource.getPropertyDescriptors(); IPropertyDescriptor propertyDescriptor = getPropertyDescriptor(propertyDescriptors, PROP_LINE_NUMBER); Object propertyValue = bookmarkPropertySource.getPropertyValue(PROP_LINE_NUMBER); // Then assertThat(propertyDescriptor.getDisplayName()).isEqualTo(PROP_LINE_NUMBER); assertThat(propertyValue).isInstanceOf(IPropertySource.class); IPropertySource valuePropertySource = (IPropertySource) propertyValue; IPropertyDescriptor updatePropertyDescriptor = getPropertyDescriptor( valuePropertySource.getPropertyDescriptors(), PROP_LINE_NUMBER); assertThat(valuePropertySource.getPropertyValue(PROP_LINE_NUMBER)).isEqualTo(new UpdatedPropertyValue("11")); assertThat(updatePropertyDescriptor.getDisplayName()).isEqualTo("Updated value"); }
@Test public void testNewPropertyValue() throws Exception { // Given addBookmark(new BookmarkId("rootFolder"), bookmark("bookmark1").build()); bookmarkProblemsDatabase.add(new BookmarkProblem(new BookmarkId("bookmark1"), BookmarkProblem.TYPE_PROPERTIES_MAY_UPDATE, ImmutableMap.of(PROP_LINE_NUMBER, "0"))); // When IPropertyDescriptor[] propertyDescriptors = bookmarkPropertySource.getPropertyDescriptors(); IPropertyDescriptor propertyDescriptor = getPropertyDescriptor(propertyDescriptors, PROP_LINE_NUMBER); Object propertyValue = bookmarkPropertySource.getPropertyValue(PROP_LINE_NUMBER); // Then assertThat(propertyDescriptor.getDisplayName()).isEqualTo("lineNumber (New value)"); assertThat(propertyValue).isEqualTo(new UpdatedPropertyValue("0")); }
/** * Creates the property descriptors. * * @param desc * the desc */ @Override public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { // super.createPropertyDescriptors(desc, defaultsMap); positionD = new JSSEnumPropertyDescriptor(JRDesignChartAxis.PROPERTY_POSITION, Messages.MChartAxes_position, AxisPositionEnum.class, NullEnum.NOTNULL); positionD.setDescription(Messages.MChartAxes_position_description); desc.add(positionD); JRPropertyDescriptor chartD = new JRPropertyDescriptor(JRDesignChartAxis.PROPERTY_CHART, Messages.MChartAxes_chart); chartD.setDescription(Messages.MChartAxes_chart_description); desc.add(chartD); // // if (mChart == null) { // mChart = new MChart(); // mChart.setValue(((JRChartAxis) getValue()).getChart()); // } // mChart.createPropertyDescriptors(desc, defaultsMap); setHelpPrefix(desc, "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#axis"); }
@Override public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { super.createPropertyDescriptors(desc, defaultsMap); NTextPropertyDescriptor jdbcURLD = new NTextPropertyDescriptor(PROPERTY_XPATHSELECT, Messages.common_xpath_select); desc.add(jdbcURLD); NTextPropertyDescriptor timeZoneD = new NTextPropertyDescriptor(PROPERTY_XPATHTIMEZONE, Messages.common_xpath_timezone); desc.add(timeZoneD); NTextPropertyDescriptor localeD = new NTextPropertyDescriptor(PROPERTY_XPATHLOCALE, Messages.common_xpath_locale); desc.add(localeD); defaultsMap.put(PROPERTY_XPATHTIMEZONE, TimeZone.getDefault()); defaultsMap.put(PROPERTY_XPATHLOCALE, Locale.getDefault()); }
@Override public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { super.createPropertyDescriptors(desc, defaultsMap); Set<IPropertyDescriptor> toRemove = new HashSet<IPropertyDescriptor>(); // remove name, defaults for (IPropertyDescriptor d : desc) { if (d.getId().equals(JRDesignStyle.PROPERTY_NAME)) toRemove.add(d); else if (d.getId().equals(JRDesignStyle.PROPERTY_DEFAULT)) toRemove.add(d); } desc.removeAll(toRemove); JRExpressionPropertyDescriptor conditionalExpressionD = new JRExpressionPropertyDescriptor( JRDesignConditionalStyle.PROPERTY_CONDITION_EXPRESSION, Messages.MConditionalStyle_conditional_expression); conditionalExpressionD.setCategory(Messages.MConditionalStyle_properties_category); conditionalExpressionD.setDescription(Messages.MConditionalStyle_conditional_expression_description); desc.add(conditionalExpressionD); }
/** * Creates the property descriptors. * * @param desc * the desc */ @Override public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { validator = new VariableNameValidator(); validator.setTargetNode(this); JSSTextPropertyDescriptor nameD = new JSSValidatedTextPropertyDescriptor(JRDesignVariable.PROPERTY_NAME, Messages.common_name, validator); nameD.setDescription(Messages.MVariableSystem_name_description); desc.add(nameD); NClassTypePropertyDescriptor classD = new NClassTypePropertyDescriptor(JRDesignVariable.PROPERTY_VALUE_CLASS_NAME, Messages.common_value_class_name); classD.setDescription(Messages.MVariableSystem_value_class_name_description); desc.add(classD); classD.setHelpRefBuilder(new HelpReferenceBuilder( "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#variable_class")); defaultsMap.put(JRDesignVariable.PROPERTY_VALUE_CLASS_NAME, "java.lang.String"); //$NON-NLS-1$ }
@Override public IPropertyDescriptor[] getPropertyDescriptors() { List<IPropertyDescriptor> fullList = new ArrayList<IPropertyDescriptor>(); fullList.addAll(Arrays.asList(super.getPropertyDescriptors())); NumberPropertyDescriptor npd = new NumberPropertyDescriptor(PROP_BUTTONS_COUNT, PROP_BUTTONS_COUNT, NumberCellEditor.INTEGER, false); npd.setValidator( new MinmaxValidator(1, 10)); fullList.add(npd); IntegerPropertyDescriptor pd=null; for (IPropertyDescriptor iPropertyDescriptor : fullList) { if(PROP_INDEX.equals(iPropertyDescriptor.getDisplayName())){ pd = (IntegerPropertyDescriptor)iPropertyDescriptor; break; } } fullList.remove(fullList.indexOf(pd)); NumberPropertyDescriptor npd2 = new NumberPropertyDescriptor(pd.getId(), PROP_INDEX,NumberCellEditor.INTEGER, true); npd2.setValidator( new MinmaxValidator(0, getButtonsNumber()-1)); fullList.add(npd2); return fullList.toArray(new IPropertyDescriptor[fullList.size()]); }
/** * Creates the property descriptors. * * @param desc * the desc */ @Override public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { NTextPropertyDescriptor textD = new NTextPropertyDescriptor(PROP_TEXT, "Text", SWT.MULTI); desc.add(textD); ColorPropertyDescriptor backcolorD = new ColorPropertyDescriptor(PROP_BACKGROUND, Messages.common_backcolor, NullEnum.NOTNULL,false); backcolorD.setDescription("Background color of the callout"); desc.add(backcolorD); ColorPropertyDescriptor foreColorD = new ColorPropertyDescriptor(PROP_FOREGROUND, Messages.common_forecolor, NullEnum.NOTNULL,false); foreColorD.setDescription("Foreground color of the callout"); desc.add(foreColorD); defaultsMap.put(PROP_BACKGROUND, ColorConstants.yellow); defaultsMap.put(PROP_FOREGROUND, ColorConstants.black); }
public IPropertyDescriptor[] getPropertyDescriptors() { if (getValue() == null) return new IPropertyDescriptor[0]; IPropertyDescriptor[] descriptors = getDescriptors(); if (descriptors == null) { Map<String, Object> defaultsMap = new HashMap<String, Object>(); List<IPropertyDescriptor> desc = new ArrayList<IPropertyDescriptor>(); createPropertyDescriptors(desc, defaultsMap); descriptors = desc.toArray(new IPropertyDescriptor[desc.size()]); setDescriptors(descriptors, defaultsMap); } postDescriptors(descriptors); return descriptors; }
/** * Creates the property descriptors. * * @param desc * the desc */ @Override public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { super.createPropertyDescriptors(desc, defaultsMap); JRExpressionPropertyDescriptor valExpD = new JRExpressionPropertyDescriptor( JRDesignValueDataset.PROPERTY_VALUE_EXPRESSION, Messages.common_value_expression); valExpD.setDescription(Messages.MChartValueDataset_value_expression_description); desc.add(valExpD); valExpD.setHelpRefBuilder(new HelpReferenceBuilder( "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#valueExpression")); valExpD.setCategory(Messages.MChartValueDataset_chart_value_dataset_category); defaultsMap.put(JRDesignValueDataset.PROPERTY_VALUE_EXPRESSION, null); setHelpPrefix(desc, "net.sf.jasperreports.doc/docs/schema.reference.html?cp=0_1#valueDataset"); }
@Override protected IPropertyDescriptor[] loadDescriptors() { IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[3]; propertyDescriptors[0] = new TextPropertyDescriptor("tagname", "Column tag name"); ((PropertyDescriptor)propertyDescriptors[0]).setCategory("Configuration"); propertyDescriptors[1] = new TextPropertyDescriptor("colxpath", "Column XPath"); ((PropertyDescriptor)propertyDescriptors[1]).setCategory("Selection"); propertyDescriptors[2] = new ComboBoxPropertyDescriptor("extract", "Extract children", new String[]{"false","true"}); ((PropertyDescriptor)propertyDescriptors[2]).setCategory("Selection"); return propertyDescriptors; }
@Override protected IPropertyDescriptor[] loadDescriptors() { IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[3]; propertyDescriptors[0] = new TextPropertyDescriptor("name", "Data tag name"); ((PropertyDescriptor)propertyDescriptors[0]).setCategory("Configuration"); propertyDescriptors[1] = new TextPropertyDescriptor("xpath", "Data XPath"); ((PropertyDescriptor)propertyDescriptors[1]).setCategory("Selection"); propertyDescriptors[2] = new ComboBoxPropertyDescriptor("extract", "Extract children", new String[]{"false","true"}); ((PropertyDescriptor)propertyDescriptors[2]).setCategory("Selection"); return propertyDescriptors; }
@Override protected IPropertyDescriptor[] loadDescriptors() { IPropertyDescriptor[] propertyDescriptors = new IPropertyDescriptor[2]; propertyDescriptors[0] = new TextPropertyDescriptor("tagname", "Row tag name"); ((PropertyDescriptor)propertyDescriptors[0]).setCategory("Configuration"); propertyDescriptors[1] = new TextPropertyDescriptor("rowxpath", "Row XPath"); ((PropertyDescriptor)propertyDescriptors[1]).setCategory("Selection"); return propertyDescriptors; }
@Override public IPropertyDescriptor[] getPropertyDescriptors() { ArrayList<IPropertyDescriptor> properties = new ArrayList<IPropertyDescriptor>(); if (node instanceof DeploymentNode) { properties.add(new TextPropertyDescriptor(NodeConstants.DEP_LOG_SYS, "Logical System")); properties.add(new TextPropertyDescriptor(NodeConstants.DEP_FINAL_ASSMBL, "Final Assembly")); } else if (node instanceof ProtectionDomainNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_NAME, "Name")); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.EXEC_ON_COMP_NODE, "Execution Computing Node", getCNNames())); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.GENERIC_COMP_PLAT, "Execution Platform", getPCNames())); } else if (node instanceof ComputingNodeConfigurationNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_NAME, "Computing Node")); properties.add(new TextPropertyDescriptor(NodeConstants.COMP_NODE_SCHED_INFO, "Scheduling Information")); } else if (node instanceof PlatformConfigurationNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_COMP_PLAT, "Platform")); properties.add(new TextPropertyDescriptor(NodeConstants.PLAT_CONF_NOTIF_MAX, "Max Notifications")); properties.add(new TextPropertyDescriptor(NodeConstants.LOG_PLAT_MCAST_ADDR, "Multicast Address")); properties.add(new TextPropertyDescriptor(NodeConstants.LOG_PLAT_PORT, "Port")); properties.add(new TextPropertyDescriptor(NodeConstants.LOG_PLAT_ID, "Platform Id")); } else if (node instanceof DeployedModuleInstanceNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_COMP_NAME, "Component Instance")); properties.add(new TextPropertyDescriptor(NodeConstants.DEP_MOD_INST_NAME, "Module Instance")); properties.add(new TextPropertyDescriptor(NodeConstants.DEP_MOD_PRIORITY, "Priority")); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.PD_NAME, "Protection Domain", getPDNames())); } else if (node instanceof DeployedTriggerInstanceNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_COMP_NAME, "Component Instance")); properties.add(new TextPropertyDescriptor(NodeConstants.DEP_TRG_INST_NAME, "Trigger Instance")); properties.add(new TextPropertyDescriptor(NodeConstants.DEP_TRG_PRIORITY, "Priority")); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.PD_NAME, "Protection Domain", getPDNames())); } return properties.toArray(new IPropertyDescriptor[0]); }
@Override public IPropertyDescriptor[] getPropertyDescriptors() { ArrayList<IPropertyDescriptor> properties = new ArrayList<IPropertyDescriptor>(); if (node instanceof CompositeNode) { properties.add(new TextPropertyDescriptor(NodeConstants.COMPOSITE_NAME, "Composite Name")); } else if (node instanceof ComponentNode) { properties.add(new TextPropertyDescriptor(NodeConstants.COMPONENT_NAME, "Component Name")); properties.add(new TextPropertyDescriptor(NodeConstants.COMPONENT_TYPE, "Component Type")); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.COMPONENT_INST, "Implementation", getComponentImpl())); } else if (node instanceof ComponentPropertyNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_PROP, "Property Name")); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.GENERIC_TYPE, "Type", sdtTypes)); properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_VAL, "Property Value")); } else if (node instanceof CompositePropertyNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_PROP, "Property Name")); properties.add(new ComboBoxPropertyDescriptor(NodeConstants.GENERIC_TYPE, "Type", sdtTypes)); properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_VAL, "Property Value")); } else if (node instanceof ServiceNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_NAME, "Name")); properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_INTF, "Definition")); } else if (node instanceof ServiceNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_NAME, "Name")); properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_INTF, "Interface")); } else if (node instanceof ReferenceNode) { properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_NAME, "Name")); properties.add(new TextPropertyDescriptor(NodeConstants.GENERIC_INTF, "Interface")); } return properties.toArray(new IPropertyDescriptor[0]); }
@Override public IPropertyDescriptor[] getPropertyDescriptors() { return new IPropertyDescriptor[] {new PropertyDescriptor(DetailPropertySource.ID, "ID"), new PropertyDescriptor(DetailPropertySource.LENGTH, "Length"), new PropertyDescriptor(DetailPropertySource.LINE_NUMBER, "Line Number"), new PropertyDescriptor(DetailPropertySource.OFFSET, "Offset"), new PropertyDescriptor(DetailPropertySource.PATH, "Path"), new PropertyDescriptor(DetailPropertySource.TEXT, "Text"), new PropertyDescriptor(DetailPropertySource.TYPE, "Type")}; }
@Override protected CellEditor getCellEditor(Object element) { final Definition definition = (Definition) element; final EStructuralFeature valueFeature = getValueFeature(definition); final AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(adapterFactory); IPropertySource propertySource = contentProvider.getPropertySource(element); IPropertyDescriptor[] propertyDescriptors = propertySource.getPropertyDescriptors(); for (IPropertyDescriptor propertyDescriptor : propertyDescriptors) { if (valueFeature.getName().equals(propertyDescriptor.getId())) { return propertyDescriptor.createPropertyEditor((Composite) getViewer().getControl()); } } return null; }
@Override public IPropertyDescriptor[] getPropertyDescriptors() { if (propertyHolder == null) { propertyHolder = new PropertyHolder(); populate(propertyHolder); } return propertyHolder.getPropertyDescriptors(); }
@Override public IPropertyDescriptor[] getPropertyDescriptors() { return new IPropertyDescriptor[] { new TextPropertyDescriptor("skill", "Skill"), new TextPropertyDescriptor("id", "Unique ID"), new TextPropertyDescriptor("hull", "Hull"), new TextPropertyDescriptor("shields", "Shields"), new CheckboxPropertyDescriptor("critical", "Critical Damage") }; }
@Override public IPropertyDescriptor[] getPropertyDescriptors() { return new IPropertyDescriptor[] { new NumericPropertyDescriptor("health", "Health"), new NumericPropertyDescriptor("speed", "Speed"), new NumericPropertyDescriptor("units", "Units"), new NumericPropertyDescriptor("renforcement", "Unit Cost"), new NumericPropertyDescriptor("deploymentCost", "Deployment Cost") }; }
private IPropertyDescriptor getPropertyDescriptorFromProblemProperty(BookmarkProblem bookmarkProblem, String propertyName) { NewPropertyPropertyDescriptor propertyDescriptor = new NewPropertyPropertyDescriptor(bookmarkProblem, bookmarkProblemDescriptorProvider.getBookmarkProblemDescriptor(bookmarkProblem.getProblemType()), propertyName); propertyDescriptor.setCategory(getCategory(propertyName)); return propertyDescriptor; }
private IPropertyDescriptor getPropertyDescriptor(IPropertyDescriptor[] propertyDescriptors, String id) { for (IPropertyDescriptor propertyDescriptor : propertyDescriptors) { if (id.equals(propertyDescriptor.getId())) { return propertyDescriptor; } } return null; }
public IPropertyDescriptor[] getPropertyDescriptors() { List<String> dbList = DBManagerFactory.getAllDBList(); return new IPropertyDescriptor[] { new ComboBoxPropertyDescriptor( "database", ResourceString.getResourceString("label.database"), dbList.toArray(new String[dbList.size()])) }; }
public IPropertyDescriptor[] getPropertyDescriptors() { return new IPropertyDescriptor[] { new TextPropertyDescriptor("physicalName", ResourceString.getResourceString("label.physical.name")), new TextPropertyDescriptor("logicalName", ResourceString.getResourceString("label.logical.name")) }; }
/** * Creates the property descriptors. * * @param desc * the desc */ @Override public void createPropertyDescriptors(List<IPropertyDescriptor> desc, Map<String, Object> defaultsMap) { super.createPropertyDescriptors(desc, defaultsMap); JSSComboPropertyDescriptor shapeD = new JSSComboPropertyDescriptor( DataMatrixComponent.PROPERTY_SHAPE, Messages.MDataMatrix_shape, Orientation.getItems()); shapeD.setDescription(Messages.MDataMatrix_shape_description); desc.add(shapeD); shapeD.setCategory(Messages.MDataMatrix_properties_category); }