resultsLayout = new EnhancedVLayout();
resultsLayout.setVisible(false);
addMember(resultsLayout);
final FormItemIcon executeButton = new FormItemIcon();
executeButton.setName("execute");
executeButton.setSrc(ImageManager.getOperationIcon());
executeButton.setPrompt(MSG.common_button_execute());
final SelectItem controlNamesItem = new SortedSelectItem("controlMenu",
MSG.view_admin_plugins_serverControls_name());
LinkedHashMap<String, String> controlNames = new LinkedHashMap<String, String>();
for (ServerPluginControlDefinition def : controlDefinitions) {
controlNames.put(def.getName(), def.getDisplayName());
}
controlNamesItem.setValueMap(controlNames);
controlNamesItem.setWidth(300);
controlNamesItem.addChangedHandler(new ChangedHandler() {
public void onChanged(ChangedEvent event) {
// determine the control that was selected and remember information about it
selectedControlName = (String) event.getValue();
ServerPluginControlDefinition def = getControlDefinition(selectedControlName);
selectedParamsDef = def.getParameters();
selectedResultsDef = def.getResults();
// we changed the control selected, hide any previously shown results
resultsLayout.destroyMembers();
resultsLayout.setVisible(false);
// show the parameters, if there are any
showParameters();
// make sure we show our execute button now that a control has been selected
if (controlNamesItem.getIcon(executeButton.getName()) == null) {
controlNamesItem.setIcons(executeButton);
}
}
});
form.setItems(controlNamesItem);
// when this is clicked, the user wants to invoke the control
executeButton.addFormItemClickHandler(new FormItemClickHandler() {
public void onFormItemClick(FormItemIconClickEvent event) {
Configuration params;
try {
params = getParameters();
} catch (IllegalStateException paramsInvalid) {