wrappingPanel.setLayout(new FitLayout());
final FormPanel formPanel = new FormPanel();
formPanel.setPaddings(7);
final TextField txtLabel = new TextField("Label");
final TextField txtCode = new TextField("Code");
final TextField txtSource = new TextField("Terminology");
final TextField txtURL = new TextField("URL");
HTMLPanel verticalSpacer = new HTMLPanel("<BR /><BR />");
// final NoteInputPanel nip = new NoteInputPanel(getProjectId(), "Enter a comment about this reference (optional):",
// false, "", "", null, window);
// nip.showButtons(false);
Button btnCreate = new Button("Create reference", new ButtonListenerAdapter() {
@Override
public void onClick(Button button, EventObject e) {
String label = txtLabel.getText();
String code = txtCode.getText();
String source = txtSource.getText();
String url = txtURL.getText();
if (label.length() > 0 || code.length() > 0 || source.length() > 0 || url.length() > 0) {
// createNewReference(label, code, source, url, null);
createNewReference(label, code, source, url);
}
window.close();
}
});
Button btnCancel = new Button("Cancel", new ButtonListenerAdapter() {
@Override
public void onClick(Button button, EventObject e) {
window.close();
}
});
formPanel.add(txtLabel, new AnchorLayoutData("100%"));
formPanel.add(txtCode, new AnchorLayoutData("100%"));
formPanel.add(txtSource, new AnchorLayoutData("100%"));
formPanel.add(txtURL, new AnchorLayoutData("100%"));
formPanel.add(verticalSpacer);
wrappingPanel.add(null, new AnchorLayoutData("100% 170"));
FormPanel formPanelBottom = new FormPanel();
TextField dummyField = new TextField(); //we need to add this to the bottom formPanel
//because otherwise we are not allowed to add buttons to it
dummyField.setVisible(false);
formPanelBottom.add(dummyField);
formPanelBottom.addButton(btnCreate);
formPanelBottom.addButton(btnCancel);
panel.add(formPanel, new AnchorLayoutData("100% 150"));