private void dispatchCreate() {
_enable(true);
}
private Widget createForm() {
FlexTable panel = new FlexTable();
panel.setCellSpacing(5);
int row = 0;
panel.getFlexCellFormatter().setColSpan(row, 0, 3);
panel.setWidget(row, 0, new HTML("<strong>Your account in the MMI Ontology Registry and Repository</strong>"));
panel.getFlexCellFormatter().setAlignment(row, 0,
HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE
);
row++;
LoginResult loginResult = PortalControl.getInstance().getLoginResult();
String userLoggedIn = (loginResult != null && loginResult.getError() == null) ?
loginResult.getUserName() : null;
HTML tipForPassword = null;
for ( String name : tbs.keySet() ) {
Entry entry = tbs.get(name);
TextBox tb = entry.tb;
if ( (tb instanceof PasswordTextBox) && userLoggedIn != null && tipForPassword == null ) {
tipForPassword = new HTML("<font color=\"gray\"><i>Fill in the following if you want to change your password:</i></font>");
panel.getFlexCellFormatter().setColSpan(row, 0, 3);
panel.setWidget(row, 0, tipForPassword);
panel.getFlexCellFormatter().setAlignment(row, 0,
HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
);
row++;
}
panel.setWidget(row, 0, new Label(entry.label+ ":"));
panel.setWidget(row, 1, tb);
panel.getFlexCellFormatter().setAlignment(row, 0,
HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
);
panel.getFlexCellFormatter().setAlignment(row, 1,
HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
);
row++;
}
panel.getFlexCellFormatter().setColSpan(row, 0, 3);
panel.setWidget(row, 0, statusLabel);
panel.getFlexCellFormatter().setAlignment(row, 0,
HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
);
row++;
createUpdateButton.setText(userLoggedIn == null ? "Create" : "Update");
HorizontalPanel loginCell = new HorizontalPanel();
loginCell.add(createUpdateButton);
panel.getFlexCellFormatter().setColSpan(row, 0, 3);
panel.setWidget(row, 0, loginCell);
panel.getFlexCellFormatter().setAlignment(row, 0,
HasHorizontalAlignment.ALIGN_RIGHT, HasVerticalAlignment.ALIGN_MIDDLE
);
row++;