List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setCellVerticalAlignment
public void setCellVerticalAlignment(IsWidget w, VerticalAlignmentConstant align)
From source file:fr.aliasource.webmail.client.settings.FolderSettingsTab.java
License:GNU General Public License
private void addCreateFolder() { createLabel = new HTML(I18N.strings.createFolder() + ":"); HorizontalPanel hPanel = new HorizontalPanel(); hPanel.add(createLabel);//from w w w.jav a2 s . c o m hPanel.setCellVerticalAlignment(createLabel, HorizontalPanel.ALIGN_MIDDLE); folderName = new TextBox(); hPanel.add(folderName); createButton = new Button(I18N.strings.create()); createButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { createButton.setEnabled(false); createFolder(); } }); cancelButton = new Button(I18N.strings.cancel()); cancelButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent sender) { selectFolder(null); } }); cancelButton.setVisible(false); hPanel.add(createButton); hPanel.add(cancelButton); hPanel.setSpacing(3); add(hPanel, DockPanel.NORTH); }
From source file:gov.nih.nci.ncicb.tcgaportal.level4.gwt.anomalysearch.client.results.PagingHelper.java
public PagingHelper(CellPanel forPageInfo, CellPanel forRowInfo) { HorizontalPanel pagingControls = new HorizontalPanel(); HTML pageHtml = new HTML("Page "); currentPageTb = WidgetHelper.getTextBoxWithValidator(); currentPageTb.addStyleName(StyleConstants.TEXTBOX_WIDTH); //add style elements firstPageButton.addStyleName(StyleConstants.PAGING_BUTTON); previousPageButton.addStyleName(StyleConstants.PAGING_BUTTON); nextPageButton.addStyleName(StyleConstants.PAGING_BUTTON); lastPageButton.addStyleName(StyleConstants.PAGING_BUTTON); WidgetHelper.setDomId(lastPageButton, SeleniumTags.LASTPAGE_BUTTON); WidgetHelper.setDomId(nextPageButton, SeleniumTags.NEXTPAGE_BUTTON); WidgetHelper.setDomId(previousPageButton, SeleniumTags.PREVPAGE_BUTTON); WidgetHelper.setDomId(firstPageButton, SeleniumTags.FIRSTPAGE_BUTTON); totalRowDisplay.addStyleName("resultsInfoLabel"); //add the buttons to the panel pagingControls.add(firstPageButton); pagingControls.add(previousPageButton); pagingControls.add(pageHtml);// ww w . j a va 2 s . c o m pagingControls.add(currentPageTb); pagingControls.add(totalPagesHtml); pagingControls.add(nextPageButton); pagingControls.add(lastPageButton); pagingControls.setSpacing(5); pagingControls.setCellVerticalAlignment(pageHtml, HasVerticalAlignment.ALIGN_MIDDLE); pagingControls.setCellVerticalAlignment(totalPagesHtml, HasVerticalAlignment.ALIGN_MIDDLE); forPageInfo.add(pagingControls); forRowInfo.add(totalRowDisplay); forPageInfo.setCellHorizontalAlignment(pagingControls, HasHorizontalAlignment.ALIGN_RIGHT); forRowInfo.setCellHorizontalAlignment(totalRowDisplay, HasHorizontalAlignment.ALIGN_RIGHT); }
From source file:gov.nih.nci.ncicb.tcgaportal.level4.gwt.anomalysearch.client.util.CloseablePanel.java
public CloseablePanel(String headerText, String headerStyle, boolean allowRemove, final PanelRemovedCallback callback) { HorizontalPanel header = new HorizontalPanel(); header.setWidth("100%"); header.addStyleName(headerStyle);//from w w w.j a va 2 s . c om HorizontalPanel togglePanel = new HorizontalPanel(); toggleImage = new Image(collapseImage); toggleImage.addStyleName("action"); toggleImage.setTitle("Click to hide details"); ClickListener toggleClickListener = new ClickListener() { public void onClick(Widget sender) { if (content.isVisible()) { collapse(); } else { expand(); } } }; toggleImage.addClickListener(toggleClickListener); headerLabel = new Label(headerText); headerLabel.addClickListener(toggleClickListener); headerLabel.addStyleName("actionNoUnderline"); headerLabel.addStyleName("closeableHeader"); togglePanel.add(toggleImage); togglePanel.add(headerLabel); togglePanel.setWidth("100%"); togglePanel.setCellHorizontalAlignment(toggleImage, HasHorizontalAlignment.ALIGN_LEFT); togglePanel.setCellVerticalAlignment(toggleImage, HasVerticalAlignment.ALIGN_MIDDLE); togglePanel.setCellHorizontalAlignment(header, HasHorizontalAlignment.ALIGN_LEFT); togglePanel.setCellVerticalAlignment(header, HasVerticalAlignment.ALIGN_MIDDLE); togglePanel.setCellWidth(toggleImage, "20px"); header.add(togglePanel); if (allowRemove) { Image removeImage = new Image(FilterPanel.IMAGES_PATH + "red-x.gif"); removeImage.addStyleName("action"); removeImage.setTitle("Click to remove selection"); final CloseablePanel self = this; removeImage.addClickListener(new ClickListener() { public void onClick(Widget sender) { self.setVisible(false); if (callback != null) { callback.panelRemoved(); } } }); header.add(removeImage); header.setCellHorizontalAlignment(removeImage, HasHorizontalAlignment.ALIGN_RIGHT); header.setCellVerticalAlignment(removeImage, HasVerticalAlignment.ALIGN_MIDDLE); } this.add(header, DockPanel.NORTH); contentPanel.setWidth("100%"); this.add(contentPanel, DockPanel.CENTER); }
From source file:gov.nist.appvet.gwt.client.gui.AppVetPanel.java
License:Open Source License
public AppVetPanel(Unit unit, final ConfigInfoGwt configInfo, List<AppInfoGwt> initialApps) { super(Unit.PX); Window.addResizeHandler(new ResizeHandler() { Timer resizeTimer = new Timer() { @Override// ww w . ja v a2 s .c om public void run() { resizeComponents(); } }; @Override public void onResize(ResizeEvent event) { resizeTimer.cancel(); resizeTimer.schedule(250); } }); userInfo = configInfo.getUserInfo(); userName = userInfo.getUserName(); allApps = initialApps; sinkEvents(Event.ONCLICK); sessionId = configInfo.getSessionId(); sessionExpirationLong = configInfo.getSessionExpirationLong(); MAX_SESSION_IDLE_DURATION = configInfo.getMaxIdleTime(); POLLING_INTERVAL = configInfo.getUpdatesDelay(); setSize("100%", ""); setStyleName("mainDockPanel"); SERVLET_URL = configInfo.getAppVetServletUrl(); HOST_URL = configInfo.getAppVetHostUrl(); appSelectionModel = new SingleSelectionModel<AppInfoGwt>(); appSelectionModel.addSelectionChangeHandler(new AppListHandler(this, configInfo)); if (configInfo.getAvailableToolNames() == null) { log.severe("Available tools is null"); } availableToolNames = configInfo.getAvailableToolNames(); availableToolIDs = configInfo.getAvailableToolIDs(); availableToolTypes = configInfo.getAvailableToolTypes(); final VerticalPanel northAppVetPanel = new VerticalPanel(); northAppVetPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); northAppVetPanel.setStyleName("northAppVetPanel"); northAppVetPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); addNorth(northAppVetPanel, 125.0); northAppVetPanel.setSize("100%", ""); final HorizontalPanel horizontalPanel_5 = new HorizontalPanel(); horizontalPanel_5.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_5.setStyleName("appVetHeaderPanel"); northAppVetPanel.add(horizontalPanel_5); northAppVetPanel.setCellVerticalAlignment(horizontalPanel_5, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_5.setWidth("100%"); northAppVetPanel.setCellWidth(horizontalPanel_5, "100%"); final InlineHTML nlnhtmlNewInlinehtml_1 = new InlineHTML( "<img border=\"0\" width=\"192px\" src=\"images/appvet_logo.png\" alt=\"appvet\" />"); nlnhtmlNewInlinehtml_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); nlnhtmlNewInlinehtml_1.setStyleName(""); horizontalPanel_5.add(nlnhtmlNewInlinehtml_1); horizontalPanel_5.setCellWidth(nlnhtmlNewInlinehtml_1, "33%"); horizontalPanel_5.setCellVerticalAlignment(nlnhtmlNewInlinehtml_1, HasVerticalAlignment.ALIGN_MIDDLE); final HorizontalPanel horizontalPanel_6 = new HorizontalPanel(); horizontalPanel_6.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_6.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_5.add(horizontalPanel_6); horizontalPanel_6.setWidth(""); horizontalPanel_5.setCellWidth(horizontalPanel_6, "34%"); horizontalPanel_5.setCellHorizontalAlignment(horizontalPanel_6, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_5.setCellVerticalAlignment(horizontalPanel_6, HasVerticalAlignment.ALIGN_MIDDLE); searchTextBox = new TextBox(); searchTextBox.setText("Search"); searchTextBox.setStyleName("searchTextBox"); searchTextBox.setTitle("Search by app ID, name, release kit, etc."); searchTextBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { searchTextBox.setText(""); } }); searchTextBox.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event_) { final boolean enterPressed = KeyCodes.KEY_ENTER == event_.getNativeEvent().getKeyCode(); final String searchString = searchTextBox.getText(); if (enterPressed) { final int numFound = search(); if (numFound > 0) { appsLabel.setText("Search Results for \"" + searchString + "\""); } } } }); searchTextBox.setSize("300px", "22px"); horizontalPanel_6.add(searchTextBox); horizontalPanel_6.setCellVerticalAlignment(searchTextBox, HasVerticalAlignment.ALIGN_MIDDLE); final PushButton searchButton = new PushButton("Search"); searchButton.setTitle("Search by app ID, name, release kit, etc."); searchButton.getUpFace().setHTML(""); searchButton.setSize("18px", "18px"); searchButton.setHTML("<img width=\"18px\" src=\"images/icon-search.png\" alt=\"search\" />"); searchButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final String searchString = searchTextBox.getText(); final int numFound = search(); if (numFound > 0) { appsLabel.setText("Search Results for \"" + searchString + "\""); } } }); horizontalPanel_6.add(searchButton); horizontalPanel_6.setCellHorizontalAlignment(searchButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_6.setCellVerticalAlignment(searchButton, HasVerticalAlignment.ALIGN_MIDDLE); Image image = new Image("images/nist-gray.png"); horizontalPanel_5.add(image); horizontalPanel_5.setCellHorizontalAlignment(image, HasHorizontalAlignment.ALIGN_RIGHT); horizontalPanel_5.setCellWidth(image, "33%"); final HorizontalPanel horizontalPanel_3 = new HorizontalPanel(); northAppVetPanel.add(horizontalPanel_3); northAppVetPanel.setCellHorizontalAlignment(horizontalPanel_3, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_3.setWidth("100%"); northAppVetPanel.setCellWidth(horizontalPanel_3, "100%"); final MenuBar appVetMenuBar = new MenuBar(false); horizontalPanel_3.add(appVetMenuBar); appVetMenuBar.setStyleName("appVetMenuBar"); appVetMenuBar.setAutoOpen(true); appVetMenuBar.setWidth("250px"); appVetMenuBar.setAnimationEnabled(false); final MenuBar userMenuBar = new MenuBar(true); accountMenuItem = new MenuItem(userInfo.getNameWithLastNameInitial(), true, userMenuBar); accountMenuItem.setStyleName("AccountMenuItem"); final MenuItem accountSettingsMenuItem = new MenuItem("Account Settings", false, new Command() { @Override public void execute() { updateUserInfo(); } }); userMenuBar.addItem(accountSettingsMenuItem); final MenuItem myAppsMenuItem = new MenuItem("My Apps", false, new Command() { @Override public void execute() { searchTextBox.setText(userInfo.getUserName()); final int numFound = search(); if (numFound > 0) { appsLabel.setText("My Apps"); } } }); userMenuBar.addItem(myAppsMenuItem); final MenuItemSeparator separator = new MenuItemSeparator(); userMenuBar.addSeparator(separator); final MenuItem logoutMenuItem = new MenuItem("Logout", false, new Command() { @Override public void execute() { appVetServiceAsync.removeSession(sessionId, new AsyncCallback<Boolean>() { @Override public void onFailure(Throwable caught) { AppVetPanel.showMessageDialog("AppVet Error", "App list retrieval error", true); errorDialogBox.closeButton.setFocus(true); errorDialogBox.closeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { killDialogBox(errorDialogBox); } }); } @Override public void onSuccess(Boolean result) { if (result == false) { AppVetPanel.showMessageDialog("AppVet Error", "Could not remove session", true); errorDialogBox.closeButton.setFocus(true); errorDialogBox.closeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { killDialogBox(errorDialogBox); } }); } else { pollingTimer.cancel(); final LoginPanel loginPanel = new LoginPanel(Unit.PX); final RootLayoutPanel rootLayoutPanel = RootLayoutPanel.get(); rootLayoutPanel.clear(); rootLayoutPanel.add(loginPanel); System.gc(); } } }); } }); userMenuBar.addItem(logoutMenuItem); appVetMenuBar.addItem(accountMenuItem); final MenuBar helpMenuBar = new MenuBar(true); final MenuItem helpMenuItem = new MenuItem("Help", true, helpMenuBar); final MenuItem aboutMenuItem = new MenuItem("About", false, new Command() { @Override public void execute() { aboutDialogBox = new AboutDialogBox(configInfo.getAppVetVersion()); aboutDialogBox.setText("About"); aboutDialogBox.center(); aboutDialogBox.closeButton.setFocus(true); aboutDialogBox.closeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { killDialogBox(aboutDialogBox); } }); } }); final MenuItem documentationMenuItem = new MenuItem("Documentation", false, new Command() { @Override public void execute() { Window.open("http://csrc.nist.gov/projects/appvet/", "_blank", null); } }); helpMenuBar.addItem(documentationMenuItem); appVetMenuBar.addItem(helpMenuItem); helpMenuBar.addItem(aboutMenuItem); horizontalPanel_3.add(statusMessageLabel); horizontalPanel_3.setCellVerticalAlignment(statusMessageLabel, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_3.setCellHorizontalAlignment(statusMessageLabel, HasHorizontalAlignment.ALIGN_RIGHT); horizontalPanel_3.setCellWidth(statusMessageLabel, "100%"); statusMessageLabel.setStyleName("devModeIndicator"); statusMessageLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); statusMessageLabel.setSize("420px", "18"); final MenuBar adminMenuBar = new MenuBar(true); final MenuItem adminMenuItem = new MenuItem("Admin", true, adminMenuBar); final MenuItem mntmAppVetLog = new MenuItem("AppVet Log", false, new Command() { @Override public void execute() { final String dateString = "?nocache" + new Date().getTime(); final String url = SERVLET_URL + dateString + "&command=GET_APPVET_LOG&sessionid=" + sessionId; Window.open(url, "_blank", ""); } }); adminMenuBar.addItem(mntmAppVetLog); final MenuItem usersMenuItem = new MenuItem("Users", false, new Command() { @Override public void execute() { usersDialogBox = new UsersDialogBox(); usersDialogBox.setText("Users"); usersDialogBox.center(); usersDialogBox.doneButton.setFocus(true); usersDialogBox.doneButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { killDialogBox(usersDialogBox); } }); } }); adminMenuBar.addItem(usersMenuItem); if (userInfo.getRole().equals("ADMIN")) { appVetMenuBar.addItem(adminMenuItem); } // Remove first element containing the lastUpdate timestamp AppInfoGwt timeStampObject = null; if (initialApps != null && initialApps.size() > 0) { timeStampObject = initialApps.remove(0); lastAppsListUpdate = timeStampObject.getLastAppUpdate(); } final HorizontalPanel horizontalPanel_2 = new HorizontalPanel(); horizontalPanel_2.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_2.setStyleName("footerPanel"); addSouth(horizontalPanel_2, 35.0); horizontalPanel_2.setSize("100%", ""); // final Label lastUpdatedLabel = new Label("Last updated: " // + configInfo.getLastUpdated()); // lastUpdatedLabel // .setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); // lastUpdatedLabel.setStyleName("lastUpdated"); // horizontalPanel_2.add(lastUpdatedLabel); // lastUpdatedLabel.setWidth("200px"); // horizontalPanel_2.setCellWidth(lastUpdatedLabel, "100%"); // horizontalPanel_2.setCellVerticalAlignment(lastUpdatedLabel, // HasVerticalAlignment.ALIGN_MIDDLE); final HorizontalSplitPanel centerAppVetSplitPanel = new HorizontalSplitPanel(); centerAppVetSplitPanel.setSplitPosition("64%"); centerAppVetSplitPanel.setSize("", ""); final SimplePanel leftCenterPanel = new SimplePanel(); centerAppVetSplitPanel.setLeftWidget(leftCenterPanel); leftCenterPanel.setSize("", "95%"); final DockPanel dockPanel_1 = new DockPanel(); dockPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); leftCenterPanel.setWidget(dockPanel_1); dockPanel_1.setSize("100%", ""); rightCenterPanel = new SimplePanel(); centerAppVetSplitPanel.setRightWidget(rightCenterPanel); rightCenterPanel.setSize("", "630px"); final VerticalPanel appInfoVerticalPanel = new VerticalPanel(); appInfoVerticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); rightCenterPanel.setWidget(appInfoVerticalPanel); appInfoVerticalPanel.setSize("99%", ""); final HorizontalPanel horizontalPanel_1 = new HorizontalPanel(); horizontalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_1.setStyleName("iconPanel"); appInfoVerticalPanel.add(horizontalPanel_1); appInfoVerticalPanel.setCellWidth(horizontalPanel_1, "100%"); horizontalPanel_1.setSize("", ""); appInfoIcon = new Image(""); appInfoIcon.setVisible(false); appInfoIcon.setAltText(""); horizontalPanel_1.add(appInfoIcon); horizontalPanel_1.setCellVerticalAlignment(appInfoIcon, HasVerticalAlignment.ALIGN_MIDDLE); appInfoIcon.setSize("70px", "70px"); final VerticalPanel verticalPanel = new VerticalPanel(); horizontalPanel_1.add(verticalPanel); appInfoName = new HTML("", true); appInfoName.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); verticalPanel.add(appInfoName); appInfoName.setStyleName("appInfoName"); appInfoName.setWidth(""); horizontalPanel_1.setCellVerticalAlignment(appInfoName, HasVerticalAlignment.ALIGN_MIDDLE); appInfoVersion = new HTML("", true); appInfoVersion.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); appInfoVersion.setStyleName("appInfoVersion"); verticalPanel.add(appInfoVersion); appsListButtonPanel = new HorizontalPanel(); appsListButtonPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); dockPanel_1.add(appsListButtonPanel, DockPanel.NORTH); dockPanel_1.setCellHorizontalAlignment(appsListButtonPanel, HasHorizontalAlignment.ALIGN_CENTER); dockPanel_1.setCellWidth(appsListButtonPanel, "100%"); dockPanel_1.setCellVerticalAlignment(appsListButtonPanel, HasVerticalAlignment.ALIGN_MIDDLE); appsListButtonPanel.setStyleName("appListButtonPanel"); appsListButtonPanel.setSize("100%", ""); appsLabel = new InlineLabel("Apps"); appsLabel.setStyleName("AppsLabel"); appsListButtonPanel.add(appsLabel); appsListButtonPanel.setCellWidth(appsLabel, "50%"); appsListButtonPanel.setCellVerticalAlignment(appsLabel, HasVerticalAlignment.ALIGN_MIDDLE); appsLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); appsLabel.setWidth("60px"); final HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setStyleName("appFunctionButtonPanel"); appsListButtonPanel.add(horizontalPanel); appsListButtonPanel.setCellWidth(horizontalPanel, "50%"); appsListButtonPanel.setCellVerticalAlignment(horizontalPanel, HasVerticalAlignment.ALIGN_MIDDLE); appsListButtonPanel.setCellHorizontalAlignment(horizontalPanel, HasHorizontalAlignment.ALIGN_RIGHT); horizontalPanel.setWidth(""); final PushButton submitButton = new PushButton("Submit"); submitButton.setTitle("Submit App"); submitButton.setHTML("<img width=\"18px\" src=\"images/icon-submit.png\" alt=\"Submit\" />"); submitButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { appUploadDialogBox = new AppUploadDialogBox(sessionId, SERVLET_URL); appUploadDialogBox.setText("Submit App"); appUploadDialogBox.center(); appUploadDialogBox.cancelButton.setFocus(true); appUploadDialogBox.cancelButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { killDialogBox(appUploadDialogBox); } }); appUploadDialogBox.uploadAppForm.addFormHandler(new AppUploadFormHandler(appUploadDialogBox)); } }); final PushButton viewAllButton = new PushButton("View All"); viewAllButton.setTitle("View All"); viewAllButton.setHTML("<img width=\"18px\" src=\"images/icon-view-all.png\" alt=\"view-all\" />"); viewAllButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { searchMode = false; setAllApps(); } }); horizontalPanel.add(viewAllButton); horizontalPanel.setCellHorizontalAlignment(viewAllButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setCellVerticalAlignment(viewAllButton, HasVerticalAlignment.ALIGN_MIDDLE); viewAllButton.setSize("18px", "18px"); horizontalPanel.add(submitButton); horizontalPanel.setCellVerticalAlignment(submitButton, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setCellHorizontalAlignment(submitButton, HasHorizontalAlignment.ALIGN_CENTER); submitButton.setSize("18px", "18px"); downloadButton = new PushButton("Download"); downloadButton.setTitle("Download Reports"); downloadButton.setHTML("<img width=\"18px\" src=\"images/icon-download.png\" alt=\"Download\" />"); horizontalPanel.add(downloadButton); downloadButton.setEnabled(true); downloadButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final AppInfoGwt selected = appSelectionModel.getSelectedObject(); if (selected == null) { showMessageDialog("AppVet Error", "No app is selected", true); } else { final String appId = selected.appId; final String dateString = "?nocache" + new Date().getTime(); final String url = SERVLET_URL + dateString + "&command=DOWNLOAD_REPORTS&appid=" + appId + "&sessionid=" + sessionId; Window.open(url, "_self", ""); // downloadDialog = new DownloadDialogBox(sessionId, selected); // downloadDialog.setText("Download reports"); // downloadDialog.center(); // downloadDialog.cancelButton.setFocus(true); // downloadDialog.cancelButton // .addClickHandler(new ClickHandler() { // @Override // public void onClick(ClickEvent event) { // killDialogBox(downloadDialog); // } // }); // downloadDialog.downloadButton // .addClickHandler(new ClickHandler() { // @Override // public void onClick(ClickEvent event) { // if (downloadDialog.selected_apk_radio_button // .isChecked()) { // final AppInfoGwt selected = appSelectionModel // .getSelectedObject(); // final String appId = selected.appId; // final String apk = selected.appName; // final String dateString = "?nocache" // + new Date().getTime(); // final String url = SERVLET_URL // + dateString // + "&command=DOWNLOAD_APP&appid=" // + appId + "&sessionid=" // + sessionId + "&appname=" + apk // + ".apk"; // Window.open(url, "_self", ""); // killDialogBox(downloadDialog); // } else if (downloadDialog.selected_report_radio_button // .isChecked()) { // final AppInfoGwt selected = appSelectionModel // .getSelectedObject(); // final String appId = selected.appId; // final String dateString = "?nocache" // + new Date().getTime(); // final String url = SERVLET_URL // + dateString // + "&command=DOWNLOAD_REPORTS&appid=" // + appId + "&sessionid=" // + sessionId; // Window.open(url, "_self", ""); // killDialogBox(downloadDialog); // } // } // }); } } }); horizontalPanel.setCellHorizontalAlignment(downloadButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setCellVerticalAlignment(downloadButton, HasVerticalAlignment.ALIGN_MIDDLE); appsListButtonPanel.setCellHorizontalAlignment(downloadButton, HasHorizontalAlignment.ALIGN_CENTER); downloadButton.setSize("18px", "18px"); addReportButton = new PushButton("Add Report"); horizontalPanel.add(addReportButton); horizontalPanel.setCellVerticalAlignment(addReportButton, HasVerticalAlignment.ALIGN_MIDDLE); addReportButton.setTitle("Override Report"); addReportButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final AppInfoGwt selected = appSelectionModel.getSelectedObject(); if (selected == null) { showMessageDialog("AppVet Error", "No app is selected", true); } else { reportUploadDialogBox = new ReportUploadDialogBox(userName, sessionId, selected.appId, SERVLET_URL, availableToolNames, availableToolIDs); reportUploadDialogBox.setText("Override Report"); reportUploadDialogBox.center(); reportUploadDialogBox.cancelButton.setFocus(true); reportUploadDialogBox.cancelButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { killDialogBox(reportUploadDialogBox); } }); reportUploadDialogBox.uploadReportForm.addFormHandler( new ReportUploadFormHandler(reportUploadDialogBox, userName, selected.appId)); } } }); addReportButton.setSize("18px", "18px"); addReportButton.setHTML("<img width=\"18px\" src=\"images/icon-submit-report.png\" alt=\"Add Report\" />"); deleteButton = new PushButton("Delete"); horizontalPanel.add(deleteButton); horizontalPanel.setCellVerticalAlignment(deleteButton, HasVerticalAlignment.ALIGN_MIDDLE); deleteButton.setHTML("<img width=\"18px\" src=\"images/icon-delete.png\" alt=\"delete\" />"); deleteButton.setTitle("Delete App"); deleteButton.setVisible(true); deleteButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final AppInfoGwt selected = appSelectionModel.getSelectedObject(); deleteConfirmDialogBox = new DeleteAppConfirmDialogBox(selected.appId, selected.appName); deleteConfirmDialogBox.setText("Confirm Delete"); deleteConfirmDialogBox.center(); deleteConfirmDialogBox.cancelButton.setFocus(true); deleteConfirmDialogBox.cancelButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { killDialogBox(deleteConfirmDialogBox); return; } }); deleteConfirmDialogBox.okButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { killDialogBox(deleteConfirmDialogBox); if (selected != null) { deleteApp(selected.appId, userName); } } }); } }); deleteButton.setSize("18px", "18px"); logButton = new PushButton("Log"); horizontalPanel.add(logButton); horizontalPanel.setCellVerticalAlignment(logButton, HasVerticalAlignment.ALIGN_MIDDLE); logButton.setTitle("View Log"); logButton.setHTML("<img width=\"18px\" src=\"images/icon-log.png\" alt=\"log\" />"); logButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final AppInfoGwt selected = appSelectionModel.getSelectedObject(); if (selected != null) { final String appId = selected.appId; final String dateString = "?nocache" + new Date().getTime(); final String url = SERVLET_URL + dateString + "&command=GET_APP_LOG&appid=" + appId + "&sessionid=" + sessionId; Window.open(url, "_blank", ""); } } }); logButton.setSize("18px", "18px"); appsListTable = new AppsListPagingDataGrid<AppInfoGwt>(); appsListTable.dataGrid.setStyleName("dataGrid"); dockPanel_1.add(appsListTable, DockPanel.CENTER); dockPanel_1.setCellHorizontalAlignment(appsListTable, HasHorizontalAlignment.ALIGN_CENTER); dockPanel_1.setCellVerticalAlignment(appsListTable, HasVerticalAlignment.ALIGN_MIDDLE); appsListTable.setAppVetHostUrl(HOST_URL); appsListTable.dataGrid.setSize("99%", ""); appsListTable.setDataList(initialApps); appsListTable.setSize("", ""); appsListTable.dataGrid.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED); appsListTable.dataGrid.setSelectionModel(appSelectionModel); addReportButton.setVisible(true); logButton.setVisible(true); // final Label lblNewLabel_1 = new Label("*See log for system errors"); // lblNewLabel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); // appInfoVerticalPanel.add(lblNewLabel_1); // lblNewLabel_1.setWidth("200px"); // appInfoVerticalPanel.setCellWidth(lblNewLabel_1, "100%"); toolResultsHtml = new HTML("", true); appInfoVerticalPanel.add(toolResultsHtml); appInfoVerticalPanel.setCellWidth(toolResultsHtml, "100%"); toolResultsHtml.setWidth("100%"); toolResultsHtml.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); toolResultsHtml.setStyleName("toolResultsHtml"); add(centerAppVetSplitPanel); /* // Add logo in bottom-right corner final InlineHTML nlnhtmlNewInlinehtml = new InlineHTML( "<a href=\"http://www.example.com\"><img border=\"0\" width=\"75px\" src=\"exampleImage.png\" alt=\"example\" /></a>" ); nlnhtmlNewInlinehtml .setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); nlnhtmlNewInlinehtml.setStyleName("mainTaLogo"); horizontalPanel_2.add(nlnhtmlNewInlinehtml); nlnhtmlNewInlinehtml.setWidth(""); horizontalPanel_2.setCellHorizontalAlignment(nlnhtmlNewInlinehtml, HasHorizontalAlignment.ALIGN_RIGHT); horizontalPanel_2.setCellVerticalAlignment(nlnhtmlNewInlinehtml, HasVerticalAlignment.ALIGN_MIDDLE); */ if ((initialApps != null) && (initialApps.size() > 0)) { appSelectionModel.setSelected(initialApps.get(0), true); } else { logButton.setEnabled(false); addReportButton.setEnabled(false); deleteButton.setEnabled(false); downloadButton.setEnabled(false); } pollServer(userName); scheduleResize(); }
From source file:gov.nist.appvet.gwt.client.gui.dialog.AboutDialogBox.java
License:Open Source License
public AboutDialogBox(String version) { super(false, true); setSize("400px", "209px"); setAnimationEnabled(false);//from w ww .j a va2s. c o m final VerticalPanel dialogVPanel = new VerticalPanel(); dialogVPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); dialogVPanel.addStyleName("dialogVPanel"); dialogVPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); final VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setStyleName("insetPanel"); dialogVPanel.add(verticalPanel); dialogVPanel.setCellVerticalAlignment(verticalPanel, HasVerticalAlignment.ALIGN_MIDDLE); dialogVPanel.setCellHorizontalAlignment(verticalPanel, HasHorizontalAlignment.ALIGN_CENTER); dialogVPanel.setCellWidth(verticalPanel, "100%"); verticalPanel.setWidth("350px"); final Image image = new Image("images/appvet_logo.png"); verticalPanel.add(image); verticalPanel.setCellHorizontalAlignment(image, HasHorizontalAlignment.ALIGN_CENTER); image.setSize("192px", "73px"); final String message = "Version " + version; final HorizontalPanel horizontalPanel = new HorizontalPanel(); verticalPanel.add(horizontalPanel); verticalPanel.setCellWidth(horizontalPanel, "100%"); horizontalPanel.setWidth("350px"); messageLabel = new Label(message); horizontalPanel.add(messageLabel); horizontalPanel.setCellHorizontalAlignment(messageLabel, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setCellVerticalAlignment(messageLabel, HasVerticalAlignment.ALIGN_MIDDLE); messageLabel.setStyleName("infoDialogBox"); verticalPanel.setCellVerticalAlignment(messageLabel, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(messageLabel, HasHorizontalAlignment.ALIGN_CENTER); messageLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); dialogVPanel.setCellHorizontalAlignment(messageLabel, HasHorizontalAlignment.ALIGN_CENTER); dialogVPanel.setCellVerticalAlignment(messageLabel, HasVerticalAlignment.ALIGN_MIDDLE); messageLabel.setSize("350px", "18px"); final DockPanel dockPanel = new DockPanel(); dockPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); dockPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); dockPanel.add(dialogVPanel, DockPanel.CENTER); dockPanel.setCellVerticalAlignment(dialogVPanel, HasVerticalAlignment.ALIGN_MIDDLE); dockPanel.setCellHorizontalAlignment(dialogVPanel, HasHorizontalAlignment.ALIGN_CENTER); this.setWidget(dockPanel); dockPanel.setSize("372px", "181px"); dialogVPanel.setSize("360px", "125px"); final SimplePanel simplePanel = new SimplePanel(); dockPanel.add(simplePanel, DockPanel.SOUTH); dockPanel.setCellVerticalAlignment(simplePanel, HasVerticalAlignment.ALIGN_MIDDLE); simplePanel.setStyleName("aboutDialogButtonPanel"); dialogVPanel.setCellWidth(simplePanel, "100%"); simplePanel.setWidth("340px"); closeButton = new PushButton("Close"); simplePanel.setWidget(closeButton); dialogVPanel.setCellVerticalAlignment(closeButton, HasVerticalAlignment.ALIGN_MIDDLE); closeButton.setSize("70px", "18px"); dialogVPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_CENTER); }
From source file:gov.nist.appvet.gwt.client.gui.dialog.DeleteAppConfirmDialogBox.java
License:Open Source License
public DeleteAppConfirmDialogBox(String appId, String appName) { super(false, true); setSize("", ""); setAnimationEnabled(false);//w w w . j a v a 2 s . com final VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.addStyleName("dialogVPanel"); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); this.setWidget(verticalPanel); verticalPanel.setSize("", ""); final VerticalPanel verticalPanel_1 = new VerticalPanel(); verticalPanel_1.setStyleName("messagePanel"); verticalPanel.add(verticalPanel_1); verticalPanel_1.setWidth("320px"); verticalPanel.setCellWidth(verticalPanel_1, "100%"); final SimplePanel simplePanel = new SimplePanel(); verticalPanel_1.add(simplePanel); verticalPanel_1.setCellWidth(simplePanel, "100%"); simplePanel.setHeight("40px"); final SimplePanel simplePanel_1 = new SimplePanel(); verticalPanel_1.add(simplePanel_1); verticalPanel_1.setCellWidth(simplePanel_1, "100%"); verticalPanel_1.setCellVerticalAlignment(simplePanel_1, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel_1.setCellHorizontalAlignment(simplePanel_1, HasHorizontalAlignment.ALIGN_CENTER); simplePanel_1.setSize("300px", "60px"); final HTML htmlNewHtml = new HTML("<p align=\"center\">\r\nAre you sure you want to delete app #" + appId + " '" + appName + "'?\r\n</p>", true); htmlNewHtml.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); simplePanel_1.setWidget(htmlNewHtml); htmlNewHtml.setSize("", ""); htmlNewHtml.setStyleName("errorDialogBox"); final SimplePanel simplePanel_2 = new SimplePanel(); verticalPanel_1.add(simplePanel_2); verticalPanel_1.setCellWidth(simplePanel_2, "100%"); simplePanel_2.setHeight("40px"); final HorizontalPanel horizontalButtonPanel = new HorizontalPanel(); horizontalButtonPanel.setStyleName("buttonPanel"); horizontalButtonPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalButtonPanel.setSpacing(5); horizontalButtonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.add(horizontalButtonPanel); verticalPanel.setCellVerticalAlignment(horizontalButtonPanel, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(horizontalButtonPanel, HasHorizontalAlignment.ALIGN_CENTER); horizontalButtonPanel.setWidth("320px"); verticalPanel.setCellWidth(horizontalButtonPanel, "100%"); cancelButton = new PushButton("No"); cancelButton.setHTML("Cancel"); horizontalButtonPanel.add(cancelButton); cancelButton.setSize("70px", "18px"); horizontalButtonPanel.setCellVerticalAlignment(cancelButton, HasVerticalAlignment.ALIGN_MIDDLE); horizontalButtonPanel.setCellHorizontalAlignment(cancelButton, HasHorizontalAlignment.ALIGN_CENTER); okButton = new PushButton("Yes"); okButton.setHTML("Ok"); horizontalButtonPanel.add(okButton); horizontalButtonPanel.setCellHorizontalAlignment(okButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalButtonPanel.setCellVerticalAlignment(okButton, HasVerticalAlignment.ALIGN_MIDDLE); okButton.setSize("70px", "18px"); }
From source file:gov.nist.appvet.gwt.client.gui.dialog.DeleteUserConfirmDialogBox.java
License:Open Source License
public DeleteUserConfirmDialogBox(String userName) { super(false, true); setSize("", ""); setAnimationEnabled(false);/* ww w. j a v a2s .co m*/ final VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.addStyleName("dialogVPanel"); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); this.setWidget(verticalPanel); verticalPanel.setSize("", ""); final VerticalPanel verticalPanel_1 = new VerticalPanel(); verticalPanel_1.setStyleName("messagePanel"); verticalPanel.add(verticalPanel_1); verticalPanel_1.setWidth("320px"); verticalPanel.setCellWidth(verticalPanel_1, "100%"); final SimplePanel simplePanel = new SimplePanel(); verticalPanel_1.add(simplePanel); verticalPanel_1.setCellWidth(simplePanel, "100%"); simplePanel.setHeight("40px"); final SimplePanel simplePanel_1 = new SimplePanel(); verticalPanel_1.add(simplePanel_1); verticalPanel_1.setCellWidth(simplePanel_1, "100%"); verticalPanel_1.setCellVerticalAlignment(simplePanel_1, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel_1.setCellHorizontalAlignment(simplePanel_1, HasHorizontalAlignment.ALIGN_CENTER); simplePanel_1.setSize("300px", "60px"); final HTML htmlNewHtml = new HTML( "<p align=\"center\">\r\nAre you sure you want to delete user" + " '" + userName + "'?\r\n</p>", true); htmlNewHtml.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); simplePanel_1.setWidget(htmlNewHtml); htmlNewHtml.setSize("", ""); htmlNewHtml.setStyleName("errorDialogBox"); final SimplePanel simplePanel_2 = new SimplePanel(); verticalPanel_1.add(simplePanel_2); verticalPanel_1.setCellWidth(simplePanel_2, "100%"); simplePanel_2.setHeight("40px"); final HorizontalPanel horizontalButtonPanel = new HorizontalPanel(); horizontalButtonPanel.setStyleName("buttonPanel"); horizontalButtonPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalButtonPanel.setSpacing(5); horizontalButtonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.add(horizontalButtonPanel); verticalPanel.setCellVerticalAlignment(horizontalButtonPanel, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(horizontalButtonPanel, HasHorizontalAlignment.ALIGN_CENTER); horizontalButtonPanel.setWidth("320px"); verticalPanel.setCellWidth(horizontalButtonPanel, "100%"); cancelButton = new PushButton("No"); cancelButton.setHTML("Cancel"); horizontalButtonPanel.add(cancelButton); cancelButton.setSize("70px", "18px"); horizontalButtonPanel.setCellVerticalAlignment(cancelButton, HasVerticalAlignment.ALIGN_MIDDLE); horizontalButtonPanel.setCellHorizontalAlignment(cancelButton, HasHorizontalAlignment.ALIGN_CENTER); okButton = new PushButton("Yes"); okButton.setHTML("Ok"); horizontalButtonPanel.add(okButton); horizontalButtonPanel.setCellHorizontalAlignment(okButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalButtonPanel.setCellVerticalAlignment(okButton, HasVerticalAlignment.ALIGN_MIDDLE); okButton.setSize("70px", "18px"); }
From source file:gov.nist.appvet.gwt.client.gui.dialog.ReportUploadDialogBox.java
License:Open Source License
public ReportUploadDialogBox(String username, String sessionId, String appid, String servletURL, String[] availableToolNames, final String[] availableToolIDs) { super(false, true); setWidth("100%"); setAnimationEnabled(false);//from w w w . ja v a 2s. c o m final VerticalPanel dialogVPanel = new VerticalPanel(); dialogVPanel.addStyleName("dialogVPanel"); dialogVPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); this.setWidget(dialogVPanel); dialogVPanel.setSize("", ""); this.servletURL = servletURL; final SimplePanel simplePanel = new SimplePanel(); simplePanel.setStyleName("reportUploadPanel"); dialogVPanel.add(simplePanel); dialogVPanel.setCellVerticalAlignment(simplePanel, HasVerticalAlignment.ALIGN_MIDDLE); dialogVPanel.setCellHorizontalAlignment(simplePanel, HasHorizontalAlignment.ALIGN_CENTER); simplePanel.setSize("", ""); uploadReportForm = new FormPanel(); simplePanel.setWidget(uploadReportForm); uploadReportForm.setSize("", ""); uploadReportForm.setAction(servletURL); uploadReportForm.setMethod(FormPanel.METHOD_POST); uploadReportForm.setEncoding(FormPanel.ENCODING_MULTIPART); final VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); uploadReportForm.setWidget(verticalPanel); verticalPanel.setSize("", ""); final Hidden hiddenAppid = new Hidden(); hiddenAppid.setName("appid"); hiddenAppid.setValue(appid); verticalPanel.add(hiddenAppid); final Hidden hiddenUsername = new Hidden(); hiddenUsername.setName("username"); hiddenUsername.setValue(username); verticalPanel.add(hiddenUsername); final Hidden hiddenSessionId = new Hidden(); hiddenSessionId.setName("sessionid"); hiddenSessionId.setValue(sessionId); verticalPanel.add(hiddenSessionId); // final Hidden hiddenAnalyst = new Hidden(); // hiddenAnalyst.setName("analyst"); // hiddenAnalyst.setValue(username); // verticalPanel.add(hiddenAnalyst); final Hidden hiddenCommand = new Hidden(); hiddenCommand.setValue("SUBMIT_REPORT"); hiddenCommand.setName("command"); verticalPanel.add(hiddenCommand); hiddenToolID = new Hidden(); hiddenToolID.setName("toolid"); verticalPanel.add(hiddenToolID); final Grid grid = new Grid(5, 2); grid.setCellPadding(5); grid.setStyleName("grid"); verticalPanel.add(grid); grid.setHeight("210px"); verticalPanel.setCellVerticalAlignment(grid, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(grid, HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setCellWidth(grid, "100%"); final Label labelAnalyst = new Label("Analyst: "); labelAnalyst.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); labelAnalyst.setStyleName("reportUploadLabel"); grid.setWidget(0, 0, labelAnalyst); labelAnalyst.setWidth(""); final TextBox analystTextBox = new TextBox(); analystTextBox.setAlignment(TextAlignment.LEFT); analystTextBox.setText(username); analystTextBox.setEnabled(true); analystTextBox.setReadOnly(true); grid.setWidget(0, 1, analystTextBox); grid.getCellFormatter().setHeight(0, 1, "18px"); grid.getCellFormatter().setWidth(0, 1, "300px"); grid.getCellFormatter().setStyleName(0, 1, "reportUploadWidget"); analystTextBox.setSize("220px", "18px"); final Label appIdLabel = new Label("App ID: "); appIdLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); grid.setWidget(1, 0, appIdLabel); grid.getCellFormatter().setWidth(1, 0, "300px"); grid.getCellFormatter().setHeight(1, 1, "18px"); grid.getCellFormatter().setWidth(1, 1, "300px"); final TextBox appIdTextBox = new TextBox(); appIdTextBox.setAlignment(TextAlignment.LEFT); appIdTextBox.setText(appid); appIdTextBox.setEnabled(true); appIdTextBox.setReadOnly(true); grid.setWidget(1, 1, appIdTextBox); grid.getCellFormatter().setStyleName(1, 1, "reportUploadWidget"); appIdTextBox.setSize("220px", "18px"); final Label toolNameLabel = new Label("Tool: "); toolNameLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); grid.setWidget(2, 0, toolNameLabel); toolNameLabel.setWidth("90px"); grid.getCellFormatter().setWidth(2, 1, "300px"); toolNamesComboBox = new ListBox(); grid.setWidget(2, 1, toolNamesComboBox); grid.getCellFormatter().setHeight(2, 1, "18px"); grid.getCellFormatter().setStyleName(2, 1, "reportUploadWidget"); toolNamesComboBox.setSize("231px", "22px"); final Label lblReport = new Label("Report: "); lblReport.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); grid.setWidget(3, 0, lblReport); grid.getCellFormatter().setWidth(3, 1, "300px"); fileUpload = new FileUpload(); fileUpload.setName("fileupload"); grid.setWidget(3, 1, fileUpload); grid.getCellFormatter().setHeight(3, 1, "18px"); grid.getCellFormatter().setStyleName(3, 1, "reportUploadWidget"); fileUpload.setSize("189px", "22px"); final Label riskLabel = new Label("Risk: "); riskLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); grid.setWidget(4, 0, riskLabel); grid.getCellFormatter().setHorizontalAlignment(4, 0, HasHorizontalAlignment.ALIGN_RIGHT); grid.getCellFormatter().setWidth(4, 1, "300px"); grid.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT); grid.getCellFormatter().setHorizontalAlignment(1, 1, HasHorizontalAlignment.ALIGN_LEFT); grid.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT); grid.getCellFormatter().setVerticalAlignment(1, 0, HasVerticalAlignment.ALIGN_MIDDLE); grid.getCellFormatter().setVerticalAlignment(2, 0, HasVerticalAlignment.ALIGN_MIDDLE); grid.getCellFormatter().setHorizontalAlignment(3, 0, HasHorizontalAlignment.ALIGN_RIGHT); grid.getCellFormatter().setVerticalAlignment(3, 0, HasVerticalAlignment.ALIGN_MIDDLE); grid.getCellFormatter().setVerticalAlignment(4, 0, HasVerticalAlignment.ALIGN_MIDDLE); grid.getCellFormatter().setVerticalAlignment(1, 1, HasVerticalAlignment.ALIGN_MIDDLE); grid.getCellFormatter().setHorizontalAlignment(2, 1, HasHorizontalAlignment.ALIGN_LEFT); grid.getCellFormatter().setVerticalAlignment(2, 1, HasVerticalAlignment.ALIGN_MIDDLE); grid.getCellFormatter().setHorizontalAlignment(3, 1, HasHorizontalAlignment.ALIGN_LEFT); grid.getCellFormatter().setVerticalAlignment(3, 1, HasVerticalAlignment.ALIGN_MIDDLE); grid.getCellFormatter().setHorizontalAlignment(4, 1, HasHorizontalAlignment.ALIGN_LEFT); grid.getCellFormatter().setVerticalAlignment(4, 1, HasVerticalAlignment.ALIGN_MIDDLE); ListBox toolRiskComboBox = new ListBox(); toolRiskComboBox.setName("toolrisk"); toolRiskComboBox.addItem("PASS"); toolRiskComboBox.addItem("WARNING"); toolRiskComboBox.addItem("FAIL"); grid.setWidget(4, 1, toolRiskComboBox); grid.getCellFormatter().setHeight(4, 1, "18px"); grid.getCellFormatter().setStyleName(4, 1, "reportUploadWidget"); toolRiskComboBox.setSize("231px", "22px"); grid.getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_MIDDLE); grid.getCellFormatter().setVerticalAlignment(0, 1, HasVerticalAlignment.ALIGN_MIDDLE); grid.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT); grid.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER); statusLabel = new Label(""); statusLabel.setStyleName("submissionRequirementsLabel"); verticalPanel.add(statusLabel); verticalPanel.setCellWidth(statusLabel, "100%"); verticalPanel.setCellVerticalAlignment(statusLabel, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(statusLabel, HasHorizontalAlignment.ALIGN_CENTER); statusLabel.setHeight("20px"); final HorizontalPanel horizontalButtonPanel = new HorizontalPanel(); horizontalButtonPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalButtonPanel.setStyleName("reportUploadButtonPanel"); dialogVPanel.add(horizontalButtonPanel); dialogVPanel.setCellVerticalAlignment(horizontalButtonPanel, HasVerticalAlignment.ALIGN_MIDDLE); dialogVPanel.setCellHorizontalAlignment(horizontalButtonPanel, HasHorizontalAlignment.ALIGN_CENTER); dialogVPanel.setCellWidth(horizontalButtonPanel, "100%"); horizontalButtonPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalButtonPanel.setSize("210px", ""); cancelButton = new PushButton("Cancel"); cancelButton.setHTML("Cancel"); horizontalButtonPanel.add(cancelButton); cancelButton.setSize("70px", "18px"); horizontalButtonPanel.setCellVerticalAlignment(cancelButton, HasVerticalAlignment.ALIGN_MIDDLE); horizontalButtonPanel.setCellHorizontalAlignment(cancelButton, HasHorizontalAlignment.ALIGN_CENTER); submitButton = new PushButton("Submit"); horizontalButtonPanel.add(submitButton); horizontalButtonPanel.setCellHorizontalAlignment(submitButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalButtonPanel.setCellVerticalAlignment(submitButton, HasVerticalAlignment.ALIGN_MIDDLE); submitButton.setSize("70px", "18px"); verticalPanel.setCellWidth(horizontalButtonPanel, "100%"); submitButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { // Set toolid first int selectedToolNameIndex = toolNamesComboBox.getSelectedIndex(); String toolID = availableToolIDs[selectedToolNameIndex]; hiddenToolID.setValue(toolID); uploadReportForm.submit(); } }); for (final String availableTool : availableToolNames) { final String toolName = availableTool; if ((toolName != null) && !toolName.isEmpty()) { toolNamesComboBox.addItem(availableTool); } } }
From source file:gov.nist.appvet.gwt.client.gui.dialog.UserAcctDialogBox.java
License:Open Source License
public UserAcctDialogBox(final UserInfoGwt userInfo) { setSize("386px", "300px"); final VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setSize("100%", "100%"); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setStyleName("verticalPanel"); verticalPanel.setSpacing(5);//w ww .j a va 2s . c o m final HorizontalPanel horizontalPanel_1 = new HorizontalPanel(); horizontalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(horizontalPanel_1); verticalPanel.setCellHorizontalAlignment(horizontalPanel_1, HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setCellVerticalAlignment(horizontalPanel_1, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_1.setWidth(""); final Label lblUserId = new Label("User Name:"); lblUserId.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); horizontalPanel_1.add(lblUserId); horizontalPanel_1.setCellHorizontalAlignment(lblUserId, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_1.setCellWidth(lblUserId, "50%"); lblUserId.setWidth("170px"); horizontalPanel_1.setCellVerticalAlignment(lblUserId, HasVerticalAlignment.ALIGN_MIDDLE); final TextBox userIdTextBox_1 = new TextBox(); userIdTextBox_1.setEnabled(false); userIdTextBox_1.setAlignment(TextAlignment.LEFT); userIdTextBox_1.setText(userInfo.getUserName()); userIdTextBox_1.setReadOnly(true); horizontalPanel_1.add(userIdTextBox_1); horizontalPanel_1.setCellHorizontalAlignment(userIdTextBox_1, HasHorizontalAlignment.ALIGN_CENTER); userIdTextBox_1.setSize("180px", "20px"); horizontalPanel_1.setCellVerticalAlignment(userIdTextBox_1, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_1.setCellWidth(userIdTextBox_1, "50%"); final HorizontalPanel horizontalPanel_2 = new HorizontalPanel(); horizontalPanel_2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_2.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(horizontalPanel_2); verticalPanel.setCellHorizontalAlignment(horizontalPanel_2, HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setCellVerticalAlignment(horizontalPanel_2, HasVerticalAlignment.ALIGN_MIDDLE); final Label lblNewLabel = new Label("Last Name: "); horizontalPanel_2.add(lblNewLabel); horizontalPanel_2.setCellHorizontalAlignment(lblNewLabel, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_2.setCellVerticalAlignment(lblNewLabel, HasVerticalAlignment.ALIGN_MIDDLE); lblNewLabel.setWidth("170px"); horizontalPanel_2.setCellWidth(lblNewLabel, "50%"); lblNewLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); lastNameTextBox = new TextBox(); lastNameTextBox.setEnabled(false); lastNameTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_2.add(lastNameTextBox); horizontalPanel_2.setCellHorizontalAlignment(lastNameTextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_2.setCellVerticalAlignment(lastNameTextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_2.setCellWidth(lastNameTextBox, "50%"); lastNameTextBox.setText(userInfo.getLastName()); lastNameTextBox.setSize("180px", "20px"); final HorizontalPanel horizontalPanel_3 = new HorizontalPanel(); horizontalPanel_3.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.add(horizontalPanel_3); verticalPanel.setCellVerticalAlignment(horizontalPanel_3, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(horizontalPanel_3, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_3.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final Label lblNewLabel_1 = new Label("First Name: "); horizontalPanel_3.add(lblNewLabel_1); horizontalPanel_3.setCellHorizontalAlignment(lblNewLabel_1, HasHorizontalAlignment.ALIGN_CENTER); lblNewLabel_1.setWidth("170px"); horizontalPanel_3.setCellWidth(lblNewLabel_1, "50%"); horizontalPanel_3.setCellVerticalAlignment(lblNewLabel_1, HasVerticalAlignment.ALIGN_MIDDLE); lblNewLabel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); firstNameTextBox = new TextBox(); firstNameTextBox.setEnabled(false); firstNameTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_3.add(firstNameTextBox); horizontalPanel_3.setCellHorizontalAlignment(firstNameTextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_3.setCellVerticalAlignment(firstNameTextBox, HasVerticalAlignment.ALIGN_MIDDLE); firstNameTextBox.setText(userInfo.getFirstName()); firstNameTextBox.setSize("180px", "20px"); final HorizontalPanel horizontalPanel_4 = new HorizontalPanel(); horizontalPanel_4.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_4.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(horizontalPanel_4); verticalPanel.setCellHorizontalAlignment(horizontalPanel_4, HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setCellVerticalAlignment(horizontalPanel_4, HasVerticalAlignment.ALIGN_MIDDLE); final Label lblOrganization = new Label("Organization: "); horizontalPanel_4.add(lblOrganization); horizontalPanel_4.setCellVerticalAlignment(lblOrganization, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_4.setCellHorizontalAlignment(lblOrganization, HasHorizontalAlignment.ALIGN_CENTER); lblOrganization.setWidth("170px"); horizontalPanel_4.setCellWidth(lblOrganization, "50%"); lblOrganization.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); organizationTextBox = new TextBox(); organizationTextBox.setEnabled(false); organizationTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_4.add(organizationTextBox); horizontalPanel_4.setCellHorizontalAlignment(organizationTextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_4.setCellVerticalAlignment(organizationTextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_4.setCellWidth(organizationTextBox, "50%"); organizationTextBox.setSize("180px", "20px"); organizationTextBox.setText(userInfo.getOrganization()); final HorizontalPanel horizontalPanel_5 = new HorizontalPanel(); horizontalPanel_5.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_5.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(horizontalPanel_5); verticalPanel.setCellHorizontalAlignment(horizontalPanel_5, HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setCellVerticalAlignment(horizontalPanel_5, HasVerticalAlignment.ALIGN_MIDDLE); final Label lblEmail = new Label("Email: "); horizontalPanel_5.add(lblEmail); horizontalPanel_5.setCellVerticalAlignment(lblEmail, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_5.setCellHorizontalAlignment(lblEmail, HasHorizontalAlignment.ALIGN_CENTER); lblEmail.setWidth("170px"); horizontalPanel_5.setCellWidth(lblEmail, "50%"); lblEmail.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); emailTextBox = new TextBox(); emailTextBox.setEnabled(false); emailTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_5.add(emailTextBox); horizontalPanel_5.setCellHorizontalAlignment(emailTextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_5.setCellVerticalAlignment(emailTextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_5.setCellWidth(emailTextBox, "50%"); emailTextBox.setText(userInfo.getEmail()); emailTextBox.setSize("180px", "20px"); final Label lblNewLabel_2 = new Label("Change Password"); lblNewLabel_2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); lblNewLabel_2.setWidth("340px"); final HorizontalPanel horizontalPanel_6 = new HorizontalPanel(); horizontalPanel_6.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_6.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(horizontalPanel_6); verticalPanel.setCellVerticalAlignment(horizontalPanel_6, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(horizontalPanel_6, HasHorizontalAlignment.ALIGN_CENTER); final Label lblNewLabel_3 = new Label("New Password: "); horizontalPanel_6.add(lblNewLabel_3); lblNewLabel_3.setWidth("170px"); horizontalPanel_6.setCellVerticalAlignment(lblNewLabel_3, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_6.setCellHorizontalAlignment(lblNewLabel_3, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_6.setCellWidth(lblNewLabel_3, "50%"); lblNewLabel_3.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); password1TextBox = new PasswordTextBox(); password1TextBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { updateButton.setEnabled(true); } }); password1TextBox.setEnabled(true); password1TextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_6.add(password1TextBox); horizontalPanel_6.setCellHorizontalAlignment(password1TextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_6.setCellVerticalAlignment(password1TextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_6.setCellWidth(password1TextBox, "50%"); password1TextBox.setSize("180px", "20px"); final HorizontalPanel horizontalPanel_7 = new HorizontalPanel(); horizontalPanel_7.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_7.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(horizontalPanel_7); verticalPanel.setCellHorizontalAlignment(horizontalPanel_7, HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setCellVerticalAlignment(horizontalPanel_7, HasVerticalAlignment.ALIGN_MIDDLE); final Label lblNewLabel_4 = new Label("New Password (again): "); horizontalPanel_7.add(lblNewLabel_4); horizontalPanel_7.setCellHorizontalAlignment(lblNewLabel_4, HasHorizontalAlignment.ALIGN_CENTER); lblNewLabel_4.setWidth("170px"); horizontalPanel_7.setCellWidth(lblNewLabel_4, "50%"); horizontalPanel_7.setCellVerticalAlignment(lblNewLabel_4, HasVerticalAlignment.ALIGN_MIDDLE); lblNewLabel_4.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); password2TextBox = new PasswordTextBox(); password2TextBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { updateButton.setEnabled(true); } }); password2TextBox.setEnabled(true); password2TextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_7.add(password2TextBox); horizontalPanel_7.setCellHorizontalAlignment(password2TextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_7.setCellWidth(password2TextBox, "50%"); password2TextBox.setSize("180px", "20px"); final HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setSize("200px", "50px"); cancelButton = new PushButton("Cancel"); cancelButton.setHTML("Cancel"); horizontalPanel.add(cancelButton); horizontalPanel.setCellHorizontalAlignment(cancelButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setCellVerticalAlignment(cancelButton, HasVerticalAlignment.ALIGN_MIDDLE); cancelButton.setSize("70px", "18px"); final Label buttonSpacerLabel = new Label(""); horizontalPanel.add(buttonSpacerLabel); horizontalPanel.setCellVerticalAlignment(buttonSpacerLabel, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setCellHorizontalAlignment(buttonSpacerLabel, HasHorizontalAlignment.ALIGN_CENTER); buttonSpacerLabel.setSize("60px", "18px"); updateButton = new PushButton("Update"); updateButton.setEnabled(false); updateButton.setHTML("Update"); horizontalPanel.add(updateButton); horizontalPanel.setCellVerticalAlignment(updateButton, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setCellHorizontalAlignment(updateButton, HasHorizontalAlignment.ALIGN_CENTER); updateButton.setSize("70px", "18px"); verticalPanel.setCellVerticalAlignment(horizontalPanel, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(horizontalPanel, HasHorizontalAlignment.ALIGN_CENTER); final SimplePanel simplePanel = new SimplePanel(); simplePanel.setStyleName("userFormPanel"); simplePanel.setWidget(verticalPanel); final DockPanel dockPanel = new DockPanel(); dockPanel.setStyleName("gwt-DialogBox"); setWidget(dockPanel); dockPanel.setWidth("386px"); dockPanel.add(simplePanel, DockPanel.CENTER); dockPanel.add(horizontalPanel, DockPanel.SOUTH); dockPanel.setCellVerticalAlignment(horizontalPanel, HasVerticalAlignment.ALIGN_MIDDLE); dockPanel.setCellHorizontalAlignment(horizontalPanel, HasHorizontalAlignment.ALIGN_CENTER); }
From source file:gov.nist.appvet.gwt.client.gui.dialog.UserInfoAdminEditDialogBox.java
License:Open Source License
@SuppressWarnings("deprecation") public UserInfoAdminEditDialogBox(UserInfoGwt userInfo, UsersListPagingDataGrid<UserInfoGwt> usersListTable, List<UserInfoGwt> allUsers) { setWidth("386px"); this.usersListTable = usersListTable; this.allUsers = allUsers; if (userInfo == null) { newUser = true;/*from w w w .ja va 2 s . c om*/ } changePasswordCheckBox = new SimpleCheckBox(); if (newUser) { passwordLabel = new Label("Password: "); } else { passwordLabel = new Label("Password Reset: "); } passwordLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); if (newUser) { passwordAgainLabel = new Label("Password (again): "); } else { passwordAgainLabel = new Label("Password Reset (again): "); } passwordAgainLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); final VerticalPanel verticalPanel_1 = new VerticalPanel(); verticalPanel_1.setSize("100%", "100%"); verticalPanel_1.setSpacing(5); verticalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); final HorizontalPanel horizontalPanel_1 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_1); horizontalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final Label lblNewLabel = new Label("Last Name: "); horizontalPanel_1.add(lblNewLabel); horizontalPanel_1.setCellHorizontalAlignment(lblNewLabel, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_1.setCellVerticalAlignment(lblNewLabel, HasVerticalAlignment.ALIGN_MIDDLE); lblNewLabel.setWidth("170px"); horizontalPanel_1.setCellWidth(lblNewLabel, "50%"); lblNewLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); lastNameTextBox = new TextBox(); lastNameTextBox.setTextAlignment(TextBoxBase.ALIGN_LEFT); lastNameTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_1.add(lastNameTextBox); horizontalPanel_1.setCellHorizontalAlignment(lastNameTextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_1.setCellVerticalAlignment(lastNameTextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_1.setCellWidth(lastNameTextBox, "50%"); lastNameTextBox.setWidth("180px"); final HorizontalPanel horizontalPanel_2 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_2); horizontalPanel_2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_2.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final Label lblNewLabel_1 = new Label("First Name: "); horizontalPanel_2.add(lblNewLabel_1); lblNewLabel_1.setWidth("170px"); horizontalPanel_2.setCellWidth(lblNewLabel_1, "50%"); horizontalPanel_2.setCellVerticalAlignment(lblNewLabel_1, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_2.setCellHorizontalAlignment(lblNewLabel_1, HasHorizontalAlignment.ALIGN_CENTER); lblNewLabel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); firstNameTextBox = new TextBox(); firstNameTextBox.setTextAlignment(TextBoxBase.ALIGN_LEFT); firstNameTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_2.add(firstNameTextBox); horizontalPanel_2.setCellWidth(firstNameTextBox, "50%"); horizontalPanel_2.setCellVerticalAlignment(firstNameTextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_2.setCellHorizontalAlignment(firstNameTextBox, HasHorizontalAlignment.ALIGN_CENTER); firstNameTextBox.setWidth("180px"); final HorizontalPanel horizontalPanel_3 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_3); horizontalPanel_3.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_3.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final Label lblUserId = new Label("User ID:"); horizontalPanel_3.add(lblUserId); lblUserId.setWidth("170px"); horizontalPanel_3.setCellVerticalAlignment(lblUserId, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_3.setCellHorizontalAlignment(lblUserId, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_3.setCellWidth(lblUserId, "50%"); lblUserId.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); userIdTextBox = new TextBox(); userIdTextBox.setTextAlignment(TextBoxBase.ALIGN_LEFT); userIdTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_3.add(userIdTextBox); horizontalPanel_3.setCellWidth(userIdTextBox, "50%"); horizontalPanel_3.setCellVerticalAlignment(userIdTextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_3.setCellHorizontalAlignment(userIdTextBox, HasHorizontalAlignment.ALIGN_CENTER); userIdTextBox.setWidth("180px"); final HorizontalPanel horizontalPanel_6 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_6); horizontalPanel_6.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_6.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final Label lblOrganization = new Label("Organization: "); horizontalPanel_6.add(lblOrganization); lblOrganization.setWidth("170px"); horizontalPanel_6.setCellVerticalAlignment(lblOrganization, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_6.setCellHorizontalAlignment(lblOrganization, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_6.setCellWidth(lblOrganization, "50%"); lblOrganization.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); organizationTextBox = new TextBox(); organizationTextBox.setTextAlignment(TextBoxBase.ALIGN_LEFT); organizationTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_6.add(organizationTextBox); horizontalPanel_6.setCellVerticalAlignment(organizationTextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_6.setCellHorizontalAlignment(organizationTextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_6.setCellWidth(organizationTextBox, "50%"); organizationTextBox.setWidth("180px"); final HorizontalPanel horizontalPanel_7 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_7); horizontalPanel_7.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_7.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final Label lblEmail = new Label("Email: "); horizontalPanel_7.add(lblEmail); lblEmail.setWidth("170px"); horizontalPanel_7.setCellVerticalAlignment(lblEmail, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_7.setCellHorizontalAlignment(lblEmail, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_7.setCellWidth(lblEmail, "50%"); lblEmail.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); emailTextBox = new TextBox(); emailTextBox.setTextAlignment(TextBoxBase.ALIGN_LEFT); emailTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_7.add(emailTextBox); horizontalPanel_7.setCellVerticalAlignment(emailTextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_7.setCellHorizontalAlignment(emailTextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_7.setCellWidth(emailTextBox, "50%"); emailTextBox.setWidth("180px"); final HorizontalPanel horizontalPanel_8 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_8); horizontalPanel_8.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_8.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final Label lblRole = new Label("Role: "); horizontalPanel_8.add(lblRole); horizontalPanel_8.setCellHorizontalAlignment(lblRole, HasHorizontalAlignment.ALIGN_CENTER); lblRole.setWidth("170px"); horizontalPanel_8.setCellVerticalAlignment(lblRole, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_8.setCellWidth(lblRole, "50%"); lblRole.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); roleComboBox = new ListBox(); horizontalPanel_8.add(roleComboBox); horizontalPanel_8.setCellWidth(roleComboBox, "50%"); horizontalPanel_8.setCellVerticalAlignment(roleComboBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_8.setCellHorizontalAlignment(roleComboBox, HasHorizontalAlignment.ALIGN_CENTER); roleComboBox.addItem("DEV"); roleComboBox.addItem("ANALYST"); roleComboBox.addItem("ADMIN"); roleComboBox.addItem("APPSTORE"); roleComboBox.addItem("TOOL_SERVICE_PROVIDER"); roleComboBox.addItem("OTHER_CLIENT"); roleComboBox.setWidth("190px"); final HorizontalPanel horizontalPanel_13 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_13); horizontalPanel_13.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_13.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_13.setWidth("366px"); changePasswordCheckBox.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (changePasswordCheckBox.isChecked()) { password1TextBox.setEnabled(true); password2TextBox.setEnabled(true); } else { password1TextBox.setText(null); password1TextBox.setEnabled(false); password2TextBox.setText(null); password2TextBox.setEnabled(false); } } }); horizontalPanel_13.add(changePasswordCheckBox); horizontalPanel_13.setCellVerticalAlignment(changePasswordCheckBox, HasVerticalAlignment.ALIGN_MIDDLE); final Label lblNewLabel_2 = new Label("Change Password"); lblNewLabel_2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); horizontalPanel_13.add(lblNewLabel_2); horizontalPanel_13.setCellVerticalAlignment(lblNewLabel_2, HasVerticalAlignment.ALIGN_MIDDLE); lblNewLabel_2.setWidth("340px"); final HorizontalPanel horizontalPanel_4 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_4); horizontalPanel_4.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_4.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_4.add(passwordLabel); passwordLabel.setWidth("170px"); horizontalPanel_4.setCellWidth(passwordLabel, "50%"); horizontalPanel_4.setCellVerticalAlignment(passwordLabel, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_4.setCellHorizontalAlignment(passwordLabel, HasHorizontalAlignment.ALIGN_CENTER); passwordLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); password1TextBox = new PasswordTextBox(); password1TextBox.setEnabled(false); password1TextBox.setTextAlignment(TextBoxBase.ALIGN_LEFT); password1TextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_4.add(password1TextBox); horizontalPanel_4.setCellVerticalAlignment(password1TextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_4.setCellHorizontalAlignment(password1TextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_4.setCellWidth(password1TextBox, "50%"); password1TextBox.setSize("180px", ""); final HorizontalPanel horizontalPanel_5 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_5); horizontalPanel_5.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_5.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_5.add(passwordAgainLabel); passwordAgainLabel.setWidth("170px"); horizontalPanel_5.setCellVerticalAlignment(passwordAgainLabel, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_5.setCellHorizontalAlignment(passwordAgainLabel, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_5.setCellWidth(passwordAgainLabel, "50%"); passwordAgainLabel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); password2TextBox = new PasswordTextBox(); password2TextBox.setEnabled(false); password2TextBox.setTextAlignment(TextBoxBase.ALIGN_LEFT); password2TextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_5.add(password2TextBox); horizontalPanel_5.setCellVerticalAlignment(password2TextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_5.setCellHorizontalAlignment(password2TextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_5.setCellWidth(password2TextBox, "50%"); password2TextBox.setSize("180px", ""); final HorizontalPanel horizontalPanel_9 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_9); horizontalPanel_9.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_9.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final HorizontalPanel horizontalPanel_10 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_10); horizontalPanel_10.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_10.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final Label lblLastLogon = new Label("Last Logon: "); horizontalPanel_10.add(lblLastLogon); lblLastLogon.setWidth("170px"); horizontalPanel_10.setCellVerticalAlignment(lblLastLogon, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_10.setCellHorizontalAlignment(lblLastLogon, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_10.setCellWidth(lblLastLogon, "50%"); lblLastLogon.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); final TextBox lastLogonTextBox = new TextBox(); lastLogonTextBox.setEnabled(false); lastLogonTextBox.setTextAlignment(TextBoxBase.ALIGN_LEFT); lastLogonTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_10.add(lastLogonTextBox); horizontalPanel_10.setCellVerticalAlignment(lastLogonTextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_10.setCellHorizontalAlignment(lastLogonTextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_10.setCellWidth(lastLogonTextBox, "50%"); lastLogonTextBox.setReadOnly(true); lastLogonTextBox.setWidth("180px"); final HorizontalPanel horizontalPanel_11 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_11); horizontalPanel_11.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_11.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final Label lblFromHost = new Label("From Host: "); horizontalPanel_11.add(lblFromHost); lblFromHost.setWidth("170px"); horizontalPanel_11.setCellWidth(lblFromHost, "50%"); horizontalPanel_11.setCellVerticalAlignment(lblFromHost, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_11.setCellHorizontalAlignment(lblFromHost, HasHorizontalAlignment.ALIGN_CENTER); lblFromHost.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); final TextBox fromHostTextBox = new TextBox(); fromHostTextBox.setEnabled(false); fromHostTextBox.setTextAlignment(TextBoxBase.ALIGN_LEFT); fromHostTextBox.setAlignment(TextAlignment.LEFT); horizontalPanel_11.add(fromHostTextBox); horizontalPanel_11.setCellVerticalAlignment(fromHostTextBox, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_11.setCellHorizontalAlignment(fromHostTextBox, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_11.setCellWidth(fromHostTextBox, "50%"); fromHostTextBox.setReadOnly(true); fromHostTextBox.setWidth("180px"); final HorizontalPanel horizontalPanel_12 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_12); horizontalPanel_12.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_12.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); final HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setSize("200px", "50px"); horizontalPanel.setStyleName("buttonPanelStyle"); cancelButton = new PushButton("Cancel"); cancelButton.setHTML("Cancel"); horizontalPanel.add(cancelButton); final Label buttonSpacerLabel = new Label(""); horizontalPanel.add(buttonSpacerLabel); horizontalPanel.setCellVerticalAlignment(buttonSpacerLabel, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setCellHorizontalAlignment(buttonSpacerLabel, HasHorizontalAlignment.ALIGN_CENTER); buttonSpacerLabel.setSize("60px", "18px"); horizontalPanel.setCellHorizontalAlignment(cancelButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setCellVerticalAlignment(cancelButton, HasVerticalAlignment.ALIGN_MIDDLE); cancelButton.setSize("70px", "18px"); okButton = new PushButton("Submit"); horizontalPanel.add(okButton); horizontalPanel.setCellHorizontalAlignment(okButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setCellVerticalAlignment(okButton, HasVerticalAlignment.ALIGN_MIDDLE); okButton.setSize("70px", "18px"); if (!newUser) { lastNameTextBox.setText(userInfo.getLastName()); firstNameTextBox.setText(userInfo.getFirstName()); userIdTextBox.setText(userInfo.getUserName()); userIdTextBox.setReadOnly(true); lastLogonTextBox.setText(userInfo.getLastLogon()); fromHostTextBox.setText(userInfo.getFromHost()); organizationTextBox.setText(userInfo.getOrganization()); emailTextBox.setText(userInfo.getEmail()); if (userInfo.getRole().equals("DEV")) { roleComboBox.setSelectedIndex(0); } else if (userInfo.getRole().equals("ANALYST")) { roleComboBox.setSelectedIndex(1); } else if (userInfo.getRole().equals("ADMIN")) { roleComboBox.setSelectedIndex(2); } else if (userInfo.getRole().equals("APPSTORE")) { roleComboBox.setSelectedIndex(3); } else if (userInfo.getRole().equals("TOOL_SERVICE_PROVIDER")) { roleComboBox.setSelectedIndex(4); } else if (userInfo.getRole().equals("OTHER_CLIENT")) { roleComboBox.setSelectedIndex(5); } } final SimplePanel simplePanel = new SimplePanel(); simplePanel.setStyleName("userFormPanel"); simplePanel.setWidget(verticalPanel_1); final DockPanel dockPanel = new DockPanel(); dockPanel.setStyleName("gwt-DialogBox"); setWidget(dockPanel); dockPanel.setSize("386px", ""); dockPanel.add(horizontalPanel, DockPanel.SOUTH); dockPanel.setCellVerticalAlignment(horizontalPanel, HasVerticalAlignment.ALIGN_MIDDLE); dockPanel.setCellHorizontalAlignment(horizontalPanel, HasHorizontalAlignment.ALIGN_CENTER); dockPanel.add(simplePanel, DockPanel.CENTER); }