List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setCellVerticalAlignment
public void setCellVerticalAlignment(IsWidget w, VerticalAlignmentConstant align)
From source file:gov.nist.appvet.gwt.client.gui.dialog.UsersDialogBox.java
License:Open Source License
public UsersDialogBox() { super(false, true); setSize("", "450px"); setAnimationEnabled(false);// ww w . j a v a 2s . c o m usersSelectionModel = new SingleSelectionModel<UserInfoGwt>(); usersSelectionModel.addSelectionChangeHandler(new UserListHandler(this)); final DockPanel dockPanel = new DockPanel(); dockPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); dockPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); setWidget(dockPanel); dockPanel.setSize("", "417px"); final VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setStyleName("usersCenterPanel"); dockPanel.add(verticalPanel, DockPanel.CENTER); dockPanel.setCellVerticalAlignment(verticalPanel, HasVerticalAlignment.ALIGN_MIDDLE); dockPanel.setCellHorizontalAlignment(verticalPanel, HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setSize("", "416px"); final HorizontalPanel horizontalPanel_1 = new HorizontalPanel(); horizontalPanel_1.setStyleName("usersHorizPanel"); horizontalPanel_1.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_1.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.add(horizontalPanel_1); verticalPanel.setCellVerticalAlignment(horizontalPanel_1, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(horizontalPanel_1, HasHorizontalAlignment.ALIGN_CENTER); searchTextBox = new TextBox(); searchTextBox.addKeyDownHandler(new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { searchMode = true; search(); } } }); horizontalPanel_1.add(searchTextBox); horizontalPanel_1.setCellVerticalAlignment(searchTextBox, HasVerticalAlignment.ALIGN_MIDDLE); searchTextBox.setSize("260px", "18px"); final PushButton searchButton = new PushButton("Search"); searchButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { } }); searchButton.setHTML("<img width=\"18px\" src=\"images/icon-search.png\" alt=\"search\" />"); searchButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { searchMode = true; search(); } }); horizontalPanel_1.add(searchButton); horizontalPanel_1.setCellVerticalAlignment(searchButton, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_1.setCellHorizontalAlignment(searchButton, HasHorizontalAlignment.ALIGN_CENTER); searchButton.setSize("18px", "18px"); final PushButton viewAllButton = new PushButton("View All"); viewAllButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { searchMode = false; getAllUsers(allUsers); } }); viewAllButton.setHTML("<img width=\"18px\" src=\"images/icon-view-all.png\" alt=\"view-all\" />"); horizontalPanel_1.add(viewAllButton); horizontalPanel_1.setCellHorizontalAlignment(viewAllButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_1.setCellVerticalAlignment(viewAllButton, HasVerticalAlignment.ALIGN_MIDDLE); viewAllButton.setSize("18px", "18px"); final DockLayoutPanel dockLayoutPanel = new DockLayoutPanel(Unit.EM); dockLayoutPanel.setStyleName("usersDockPanel"); verticalPanel.add(dockLayoutPanel); verticalPanel.setCellVerticalAlignment(dockLayoutPanel, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(dockLayoutPanel, HasHorizontalAlignment.ALIGN_CENTER); dockLayoutPanel.setSize("", "380px"); usersListTable = new UsersListPagingDataGrid<UserInfoGwt>(); usersListTable.dataGrid.setSize("342px", "342px"); usersListTable.dataGrid.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.DISABLED); usersListTable.dataGrid.setSelectionModel(usersSelectionModel); dockLayoutPanel.add(usersListTable); usersListTable.setWidth(""); final HorizontalPanel horizontalPanel_2 = new HorizontalPanel(); horizontalPanel_2.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_2.setStyleName("buttonPanel"); verticalPanel.add(horizontalPanel_2); verticalPanel.setCellVerticalAlignment(horizontalPanel_2, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(horizontalPanel_2, HasHorizontalAlignment.ALIGN_CENTER); addButton = new PushButton("Add"); addButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { editUser(true); } }); addButton.setHTML("Add"); horizontalPanel_2.add(addButton); horizontalPanel_2.setCellHorizontalAlignment(addButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_2.setCellVerticalAlignment(addButton, HasVerticalAlignment.ALIGN_MIDDLE); addButton.setSize("70px", "18px"); final PushButton editButton = new PushButton("Edit"); editButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { editUser(false); } }); final PushButton pshbtnNewButton = new PushButton("Delete"); pshbtnNewButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final UserInfoGwt selected = usersSelectionModel.getSelectedObject(); final DeleteUserConfirmDialogBox deleteConfirmDialogBox = new DeleteUserConfirmDialogBox( selected.getUserName()); 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) { deleteUser(user.getUserName()); } } }); } }); pshbtnNewButton.setHTML("Delete"); horizontalPanel_2.add(pshbtnNewButton); horizontalPanel_2.setCellVerticalAlignment(pshbtnNewButton, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_2.setCellHorizontalAlignment(pshbtnNewButton, HasHorizontalAlignment.ALIGN_CENTER); pshbtnNewButton.setSize("70px", "18px"); editButton.setHTML("Edit"); horizontalPanel_2.add(editButton); horizontalPanel_2.setCellHorizontalAlignment(editButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_2.setCellVerticalAlignment(editButton, HasVerticalAlignment.ALIGN_MIDDLE); editButton.setSize("70px", "18px"); doneButton = new PushButton("Done"); doneButton.setHTML("Done"); horizontalPanel_2.add(doneButton); horizontalPanel_2.setCellHorizontalAlignment(doneButton, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel_2.setCellVerticalAlignment(doneButton, HasVerticalAlignment.ALIGN_MIDDLE); doneButton.setSize("70px", "18px"); getUsersList(); }
From source file:it.pianetatecno.gwt.utility.client.suggest.MySuggestBox.java
License:Apache License
public MySuggestBox(SuggestOracle oracle) { HorizontalPanel panel = new HorizontalPanel(); immagine = new Image(images.iconCloseSmall()); immagine.setStyleName(CSS_PREFIX + "pointer"); suggestBox = new SuggestBox(oracle); panel.add(suggestBox);// ww w . ja v a 2 s . co m panel.add(immagine); panel.setCellVerticalAlignment(immagine, HasVerticalAlignment.ALIGN_MIDDLE); addHandler(); initWidget(panel); }
From source file:n3phele.client.view.CommandDetailView.java
License:Open Source License
public CommandDetailView(ImageResource icon, String heading, String runButtonText, String cancelButtonText) { super(new MenuItem(icon, heading, null)); title = new FlexTable(); title.setCellSpacing(8);//from w w w .j a va2 s . c om title.setWidth("100%"); commandName = new InlineHTML(commandDescriptionText); title.setWidget(0, 0, commandName); commandName.addStyleName(N3phele.n3pheleResource.css().commandDetailHeader()); commandDescription = new InlineHTML(commandDescriptionText); commandDescription.addStyleName(N3phele.n3pheleResource.css().commandDetailText()); title.setWidget(0, 1, commandDescription); commandVersion = new InlineHTML(commandVersionText); title.setWidget(1, 0, commandVersion); title.getCellFormatter().setStylePrimaryName(1, 0, N3phele.n3pheleResource.css().commandDetailText()); title.getFlexCellFormatter().setRowSpan(0, 1, 2); this.add(title); /* * Setup parameters section of the view */ parameters = new SectionPanel("Parameters"); this.paramTable = createParameterTable(); parameters.add(paramTable); this.add(parameters); /* * Setup input and output files sections of the view */ nullRepoColumnIn = new Column<FileSpecification, FileSpecification>(createRepoRefCompositeCell(true)) { @Override public FileSpecification getValue(FileSpecification fs) { return fs; } }; nullRepoColumnOut = new Column<FileSpecification, FileSpecification>(createRepoRefCompositeCell(false)) { @Override public FileSpecification getValue(FileSpecification fs) { return fs; } }; inputs = new SectionPanel("Input Files"); inputTable = createFileTable(inputRepoColumn = nullRepoColumnIn); inputs.add(inputTable); this.add(inputs); outputs = new SectionPanel("Output Files"); outputTable = createFileTable(outputRepoColumn = nullRepoColumnOut); outputs.add(outputTable); this.add(outputs); clouds = new SectionPanel("Execute On"); HorizontalPanel divider = new HorizontalPanel(); divider.setWidth("100%"); clouds.add(divider); gotExecutionSelection = new CellWidget<String>( new ValidInputIndicatorCell(N3phele.n3pheleResource.inputErrorIcon()), "+Execution target selection required"); divider.add(gotExecutionSelection); divider.setCellVerticalAlignment(gotExecutionSelection, HorizontalPanel.ALIGN_MIDDLE); divider.setCellWidth(gotExecutionSelection, "20px"); accountTable = createAccountTable(); divider.add(accountTable); this.sendEmail = new CheckBox("Send you an email on completion"); sendEmail.setWordWrap(true); divider.add(sendEmail); divider.setCellVerticalAlignment(sendEmail, HorizontalPanel.ALIGN_MIDDLE); divider.setCellHorizontalAlignment(sendEmail, HorizontalPanel.ALIGN_CENTER); divider.setCellWidth(sendEmail, "20%"); this.add(clouds); buttons = new HorizontalPanel(); buttons.setWidth("90%"); buttons.setHorizontalAlignment(HorizontalPanel.ALIGN_RIGHT); Label jobLabel = new Label("with job name "); buttons.add(jobLabel); jobName = new TextBox(); buttons.add(jobName); Label fill = new Label(""); buttons.add(fill); buttons.setCellWidth(fill, "10%"); run = new Button(runButtonText); run.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { doRun(); } }); run.setEnabled(false); buttons.add(run); errorsOnPage = new CellWidget<String>(new ValidInputIndicatorCell(N3phele.n3pheleResource.inputErrorIcon()), "+check for missing or invalid parameters marked with this icon"); buttons.add(errorsOnPage); buttons.setCellWidth(errorsOnPage, "20px"); cancel = new Button(cancelButtonText); cancel.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { doCancel(); } }); buttons.add(cancel); this.add(buttons); }
From source file:n3phele.client.view.CreateServiceView.java
License:Open Source License
public CreateServiceView() { super(new MenuItem(N3phele.n3pheleResource.serviceIcon(), "Create Service", null)); table = new FlexTable(); table.setCellPadding(10);/*from w ww . j a v a 2s . co m*/ ChangeHandler update = new ChangeHandler() { @Override public void onChange(ChangeEvent event) { validateAccount(true); } }; KeyUpHandler keyup = new KeyUpHandler() { @Override public void onKeyUp(KeyUpEvent event) { validateAccount(true); } }; this.account = null; Label lblNewLabel = new Label("Service Name"); table.setWidget(0, 0, lblNewLabel); nameValid = new ValidInputIndicatorWidget("Text value required", false); table.setWidget(0, 1, nameValid); name = new TextBox(); name.setVisibleLength(40); name.addChangeHandler(update); name.addKeyUpHandler(keyup); table.setWidget(0, 2, name); //accounts clouds = new SectionPanel("Execute On"); HorizontalPanel divider = new HorizontalPanel(); divider.setWidth("100%"); clouds.add(divider); gotExecutionSelection = new CellWidget<String>( new ValidInputIndicatorCell(N3phele.n3pheleResource.inputErrorIcon()), "+Execution target selection required"); gotExecutionSelection.setPixelSize(20, 20); divider.add(gotExecutionSelection); divider.setCellVerticalAlignment(gotExecutionSelection, HorizontalPanel.ALIGN_MIDDLE); divider.setCellWidth(gotExecutionSelection, "20px"); accountTable = createAccountTable(); divider.add(accountTable); this.add(clouds); secretTextSupplied = new ValidInputIndicatorWidget("Secret text required", false); gotCloudId = new ValidInputIndicatorWidget("Cloud id required", false); cloudSelected = new ValidInputIndicatorWidget("Cloud selection required", false); cancel = new Button("cancel", new ClickHandler() { public void onClick(ClickEvent event) { do_cancel(); } }); table.setWidget(1, 2, cancel); run = new Button("create", new ClickHandler() { public void onClick(ClickEvent event) { do_run(); } }); table.setWidget(1, 0, run); errorsOnPage = new ValidInputIndicatorWidget( "check for missing or invalid parameters marked with this icon", false); table.setWidget(0, 3, errorsOnPage); table.getFlexCellFormatter().setHorizontalAlignment(1, 2, HasHorizontalAlignment.ALIGN_RIGHT); table.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT); table.getFlexCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_CENTER); table.getColumnFormatter().setWidth(0, "25%"); table.getColumnFormatter().setWidth(1, "18px"); table.getColumnFormatter().setWidth(4, "16px"); table.setCellPadding(1); table.setCellSpacing(5); this.add(table); validateAccount(true); }
From source file:org.apache.solr.explorer.client.core.manager.ui.BasicUIManager.java
License:Apache License
protected void showMessgeDialog(String title, Image icon, Widget widget, final AsyncCallback<Void> callback) { final DialogBox dialogBox = new DialogBox(false, true); dialogBox.setText(title);//from w ww . j a v a 2 s.c o m VerticalPanel content = new VerticalPanel(); content.setStyleName("MessageDialogContent"); icon.setStyleName("Icon"); HorizontalPanel messageRow = new HorizontalPanel(); messageRow.add(icon); messageRow.add(widget); messageRow.setCellVerticalAlignment(widget, HorizontalPanel.ALIGN_MIDDLE); content.add(messageRow); Button closeButton = new Button("Close", new ClickHandler() { public void onClick(ClickEvent event) { dialogBox.hide(); if (callback != null) { callback.onSuccess(null); } } }); LayoutUtils.addGap(content, "5px"); content.add(closeButton); content.setCellHorizontalAlignment(closeButton, VerticalPanel.ALIGN_RIGHT); dialogBox.setWidget(content); dialogBox.center(); dialogBox.show(); }
From source file:org.cleanlogic.cesiumjs4gwt.showcase.InfoPanel.java
License:Apache License
/** * Maak een nieuw infopanel.// www.j a v a2s . c om * * @param message Het weer te geven bericht */ public InfoPanel(String message) { HorizontalPanel container = new HorizontalPanel(); Image imgInfo = new Image(Resources.INSTANCE.icon_info()); lblMessage.setHTML(message); container.add(imgInfo); container.add(lblMessage); container.setCellWidth(imgInfo, "70px"); container.setCellHorizontalAlignment(imgInfo, HasHorizontalAlignment.ALIGN_CENTER); container.setCellVerticalAlignment(lblMessage, HasVerticalAlignment.ALIGN_MIDDLE); container.setCellVerticalAlignment(imgInfo, HasVerticalAlignment.ALIGN_MIDDLE); initWidget(container); setStyleName("infopanel"); setSize("480px", "60px"); }
From source file:org.cruxframework.crux.widgets.client.colorpicker.ColorPickerDialog.java
License:Apache License
protected HorizontalPanel createControlBar() { HorizontalPanel panel = new HorizontalPanel(); FlowPanel buttonBar = createButtonBar(); panel.add(buttonBar);/*from w w w . ja v a2 s . co m*/ previewPanel = new SimplePanel(); previewPanel.addStyleName("previewPanel"); panel.add(previewPanel); panel.setCellHorizontalAlignment(previewPanel, HasHorizontalAlignment.ALIGN_RIGHT); panel.setCellVerticalAlignment(buttonBar, HasVerticalAlignment.ALIGN_BOTTOM); panel.setWidth("100%"); return panel; }
From source file:org.cruxframework.crux.widgets.client.scrollbanner.ScrollBanner.java
License:Apache License
/** * Default constructor//from w w w . j ava 2 s .c o m */ public ScrollBanner() { HorizontalPanel basePanel = new HorizontalPanel(); basePanel.setStyleName(DEFAULT_STYLE_NAME); basePanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); messagesLabel = new Label(" "); messagesLabel.setStyleName("message"); messagesLabel.getElement().getStyle().setProperty("overflow", "hidden"); HorizontalPanel verticalCenteringPanel = createMessageVerticalCenteringPanel(); SimplePanel overflowHiddenPanel = createMessageOverflowHiddenPanel(verticalCenteringPanel); basePanel.add(overflowHiddenPanel); basePanel.setCellHorizontalAlignment(overflowHiddenPanel, HasHorizontalAlignment.ALIGN_CENTER); basePanel.setCellVerticalAlignment(overflowHiddenPanel, HasVerticalAlignment.ALIGN_MIDDLE); VerticalPanel controllersPanel = createScrollingControlPanel(); basePanel.add(controllersPanel); basePanel.setCellWidth(controllersPanel, "30"); basePanel.setCellHorizontalAlignment(controllersPanel, HasHorizontalAlignment.ALIGN_RIGHT); basePanel.getElement().getStyle().setProperty("tableLayout", "fixed"); initWidget(basePanel); }
From source file:org.cruxframework.crux.widgets.client.transferlist.TransferList.java
License:Apache License
/** * @param panel2//from w w w .jav a2s . co m */ protected HorizontalPanel createPanelCells() { HorizontalPanel panel = new HorizontalPanel(); panel.setStyleName(DEFAULT_STYLE_NAME); createLeftList(panel); VerticalPanel commandsPanel = createCommands(); panel.add(commandsPanel); panel.setCellVerticalAlignment(commandsPanel, HasVerticalAlignment.ALIGN_MIDDLE); createRightList(panel); return panel; }
From source file:org.dataconservancy.dcs.ingest.ui.client.Application.java
License:Apache License
public void onModuleLoad() { Grid main = new Grid(3, 2); main.setStyleName("Main"); RootPanel.get().add(main);//from www.j a v a2s . co m sidebar = new VerticalPanel(); content = new FlowPanel(); collections = new DecoratedTabPanel(); files = new DecoratedTabPanel(); dus = new DecoratedTabPanel(); this.fileids = new ArrayList<String>(); this.duids = new ArrayList<String>(); this.colids = new ArrayList<String>(); HorizontalPanel header = new HorizontalPanel(); Panel footer = new FlowPanel(); CellFormatter fmt = main.getCellFormatter(); fmt.setStylePrimaryName(0, 0, "TopHeaderLeft"); fmt.setStylePrimaryName(0, 1, "TopHeader"); fmt.setStylePrimaryName(1, 0, "Sidebar"); fmt.setStylePrimaryName(1, 1, "Content"); fmt.setStylePrimaryName(2, 0, "FooterLeft"); fmt.setStylePrimaryName(2, 1, "Footer"); Label toptext = Util.label("Ingest User Interface", "TopHeaderText"); header.add(toptext); header.setCellVerticalAlignment(toptext, HasVerticalAlignment.ALIGN_BOTTOM); footer.add(new HTML("<a href='http://dataconservancy.org/'>http://dataconservancy.org/</a>")); main.setWidget(0, 0, new Image(GWT.getModuleBaseURL() + "simply_modern_logo.png")); main.setWidget(0, 1, header); main.setWidget(1, 0, sidebar); main.setWidget(1, 1, content); main.setWidget(2, 1, footer); History.addValueChangeHandler(new ValueChangeHandler<String>() { public void onValueChange(ValueChangeEvent<String> event) { historyChanged(event.getValue()); } }); History.newItem(State.HOME.toToken(), false); History.fireCurrentHistoryState(); }