Changeset 9305
- Timestamp:
- 2005-03-08T10:06:45+13:00 (19 years ago)
- Location:
- trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/cdm/PluginManager.java
r9134 r9305 1035 1035 } 1036 1036 else { 1037 // don't let people remove GAPlug 1038 if (plugin_name.equals(StaticStrings.GAPLUG_STR)) { 1039 remove.setEnabled(false); 1040 } else { 1041 remove.setEnabled(true); 1037 // don't let people remove special plugins such GAPlug an METSPlug, 1038 // unless they are in systems mode or above 1039 int mode = Configuration.getMode(); 1040 for (int i=0; i<StaticStrings.KEEP_PLUG.length; i++) { 1041 if ((plugin_name.equals(StaticStrings.KEEP_PLUG[i])) && 1042 (mode < Configuration.SYSTEMS_MODE)) { 1043 remove.setEnabled(false); 1044 break; 1045 } else { 1046 remove.setEnabled(true); 1047 } 1042 1048 } 1043 1049 … … 1169 1175 if(selected_index < findSeparatorIndex()) { 1170 1176 plugin_list.setSelectedIndex(selected_index); 1171 // don't allow removal of GAPlug 1172 if (((Plugin)plugin_list.getSelectedValue()).getName().equals(StaticStrings.GAPLUG_STR)) { 1173 remove.setEnabled(false); 1174 } else { 1175 remove.setEnabled(true); 1176 } 1177 1178 // don't let people remove special plugins such GAPlug an METSPlug, 1179 // unless they are in systems mode or above 1180 int mode = Configuration.getMode(); 1181 for (int i=0; i<StaticStrings.KEEP_PLUG.length; i++) { 1182 String selected_plugin_name 1183 = ((Plugin)plugin_list.getSelectedValue()).getName(); 1184 if ((selected_plugin_name.equals(StaticStrings.KEEP_PLUG[i])) && 1185 (mode < Configuration.SYSTEMS_MODE)) { 1186 remove.setEnabled(false); 1187 break; 1188 } else { 1189 remove.setEnabled(true); 1190 } 1191 } 1177 1192 } 1178 1193 // Otherwise select the first non-removable plugin -
trunk/gli/src/org/greenstone/gatherer/util/StaticStrings.java
r9055 r9305 111 111 static final public String FORMAT_ELEMENT = "Format"; 112 112 static final public String FORMAT_STR = "format"; 113 static final public String GAPLUG_STR = "GAPlug";114 113 static final public String GLI_ATTRIBUTE = "gli"; 115 114 static final public String GREATER_THAN_CHARACTER = ">"; … … 137 136 static final public String INDEXES_ELEMENT = "Indexes"; 138 137 static final public String INT_STR = "int"; 138 static final public String[] KEEP_PLUG = { "GAPlug", "METSPlug" }; 139 139 140 static final public String LANGUAGE_ARGUMENT = "l="; 140 141 static final public String LANGUAGE_ATTRIBUTE = "language";
Note:
See TracChangeset
for help on using the changeset viewer.