// else if (buttonId.equals(BUTTON_CANCEL))
// cancelButton.addListener(Events.Select, listener);
}
private FormPanel createForm() {
FormPanel panel = new FormPanel();
panel.setFrame(true);
// panel.setIconStyle("icon-filter");
panel.setCollapsible(false);
panel.setHeaderVisible(false);
// panel.setHeading("Select views to import");
panel.setSize(386, -1);
panel.setButtonAlign(HorizontalAlignment.RIGHT);
panel.setLayout(new FlowLayout());
// Checkboxes for public/editable:
LayoutContainer rights = new LayoutContainer();
TableLayout rLayout = new TableLayout(2);
rights.setLayout(rLayout);
languageBox = new LanguageBox();
languageBox.addSelectionChangedListener(new SelectionChangedListener<SimpleComboValue<LanguageData>>() {
public void selectionChanged(
SelectionChangedEvent<SimpleComboValue<LanguageData>> se) {
directLink.setValue(getLinkString());
}
});
themeBox = new ThemeBox();
themeBox.addSelectionChangedListener(new SelectionChangedListener<SimpleComboValue<ThemeData>>() {
public void selectionChanged(
SelectionChangedEvent<SimpleComboValue<ThemeData>> se) {
directLink.setValue(getLinkString());
}
});
HorizontalPanel hhp = new HorizontalPanel();
hhp.setHeight(20);
rights.add(hhp);
HorizontalPanel hhhp = new HorizontalPanel();
rights.add(hhhp);
HorizontalPanel hp = new HorizontalPanel();
hp.setVerticalAlign(VerticalAlignment.TOP);
languageBox.setHideLabel(true);
LabelField labelL = new LabelField(constants.language() + ":");
labelL.setPixelSize(150, -1);
languageBox.setPixelSize(220, -1);
hp.add(labelL);
hp.add(languageBox);
TableData ldata = new TableData();
ldata.setColspan(2);
rights.add(hp, ldata);
HorizontalPanel hp2 = new HorizontalPanel();
hp.setVerticalAlign(VerticalAlignment.TOP);
themeBox.setHideLabel(true);
LabelField labelL2 = new LabelField(constants.theme() + ":");
labelL2.setPixelSize(150, -1);
themeBox.setPixelSize(220, -1);
hp2.add(labelL2);
hp2.add(themeBox);
TableData ldata2 = new TableData();
ldata2.setColspan(2);
rights.add(hp2, ldata2);
hideNavigator = new CheckBox();
hideNavigator.setBoxLabel(constants.hideNavigator());
hideViewTabs = new CheckBox();
hideViewTabs.setBoxLabel(constants.hideViewTabs());
autoLogin = new CheckBox();
autoLogin.setBoxLabel(constants.addPassword());
autoUser = new CheckBox();
autoUser.setBoxLabel(constants.addUserFlag());
hideTitleBar = new CheckBox();
hideTitleBar.setBoxLabel(constants.hideTitleBar());
hideToolBar = new CheckBox();
hideToolBar.setBoxLabel(constants.hideToolBar());
hideSave = new CheckBox();
hideSave.setBoxLabel(constants.hideSave());
hideFilter = new CheckBox();
hideFilter.setBoxLabel(constants.hideFilter());
hideStaticFilter = new CheckBox();
hideStaticFilter.setBoxLabel(constants.hideStaticFilter());
hideHorizontalAxis = new CheckBox();
hideHorizontalAxis.setBoxLabel(constants.hideHorizontalAxis());
hideVerticalAxis = new CheckBox();
hideVerticalAxis.setBoxLabel(constants.hideVerticalAxis());
Listener <BaseEvent> listener = new Listener<BaseEvent>() {
public void handleEvent(BaseEvent be) {
directLink.setValue(getLinkString());
}
};
hideNavigator.addListener(Events.Change, listener);
hideViewTabs.addListener(Events.Change, listener);
autoLogin.addListener(Events.Change, listener);
autoUser.addListener(Events.Change, listener);
hideTitleBar.addListener(Events.Change, listener);
hideToolBar.addListener(Events.Change, listener);
hideSave.addListener(Events.Change, listener);
hideFilter.addListener(Events.Change, listener);
hideStaticFilter.addListener(Events.Change, listener);
hideHorizontalAxis.addListener(Events.Change, listener);
hideVerticalAxis.addListener(Events.Change, listener);
rights.add(autoUser);
rights.add(autoLogin);
rights.add(hideNavigator);
rights.add(hideViewTabs);
rights.add(hideTitleBar);
rights.add(new LabelField());
rights.add(hideToolBar);
rights.add(hideSave);
rights.add(hideFilter);
rights.add(hideStaticFilter);
rights.add(hideHorizontalAxis);
rights.add(hideVerticalAxis);
hideNavigator.setValue(true);
hideViewTabs.setValue(true);
autoLogin.setValue(true);
autoUser.setValue(true);
hideTitleBar.setValue(false);
hideToolBar.setValue(false);
hideSave.setValue(false);
hideFilter.setValue(false);
hideStaticFilter.setValue(false);
hideHorizontalAxis.setValue(false);
hideVerticalAxis.setValue(false);
LabelField desc = new LabelField(constants.directLinkExplanation());
panel.add(desc);
panel.add(rights);
LabelField label = new LabelField();
label.setHeight("20px");
panel.add(label);
directLink = new TextArea();
directLink.setReadOnly(true);
directLink.setSize(375, 100);
panel.add(directLink);
LabelField label2 = new LabelField();
label2.setHeight("20px");
panel.add(label2);
// finally the apply/cancel button:
SelectionListener<ComponentEvent> buttonListener = new SelectionListener<ComponentEvent>() {
public void componentSelected(ComponentEvent ce) {
if (ce.component instanceof Button) {
Button pressedButton = (Button) ce.component;
// we close dialog on button press:
if (closeAction == CloseAction.CLOSE)
close(pressedButton);
else
hide(pressedButton);
}
}
};
okButton = new Button(constants.close());
okButton.setItemId(BUTTON_OK);
// cancelButton = new Button("Cancel");
// cancelButton.setItemId(BUTTON_CANCEL);
okButton.addSelectionListener(buttonListener);
// cancelButton.addSelectionListener(buttonListener);
panel.addButton(okButton);
// panel.addButton(cancelButton);
directLink.setValue(getLinkString());
return panel;