/** * This private method takes the Postprocessor tree node and populates the postProcessorData * DataComponent. * * @param ppTree */ private void setupPostprocessorData(TreeComposite ppTree) { postProcessorsData.clearEntries(); for (int i = 0; i < ppTree.getNumberOfChildren(); i++) { Entry ppEntry = new Entry() { @Override public void setup() { allowedValueType = AllowedValueType.Discrete; allowedValues.add("yes"); allowedValues.add("no"); defaultValue = "no"; } }; ppEntry.setName(ppTree.getChildAtIndex(i).getName()); ppEntry.setDescription("Select whether this Postprocessor should be displayed in real-time."); ppEntry.setId(i); postProcessorsData.addEntry(ppEntry); } }
/** * Adds a new <code>Entry</code> (aka property or parameter) to the active or first available data * node in the {@link #tree}. */ private void addParameter() { // Get either the active data node or the first available data node. DataComponent dataNode = canAdd(tree); // If there is a data node, add a new Entry to it. if (dataNode != null && !dataNode.contains("New parameter")) { // Create an Entry with a BasicEntryContentProvider. Entry entry = new Entry(new BasicEntryContentProvider()); // Set the Entry's initial properties. entry.setName("new_parameter"); entry.setDescription(""); entry.setTag(entry.getName()); entry.setRequired(false); entry.setValue(""); // Add the Entry to the data node. dataNode.addEntry(entry); } return; }