private Widget createWidget() {
FlexTable panel = new FlexTable();
int row = 0;
panel.getFlexCellFormatter().setColSpan(row, 0, 2);
panel.setWidget(row, 0, prepareUploadPanel());
panel.getFlexCellFormatter().setAlignment(row, 1,
HasHorizontalAlignment.ALIGN_CENTER, HasVerticalAlignment.ALIGN_MIDDLE
);
row++;
int col = 0;
panel.setWidget(row, col, fileTypePanel.getWidget());
panel.getFlexCellFormatter().setAlignment(row, col,
HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
);
col++;
HorizontalPanel buttons = new HorizontalPanel();
if ( loadButton != null ) {
buttons.add(loadButton);
}
// include the "details" button only if an administrator is logged in
// OR this is running in my dev environment (for testing)
LoginResult loginResult = PortalControl.getInstance().getLoginResult();
if ( (loginResult != null && loginResult.isAdministrator())
|| !GWT.isScript()
) {
buttons.add(detailsButton);
}
panel.getFlexCellFormatter().setColSpan(row, col, 2);
panel.setWidget(row, col, buttons);
panel.getFlexCellFormatter().setAlignment(row, col,
HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
);
row++;
if ( INCLUDE_RDF ) {
CellPanel resultPanel = new VerticalPanel();
textArea.setReadOnly(true);
textArea.setSize("400px", "100px");
panel.getFlexCellFormatter().setColSpan(row, 0, 2);
panel.setWidget(row, 0, resultPanel);
DecoratorPanel decPanel = new DecoratorPanel();
decPanel.setWidget(textArea);
resultPanel.add(decPanel);
row++;