VLayout spacer = new VLayout();
spacer.setHeight(10);
layout.addMember(spacer);
IButton cancel = new EnhancedIButton(MSG.common_button_cancel());
cancel.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
PortletSettingsWindow.this.destroy();
}
});
IButton save = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
save.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
if (form.validate()) {
// the form submit handler code is responsible for performing the configure and refresh as
// needed. This ensures that the updated configuration is used.
form.submit();
// the portlet does not have a handle on its container, so saving the new settings is down here
parentWindow.save();
// nuke the settings window now that its form field values have been processed
PortletSettingsWindow.this.destroy();
}
}
});
toolStrip = new EnhancedToolStrip();
toolStrip.setPadding(5);
toolStrip.setWidth100();
toolStrip.setMembersMargin(15);
toolStrip.addMember(cancel);
toolStrip.addMember(save);
toolStrip.setLayoutAlign(Alignment.CENTER);
} else if (view instanceof ConfigurablePortlet) {
ConfigurationDefinition definition = ((ConfigurablePortlet) view).getConfigurationDefinition();
Configuration configuration = storedPortlet.getConfiguration();
final ConfigurationEditor editor = new ConfigurationEditor(definition, configuration);
editor.setWidth(400);
editor.setHeight(400);
layout.addMember(editor);
IButton cancel = new EnhancedIButton(MSG.common_button_cancel());
cancel.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
PortletSettingsWindow.this.destroy();
}
});
IButton save = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
save.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent clickEvent) {
if (editor.validate()) {
// set the portlet config to the new config
Configuration configuration = editor.getConfiguration();
storedPortlet.setConfiguration(configuration);