Changeset 7111
- Timestamp:
- 2004-03-23T16:43:46+12:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/PlugIn.java
r7110 r7111 48 48 private String name; // Only for Base 49 49 50 /** Constructor used in DOMProxyListModel initializations, and Library Level. 50 /** Constructor used in DOMProxyListModel initializations, and Library Level. Used for Base plugins (those in the list of available plugins, not ones that are in the DOMProxyList) 51 51 */ 52 52 public PlugIn() { 53 53 } 54 54 55 /** Constructor used for the plugins that are in the DOMProxyList */ 56 // Every time the list of plugins in the assigned plugins box changes, (eg plugin added or removed, not when plugin configured), the plugins seem to be regenerated, using the element from the old plugin. All known args get added to the element the first time this happens - we need to add them to the arguments list in the order they are found in the base plugins though, not this order. 55 57 public PlugIn(Element element, PlugIn base_plugin) { 56 58 super(); … … 66 68 Argument argument = new Argument(option_element); 67 69 //Gatherer.println("Rebuilding existing argument: " + argument.getName()); 68 argument.setOwner(name);69 add(argument);70 70 known_arguments.put(argument.getName(), argument); 71 if (argument.isAssigned() || base_plugin == null) { 72 // if the arg is assigned, the current plugin now becomes its owner, and we add it to the front of the ArrayList of args. But otherwise, it will retain its old owner, and we will add it in the correct place from the base plugin 73 argument.setOwner(name); 74 add(argument); 75 } 71 76 } 72 77 // If a base plugin was given 73 78 if(base_plugin != null) { 74 79 //Gatherer.println("Based on previous plugin."); 75 // Copy the details, and add a reference to whatever base_plugins super plugin is. 80 // Copy the details, and add a reference to whatever base_plugins super plugin is. ?? 76 81 description = base_plugin.getDescription(); 77 82 // Now search through the 'dummy' arguments belonging to the base plugin. For each found, if it is already assigned, fill out further details such as type. If any are found that are not already assigned for this plugin, copy them and add them, but without a value. … … 94 99 existing_argument.setMinimum(base_argument.getMinimum()); 95 100 existing_argument.setMaximum(base_argument.getMaximum()); 96 101 if (!existing_argument.isAssigned()) { 102 // here we give it back its original owner and add it to the list. If it is assigned, these two things were done already 103 existing_argument.setOwner(base_argument.getOwner()); 104 add(existing_argument); 105 } 97 106 98 107 }
Note:
See TracChangeset
for help on using the changeset viewer.