List of usage examples for com.google.gwt.user.client.ui HorizontalPanel setCellHorizontalAlignment
public void setCellHorizontalAlignment(IsWidget w, HorizontalAlignmentConstant align)
From source file:org.mindinformatics.gwt.domeo.plugins.annotation.micropubs.ui.form.FMicroPublicationForm2.java
License:Apache License
private void displayReferenceInEvidence(VerticalPanel vp, Integer counter, final MMpRelationship relationship) { HorizontalPanel hp1 = new HorizontalPanel(); hp1.setWidth("100%"); hp1.setStyleName(style.indexWrapper()); if (relationship.getName().equals(IMicroPublicationsOntology.supportedBy)) { final Image supportedByIcon = new Image(localResources.supportedBy()); supportedByIcon.setTitle("Supported By"); supportedByIcon.setStyleName(style.link()); supportedByIcon.addClickHandler(new ClickHandler() { @Override//from www . jav a 2 s. c o m public void onClick(ClickEvent event) { EvidenceRelationshipBubble bubble = new EvidenceRelationshipBubble(_this, _domeo, _item, relationship, ""); int x = supportedByIcon.getAbsoluteLeft(); int y = supportedByIcon.getAbsoluteTop(); bubble.show(x, y); } }); hp1.add(supportedByIcon); hp1.setCellWidth(supportedByIcon, "22px"); } else if (relationship.getName().equals(IMicroPublicationsOntology.challengedBy)) { final Image supportedByIcon = new Image(localResources.challengedBy()); supportedByIcon.setTitle("Supported By"); supportedByIcon.setStyleName(style.link()); supportedByIcon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { EvidenceRelationshipBubble bubble = new EvidenceRelationshipBubble(_this, _domeo, _item, relationship, ""); int x = supportedByIcon.getAbsoluteLeft(); int y = supportedByIcon.getAbsoluteTop(); bubble.show(x, y); } }); hp1.add(supportedByIcon); hp1.setCellWidth(supportedByIcon, "22px"); } hp1.add(PubMedCitationPainter .getFullCitation(((MMpReference) relationship.getObjectElement()).getReference(), _domeo)); final MMpRelationship _q = relationship; final Image removeIcon = new Image(Domeo.resources.deleteLittleIcon()); removeIcon.setStyleName(style.link()); removeIcon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { hasChanged = true; evidence.remove(_q); if (_item != null) { _item.getEvidence().remove(_q); _ann.setHasChanged(true); } refreshSupport(); //box.setEnabled(false); //_container.addImageAsData(_image); } }); hp1.add(removeIcon); hp1.setCellWidth(removeIcon, "16px"); hp1.setCellHorizontalAlignment(removeIcon, HasHorizontalAlignment.ALIGN_RIGHT); vp.add(hp1); }
From source file:org.mindinformatics.gwt.domeo.plugins.annotation.micropubs.ui.form.FMicroPublicationForm2.java
License:Apache License
private void displayStatementInEvidence(VerticalPanel vp, Integer counter, final MMpRelationship relationship) { HorizontalPanel hp1 = new HorizontalPanel(); hp1.setWidth("100%"); hp1.setStyleName(style.indexWrapper()); if (relationship.getName().equals(IMicroPublicationsOntology.supportedBy)) { final Image supportedByIcon = new Image(localResources.supportedBy()); supportedByIcon.setTitle("Supported By"); supportedByIcon.setStyleName(style.link()); supportedByIcon.addClickHandler(new ClickHandler() { @Override//from w w w . j a va2 s . c o m public void onClick(ClickEvent event) { EvidenceRelationshipBubble bubble = new EvidenceRelationshipBubble(_this, _domeo, _item, relationship, ""); int x = supportedByIcon.getAbsoluteLeft(); int y = supportedByIcon.getAbsoluteTop(); bubble.show(x, y); } }); hp1.add(supportedByIcon); hp1.setCellWidth(supportedByIcon, "22px"); } else if (relationship.getName().equals(IMicroPublicationsOntology.challengedBy)) { final Image supportedByIcon = new Image(localResources.challengedBy()); supportedByIcon.setTitle("Supported By"); supportedByIcon.setStyleName(style.link()); supportedByIcon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { EvidenceRelationshipBubble bubble = new EvidenceRelationshipBubble(_this, _domeo, _item, relationship, ""); int x = supportedByIcon.getAbsoluteLeft(); int y = supportedByIcon.getAbsoluteTop(); bubble.show(x, y); } }); hp1.add(supportedByIcon); hp1.setCellWidth(supportedByIcon, "22px"); } hp1.add(new HTML(((MMpStatement) relationship.getObjectElement()).getText())); final Image removeIcon = new Image(Domeo.resources.deleteLittleIcon()); removeIcon.setStyleName(style.link()); removeIcon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { //box.setEnabled(false); //_container.addImageAsData(_image); } }); hp1.add(removeIcon); hp1.setCellWidth(removeIcon, "16px"); hp1.setCellHorizontalAlignment(removeIcon, HasHorizontalAlignment.ALIGN_RIGHT); vp.add(hp1); }
From source file:org.mindinformatics.gwt.domeo.plugins.annotation.micropubs.ui.form.FMicroPublicationForm2.java
License:Apache License
private void displayImageInEvidence(VerticalPanel vp, Integer counter, final MMpRelationship relationship) { _domeo.getLogger().debug(this, "3c1"); MOnlineImage image = (MOnlineImage) ((MImageInDocumentSelector) relationship.getObjectElement() .getSelector()).getTarget(); _domeo.getLogger().debug(this, "3c2"); VerticalPanel hp1 = new VerticalPanel(); hp1.setWidth("100%"); boolean small = false; boolean reduced = false; //Window.alert(image.getUrl() + " - " + image.getDisplayUrl()); Image img = new Image(image.getDisplayUrl()); _domeo.getLogger().debug(this, "3c3"); if (img.getWidth() > 380) { img.setWidth("380px"); reduced = true;/*from w ww . j a va 2 s .c o m*/ } else if (img.getWidth() < 220) { small = true; //img.setWidth("200px"); } if (image.getLabel() != null && image.getLabel().trim().length() > 0) { img.setTitle(image.getLabel()); } _domeo.getLogger().debug(this, "3c4"); if (!small) { HorizontalPanel main = new HorizontalPanel(); main.setWidth("100%"); //VerticalPanel actionsPanel = new VerticalPanel(); //actionsPanel.setHeight("100%"); if (relationship.getName().equals(IMicroPublicationsOntology.supportedBy)) { final Image supportedByIcon = new Image(localResources.supportedBy()); supportedByIcon.setTitle("Supported By"); supportedByIcon.setStyleName(style.link()); supportedByIcon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { EvidenceRelationshipBubble bubble = new EvidenceRelationshipBubble(_this, _domeo, _item, relationship, ""); int x = supportedByIcon.getAbsoluteLeft(); int y = supportedByIcon.getAbsoluteTop(); bubble.show(x, y); } }); main.add(supportedByIcon); main.setCellWidth(supportedByIcon, "22px"); } else if (relationship.getName().equals(IMicroPublicationsOntology.challengedBy)) { final Image supportedByIcon = new Image(localResources.challengedBy()); supportedByIcon.setTitle("Supported By"); supportedByIcon.setStyleName(style.link()); supportedByIcon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { EvidenceRelationshipBubble bubble = new EvidenceRelationshipBubble(_this, _domeo, _item, relationship, ""); int x = supportedByIcon.getAbsoluteLeft(); int y = supportedByIcon.getAbsoluteTop(); bubble.show(x, y); } }); main.add(supportedByIcon); main.setCellWidth(supportedByIcon, "22px"); } VerticalPanel left = new VerticalPanel(); SimplePanel imageWrap = new SimplePanel(); imageWrap.setStyleName(style.imageWrap()); imageWrap.add(img); imageWrap.setStyleName(style.centerText()); left.add(imageWrap); left.setCellHorizontalAlignment(img, HasHorizontalAlignment.ALIGN_LEFT); if (image.getLabel() != null && image.getLabel().trim().length() > 0) { HTML title = new HTML("<b>" + image.getLabel() + "</b>"); left.add(title); left.setCellHorizontalAlignment(title, HasHorizontalAlignment.ALIGN_LEFT); } /* else { HTML title = new HTML("<b>Title</b>"); left.add(title); left.setCellHorizontalAlignment(title, HasHorizontalAlignment.ALIGN_LEFT); } */ main.add(left); main.setStyleName(style.indexWrapper()); if (counter % 2 == 1) { left.addStyleName(style.indexOdd()); } else { left.addStyleName(style.indexEven()); } final Image removeIcon = new Image(Domeo.resources.deleteLittleIcon()); removeIcon.setStyleName(style.link()); removeIcon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { //box.setEnabled(false); //_container.addImageAsData(_image); } }); main.add(removeIcon); main.setCellWidth(removeIcon, "16px"); main.setCellHorizontalAlignment(removeIcon, HasHorizontalAlignment.ALIGN_RIGHT); hp1.add(main); } else { HorizontalPanel main = new HorizontalPanel(); main.setStyleName(style.indexWrapper()); final Image supportedByIcon = new Image(localResources.supportedBy()); supportedByIcon.setTitle("Supported By"); supportedByIcon.setStyleName(style.link()); supportedByIcon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { EvidenceRelationshipBubble bubble = new EvidenceRelationshipBubble(_this, _domeo, _item, relationship, ""); int x = supportedByIcon.getAbsoluteLeft(); int y = supportedByIcon.getAbsoluteTop(); bubble.show(x, y); } }); main.add(supportedByIcon); main.setCellWidth(supportedByIcon, "22px"); SimplePanel imageWrap = new SimplePanel(); imageWrap.setStyleName(style.imageWrap()); imageWrap.add(img); main.add(imageWrap); //hp1.setCellHorizontalAlignment(img, HasHorizontalAlignment.ALIGN_CENTER); VerticalPanel right = new VerticalPanel(); right.setWidth("100%"); if (image.getLabel() != null && image.getLabel().trim().length() > 0) { HTML title = new HTML("<b>" + image.getLabel() + "</b>"); right.add(title); right.setCellHorizontalAlignment(title, HasHorizontalAlignment.ALIGN_LEFT); } /*else { HTML title = new HTML("title: <b>Title</b>"); right.add(title); right.setCellHorizontalAlignment(title, HasHorizontalAlignment.ALIGN_LEFT); }*/ main.add(right); main.setCellWidth(right, "100%"); final Image removeIcon = new Image(Domeo.resources.deleteLittleIcon()); removeIcon.setStyleName(style.link()); removeIcon.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { //box.setEnabled(false); //_container.addImageAsData(_image); } }); main.add(removeIcon); main.setCellWidth(removeIcon, "16px"); main.setCellHorizontalAlignment(removeIcon, HasHorizontalAlignment.ALIGN_RIGHT); hp1.add(main); if (counter % 2 == 1) { right.addStyleName(style.indexOdd()); } else { right.addStyleName(style.indexEven()); } } vp.add(hp1); }
From source file:org.ned.server.nedadminconsole.client.dialogs.NedUploadDialog.java
License:Open Source License
public NedUploadDialog(String libId, NedDataModel model) { setSize("395px", "147px"); this.model = model; setHTML(NedRes.instance().uploadDlgUploadFile()); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); setWidget(verticalPanel);/*from www . j a v a2 s. c o m*/ verticalPanel.setSize("386px", "100px"); uploadForm = new FormPanel(); uploadForm.setAction("NedFileUploadServlet"); uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART); uploadForm.setMethod(FormPanel.METHOD_POST); verticalPanel.add(uploadForm); uploadForm.setSize("100%", "100%"); VerticalPanel verticalPanel_1 = new VerticalPanel(); uploadForm.setWidget(verticalPanel_1); verticalPanel_1.setSize("100%", "77px"); horizontalPanel_2 = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel_2); horizontalPanel_2.setWidth("100%"); fileUpload = new FileUpload(); horizontalPanel_2.add(fileUpload); horizontalPanel_2.setCellWidth(fileUpload, "100%"); fileUpload.setName("fileUpload"); verticalPanel_1.setCellHorizontalAlignment(fileUpload, HasHorizontalAlignment.ALIGN_CENTER); verticalPanel_1.setCellVerticalAlignment(fileUpload, HasVerticalAlignment.ALIGN_MIDDLE); fileUpload.setSize("100%", "30px"); hiddenLibId = new Hidden("libId"); horizontalPanel_2.add(hiddenLibId); hiddenLibId.setValue(libId); hiddenContentId = new Hidden("contentId"); horizontalPanel_2.add(hiddenContentId); hiddenContentId.setValue(model.getCurrentObject().id); HorizontalPanel horizontalPanel = new HorizontalPanel(); verticalPanel_1.add(horizontalPanel); horizontalPanel.setWidth("100%"); verticalPanel_1.setCellHorizontalAlignment(horizontalPanel, HasHorizontalAlignment.ALIGN_CENTER); Button uploadBtn = new Button(NedRes.instance().uploadDlgUpload()); horizontalPanel.add(uploadBtn); uploadBtn.setWidth("90%"); horizontalPanel.setCellWidth(uploadBtn, "50%"); horizontalPanel.setCellHorizontalAlignment(uploadBtn, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanel.setCellVerticalAlignment(uploadBtn, HasVerticalAlignment.ALIGN_MIDDLE); uploadBtn.addClickHandler(new UploadFileClickHandler()); verticalPanel.setCellVerticalAlignment(uploadBtn, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(uploadBtn, HasHorizontalAlignment.ALIGN_CENTER); closeBtn = new Button(NedRes.instance().close()); horizontalPanel.add(closeBtn); closeBtn.setWidth("90%"); horizontalPanel.setCellWidth(closeBtn, "50%"); horizontalPanel.setCellVerticalAlignment(closeBtn, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel.setCellHorizontalAlignment(closeBtn, HasHorizontalAlignment.ALIGN_CENTER); closeBtn.addClickHandler(new CloseClickHandler()); setPopupPosition(200, 200); uploadForm.addSubmitHandler(new SubmitHandlerUploadFile()); uploadForm.addSubmitCompleteHandler(new SubmitCompleteHandlerUploadFile()); center(); }
From source file:org.ned.server.nedadminconsole.client.widgets.NedItemEditor.java
License:Open Source License
public NedItemEditor(NedDataModel model) { this.model = model; VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT); verticalPanel.setSpacing(8);//from w w w . j av a 2s .co m verticalPanel.setBorderWidth(0); verticalPanel.setSize("400px", "100%"); initWidget(verticalPanel); lblElementInfo = new Label(NedRes.instance().itemEditElementInfo()); lblElementInfo.setStyleName("gwt-Label-element"); verticalPanel.add(lblElementInfo); verticalPanel.setCellVerticalAlignment(lblElementInfo, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellHorizontalAlignment(lblElementInfo, HasHorizontalAlignment.ALIGN_CENTER); lblElementInfo.setSize("100%", ""); Grid gridItemInfo = new Grid(8, 2); gridItemInfo.setCellPadding(10); gridItemInfo.setStyleName("NedItemEditorPanel"); verticalPanel.add(gridItemInfo); verticalPanel.setCellVerticalAlignment(gridItemInfo, HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.setCellWidth(gridItemInfo, "300px"); verticalPanel.setCellHorizontalAlignment(gridItemInfo, HasHorizontalAlignment.ALIGN_CENTER); gridItemInfo.setSize("392px", "470px"); Label lblNewLabel_3 = new Label(NedRes.instance().id() + ":"); gridItemInfo.setWidget(0, 0, lblNewLabel_3); gridItemInfo.getCellFormatter().setWidth(0, 0, "30%"); textBoxId = new TextBox(); gridItemInfo.setWidget(0, 1, textBoxId); textBoxId.setWidth("97%"); gridItemInfo.getCellFormatter().setWidth(0, 1, ""); textBoxId.setReadOnly(true); Label lblNewLabel_5 = new Label(NedRes.instance().itemEditParentId() + ":"); gridItemInfo.setWidget(1, 0, lblNewLabel_5); gridItemInfo.getCellFormatter().setWidth(1, 0, "30%"); textBoxIdParent = new TextBox(); gridItemInfo.setWidget(1, 1, textBoxIdParent); gridItemInfo.getCellFormatter().setWidth(1, 1, ""); textBoxIdParent.setMaxLength(20); textBoxIdParent.setReadOnly(true); textBoxIdParent.setWidth("97%"); Label lblNewLabel = new Label(NedRes.instance().itemEditTitle() + ":"); gridItemInfo.setWidget(2, 0, lblNewLabel); textBoxTitle = new TextBox(); gridItemInfo.setWidget(2, 1, textBoxTitle); textBoxTitle.setMaxLength(40); textBoxTitle.setWidth("97%"); Label lblNewLabel_1 = new Label(NedRes.instance().itemEditType() + ":"); gridItemInfo.setWidget(3, 0, lblNewLabel_1); textBoxType = new TextBox(); gridItemInfo.setWidget(3, 1, textBoxType); textBoxType.setReadOnly(true); textBoxType.setWidth("97%"); Label lblNewLabel_2 = new Label(NedRes.instance().itemEditDescription() + ":"); gridItemInfo.setWidget(4, 0, lblNewLabel_2); textAreaDescription = new TextArea(); gridItemInfo.setWidget(4, 1, textAreaDescription); textAreaDescription.setVisibleLines(4); textAreaDescription.setCharacterWidth(30); textAreaDescription.setSize("97%", ""); Label lblKeywords = new Label(NedRes.instance().itemEditKeywords() + ":"); gridItemInfo.setWidget(5, 0, lblKeywords); textBoxKeywords = new TextBox(); gridItemInfo.setWidget(5, 1, textBoxKeywords); textBoxKeywords.setVisibleLength(30); textBoxKeywords.setWidth("97%"); Label lblExternalLinks = new Label(NedRes.instance().itemEditExternalLinks() + ":"); gridItemInfo.setWidget(6, 0, lblExternalLinks); textAreaLinks = new TextArea(); gridItemInfo.setWidget(6, 1, textAreaLinks); textAreaLinks.setCharacterWidth(30); textAreaLinks.setWidth("97%"); labelFile = new Label(NedRes.instance().itemFile() + ":"); gridItemInfo.setWidget(7, 0, labelFile); horizontalPanelFile = new HorizontalPanel(); horizontalPanelFile.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanelFile.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); gridItemInfo.setWidget(7, 1, horizontalPanelFile); horizontalPanelFile.setWidth("100%"); gridItemInfo.getCellFormatter().setWidth(7, 1, ""); textBoxFile = new TextBox(); horizontalPanelFile.add(textBoxFile); horizontalPanelFile.setCellWidth(textBoxFile, "60%"); textBoxFile.setReadOnly(true); textBoxFile.setWidth("147px"); buttonUpload = new Button(); horizontalPanelFile.add(buttonUpload); horizontalPanelFile.setCellHorizontalAlignment(buttonUpload, HasHorizontalAlignment.ALIGN_RIGHT); horizontalPanelFile.setCellWidth(buttonUpload, "40%"); buttonUpload.setText(NedRes.instance().uploadDlgUpload()); buttonUpload.addClickHandler(new CommandUploadFile()); buttonUpload.setWidth("100%"); gridItemInfo.getCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_LEFT); gridItemInfo.getCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_LEFT); gridItemInfo.getCellFormatter().setHorizontalAlignment(3, 0, HasHorizontalAlignment.ALIGN_LEFT); gridItemInfo.getCellFormatter().setHorizontalAlignment(4, 0, HasHorizontalAlignment.ALIGN_LEFT); gridItemInfo.getCellFormatter().setHorizontalAlignment(5, 0, HasHorizontalAlignment.ALIGN_LEFT); gridItemInfo.getCellFormatter().setHorizontalAlignment(6, 0, HasHorizontalAlignment.ALIGN_LEFT); gridItemInfo.getCellFormatter().setHorizontalAlignment(7, 0, HasHorizontalAlignment.ALIGN_LEFT); gridItemInfo.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT); gridItemInfo.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_LEFT); gridItemInfo.getCellFormatter().setHorizontalAlignment(4, 1, HasHorizontalAlignment.ALIGN_LEFT); textAreaLinks.getElement().setAttribute("wrap", "off"); HorizontalPanel horizontalPanel_4 = new HorizontalPanel(); horizontalPanel_4.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); verticalPanel.add(horizontalPanel_4); verticalPanel.setCellVerticalAlignment(horizontalPanel_4, HasVerticalAlignment.ALIGN_MIDDLE); horizontalPanel_4.setWidth("100%"); Button buttonSave = new Button(""); buttonSave.setText(NedRes.instance().save()); horizontalPanel_4.add(buttonSave); horizontalPanel_4.setCellWidth(buttonSave, "25%"); buttonSave.addClickHandler(new UpdateItemCommand()); buttonSave.setWidth("100%"); Button buttonDelete = new Button(""); buttonDelete.setText(NedRes.instance().delete()); buttonDelete.addClickHandler(new CommandDeleteItem()); horizontalPanel_4.add(buttonDelete); horizontalPanel_4.setCellHorizontalAlignment(buttonDelete, HasHorizontalAlignment.ALIGN_RIGHT); buttonDelete.setWidth("100%"); horizontalPanel_4.setCellWidth(buttonDelete, "25%"); // decoratorPanel.add(verticalPanel); setVisible(false); }
From source file:org.ned.server.nedadminconsole.client.widgets.NedLanguageWidget.java
License:Open Source License
public NedLanguageWidget() { HorizontalPanel horizontalPanelOuter = new HorizontalPanel(); horizontalPanelOuter.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setSpacing(10);/*from w ww . j a v a2 s . c o m*/ initWidget(horizontalPanelOuter); horizontalPanelOuter.setWidth("100%"); horizontalPanelOuter.add(verticalPanel); horizontalPanelOuter.setCellHorizontalAlignment(verticalPanel, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanelOuter.setCellWidth(verticalPanel, "95%"); verticalPanel.setSize("60%", "95px"); Label labelUploadedLang = new Label(NedRes.instance().langUploaded()); verticalPanel.add(labelUploadedLang); gridLanguages = new Grid(1, 4); gridLanguages.setCellSpacing(13); gridLanguages.setStyleName("NedUserManagementGrid"); gridLanguages.setBorderWidth(1); verticalPanel.add(gridLanguages); verticalPanel.setCellHorizontalAlignment(gridLanguages, HasHorizontalAlignment.ALIGN_CENTER); gridLanguages.setWidth("100%"); verticalPanel.setCellWidth(gridLanguages, "100%"); Button buttonUploadLang = new Button(NedRes.instance().langAddLanguage()); buttonUploadLang.addClickHandler(new ClickHandlerUploadLanguage()); verticalPanel.add(buttonUploadLang); buttonUploadLang.setWidth("80"); }
From source file:org.ned.server.nedadminconsole.client.widgets.NedUserManagementWidget.java
License:Open Source License
public NedUserManagementWidget() { HorizontalPanel horizontalPanelOuter = new HorizontalPanel(); horizontalPanelOuter.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.setSpacing(10);/*w ww. ja v a 2 s . c o m*/ initWidget(horizontalPanelOuter); horizontalPanelOuter.setWidth("100%"); horizontalPanelOuter.add(verticalPanel); horizontalPanelOuter.setCellHorizontalAlignment(verticalPanel, HasHorizontalAlignment.ALIGN_CENTER); horizontalPanelOuter.setCellWidth(verticalPanel, "95%"); verticalPanel.setSize("95%", "95px"); gridUsers = new Grid(1, 4); gridUsers.setCellSpacing(13); gridUsers.setStyleName("NedUserManagementGrid"); gridUsers.setBorderWidth(1); verticalPanel.add(gridUsers); verticalPanel.setCellHorizontalAlignment(gridUsers, HasHorizontalAlignment.ALIGN_CENTER); gridUsers.setWidth("100%"); verticalPanel.setCellWidth(gridUsers, "100%"); labelUsername = new Label(NedRes.instance().username()); labelUsername.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); labelUsername.setStyleName("NedUserManagementLabels"); gridUsers.setWidget(0, 0, labelUsername); labelUsername.setWidth("85%"); gridUsers.getCellFormatter().setWidth(0, 0, "36%"); labelPassword = new Label(NedRes.instance().userDlgPassword()); labelPassword.setStyleName("NedUserManagementLabels"); gridUsers.setWidget(0, 1, labelPassword); labelPassword.setWidth("85%"); gridUsers.getCellFormatter().setHeight(0, 1, ""); gridUsers.getCellFormatter().setWidth(0, 1, "36%"); gridUsers.getCellFormatter().setHorizontalAlignment(0, 1, HasHorizontalAlignment.ALIGN_CENTER); gridUsers.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT); HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); verticalPanel.add(horizontalPanel); verticalPanel.setCellWidth(horizontalPanel, "100%"); horizontalPanel.setWidth("100%"); Button buttonAddUser = new Button(""); buttonAddUser.addClickHandler(new ClickHandlerAddUser()); buttonAddUser.setText(NedRes.instance().userDlgAddNewUser()); horizontalPanel.add(buttonAddUser); horizontalPanel.setCellWidth(buttonAddUser, "33%"); buttonAddUser.setWidth("100%"); Button buttonSaveModifications = new Button(""); buttonSaveModifications.addClickHandler(new ClickHandlerSaveModifications()); buttonSaveModifications.setText(NedRes.instance().userDlgSaveModifications()); horizontalPanel.add(buttonSaveModifications); horizontalPanel.setCellWidth(buttonSaveModifications, "33%"); buttonSaveModifications.setWidth("100%"); }
From source file:org.nsesa.editor.gwt.dialog.client.ui.handler.common.authors.AuthorsPanelController.java
License:EUPL
/** * Draw the selected persons using some quick & dirty panel with removal button. *///from w w w . j a v a 2s . c o m private void drawPersons() { view.getAuthorsPanel().clear(); for (final AuthorController authorController : selectedPersons) { final Button removeButton = new Button("x", new ClickHandler() { @Override public void onClick(ClickEvent event) { removePerson(authorController.getPerson()); } }); HorizontalPanel holder = new HorizontalPanel(); holder.add(authorController.getView()); holder.setWidth("100%"); holder.add(removeButton); holder.setCellHorizontalAlignment(authorController.getView(), HasHorizontalAlignment.ALIGN_LEFT); holder.setCellHorizontalAlignment(removeButton, HasHorizontalAlignment.ALIGN_RIGHT); view.getAuthorsPanel().add(holder); widgetDragController.makeDraggable(holder, authorController.getView().asWidget()); } }
From source file:org.olanto.TranslationText.client.BitextWidget.java
License:Open Source License
private void SetHeader() { initWidget(mainWidget);/*w ww. j ava 2s. c o m*/ mainWidget.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); mainWidget.add(textAreaGrid); textAreaGrid.setStyleName("headerNav"); hS.add(PreviousHitS); hS.add(NextHitS); hS.add(AlignS); hS.add(schS); hT.add(PreviousHitT); hT.add(NextHitT); hT.add(AlignT); hT.add(schT); if (GuiConstant.ORIGINAL_ON) { hS.add(orgnS); hT.add(orgnT); } if (GuiConstant.SAVE_ON) { hS.add(save); } hS.setVisible(true); hT.setVisible(true); textAreaGrid.setWidget(0, 0, hS); textAreaGrid.setWidget(0, 2, hT); textAreaGrid.setWidget(1, 0, sourceTextArea); textAreaGrid.setWidget(1, 2, targetTextArea); setbuttonstyle(NextHitS, NextHitS.getText().length() * CHAR_W, H_Unit); setbuttonstyle(PreviousHitS, PreviousHitS.getText().length() * CHAR_W, H_Unit); setbuttonstyle(AlignS, AlignS.getText().length() * CHAR_W, H_Unit); setbuttonstyle(schS, schS.getText().length() * CHAR_W, H_Unit); setbuttonstyle(orgnS, orgnS.getText().length() * CHAR_W, H_Unit); setbuttonstyle(save, save.getText().length() * CHAR_W, H_Unit); setbuttonstyle(NextHitT, NextHitT.getText().length() * CHAR_W, H_Unit); setbuttonstyle(PreviousHitT, PreviousHitT.getText().length() * CHAR_W, H_Unit); setbuttonstyle(AlignT, AlignT.getText().length() * CHAR_W, H_Unit); setbuttonstyle(schT, schT.getText().length() * CHAR_W, H_Unit); setbuttonstyle(orgnT, orgnT.getText().length() * CHAR_W, H_Unit); sourceTextArea.setCursorPos(0); sourceTextArea.setVisible(true); sourceTextArea.setEnabled(true); sourceTextArea.setReadOnly(true); sourceTextArea.setStyleName("gwt-Textarea"); sourceTextArea.getElement().setAttribute("spellCheck", "false"); sourceTextArea.setCharacterWidth(MainEntryPoint.IMeasures.TA_TEXTAREA_WIDTH); sourceTextArea.setVisibleLines(MainEntryPoint.IMeasures.TA_TEXTAREA_HEIGHT); sourceTextArea.setHeight("" + pixS * MainEntryPoint.IMeasures.TA_TEXTAREA_HEIGHT + "px"); targetTextArea.setCursorPos(0); targetTextArea.setVisible(true); targetTextArea.setEnabled(true); targetTextArea.setReadOnly(true); targetTextArea.setStyleName("gwt-Textarea"); targetTextArea.getElement().setAttribute("spellCheck", "false"); targetTextArea.setCharacterWidth(MainEntryPoint.IMeasures.TA_TEXTAREA_WIDTH); targetTextArea.setVisibleLines(MainEntryPoint.IMeasures.TA_TEXTAREA_HEIGHT); targetTextArea.setHeight("" + pixS * MainEntryPoint.IMeasures.TA_TEXTAREA_HEIGHT + "px"); pp.setAnimationEnabled(true); pp.setAutoHideEnabled(true); pp.setStyleName("focusPanel"); pp.add(new HTML(" ")); ClickHandler hidepanT = new ClickHandler() { @Override public void onClick(ClickEvent event) { pp.hide(); sourceTextArea.setFocus(true); } }; pp.sinkEvents(Event.ONCLICK); pp.addHandler(hidepanT, ClickEvent.getType()); pSch.setAnimationEnabled(true); pSch.setAutoHideEnabled(true); pSch.setStyleName("searchPanel"); VerticalPanel vpSch = new VerticalPanel(); HorizontalPanel hpSch = new HorizontalPanel(); vpSch.setWidth("400px"); hpSch.setWidth("400px"); vpSch.add(SchArea); vpSch.setCellHorizontalAlignment(SchArea, HorizontalPanel.ALIGN_CENTER); vpSch.add(hpSch); hpSch.add(SchBtn); hpSch.setCellHorizontalAlignment(SchBtn, HorizontalPanel.ALIGN_LEFT); hpSch.add(CclBtn); hpSch.setCellHorizontalAlignment(SchBtn, HorizontalPanel.ALIGN_RIGHT); pSch.add(vpSch); setbuttonstyle(SchBtn, SchBtn.getText().length() * CHAR_W, H_Unit); setbuttonstyle(CclBtn, CclBtn.getText().length() * CHAR_W, H_Unit); SchArea.setWidth("400px"); SchArea.setStyleName("gwt-srch-text"); }
From source file:org.olanto.TranslationText.client.QuoteBitextWidget.java
License:Open Source License
private void SetHeader() { initWidget(mainWidget);/*from w w w . j av a 2s . co m*/ mainWidget.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER); mainWidget.add(textAreaGrid); textAreaGrid.setStyleName("headerNav"); hS.add(PreviousHitS); hS.add(NextHitS); hS.add(AlignS); hS.add(schS); hT.add(PreviousHitT); hT.add(NextHitT); hT.add(AlignT); hT.add(schT); if (GuiConstant.ORIGINAL_ON) { hS.add(orgnS); hT.add(orgnT); } if (GuiConstant.SAVE_ON) { hS.add(save); } hS.setVisible(true); hT.setVisible(true); textAreaGrid.setWidget(0, 0, hS); textAreaGrid.setWidget(0, 2, hT); textAreaGrid.setWidget(1, 0, sourceTextArea); textAreaGrid.setWidget(1, 2, targetTextArea); setbuttonstyle(NextHitS, NextHitS.getText().length() * CHAR_W, H_Unit); setbuttonstyle(PreviousHitS, PreviousHitS.getText().length() * CHAR_W, H_Unit); setbuttonstyle(AlignS, AlignS.getText().length() * CHAR_W, H_Unit); setbuttonstyle(schS, schS.getText().length() * CHAR_W, H_Unit); setbuttonstyle(orgnS, orgnS.getText().length() * CHAR_W, H_Unit); setbuttonstyle(save, save.getText().length() * CHAR_W, H_Unit); setbuttonstyle(NextHitT, NextHitT.getText().length() * CHAR_W, H_Unit); setbuttonstyle(PreviousHitT, PreviousHitT.getText().length() * CHAR_W, H_Unit); setbuttonstyle(AlignT, AlignT.getText().length() * CHAR_W, H_Unit); setbuttonstyle(schT, schT.getText().length() * CHAR_W, H_Unit); setbuttonstyle(orgnT, orgnT.getText().length() * CHAR_W, H_Unit); sourceTextArea.setCursorPos(0); sourceTextArea.setVisible(true); sourceTextArea.setEnabled(true); sourceTextArea.setReadOnly(true); sourceTextArea.setStyleName("gwt-Textarea"); sourceTextArea.getElement().setAttribute("spellCheck", "false"); sourceTextArea.setCharacterWidth(MainEntryPoint.IMeasures.TA_TEXTAREA_WIDTH); sourceTextArea.setVisibleLines(MainEntryPoint.IMeasures.QD_TEXTAREA_HEIGHT); sourceTextArea.setHeight("" + pixS * MainEntryPoint.IMeasures.QD_TEXTAREA_HEIGHT + "px"); targetTextArea.setCursorPos(0); targetTextArea.setVisible(true); targetTextArea.setEnabled(true); targetTextArea.setReadOnly(true); targetTextArea.setStyleName("gwt-Textarea"); targetTextArea.getElement().setAttribute("spellCheck", "false"); targetTextArea.setCharacterWidth(MainEntryPoint.IMeasures.TA_TEXTAREA_WIDTH); targetTextArea.setVisibleLines(MainEntryPoint.IMeasures.QD_TEXTAREA_HEIGHT); targetTextArea.setHeight("" + pixS * MainEntryPoint.IMeasures.QD_TEXTAREA_HEIGHT + "px"); pp.setAnimationEnabled(true); pp.setAutoHideEnabled(true); pp.setStyleName("focusPanel"); pp.add(new HTML(" ")); ClickHandler hidepanT = new ClickHandler() { @Override public void onClick(ClickEvent event) { pp.hide(); sourceTextArea.setFocus(true); } }; pp.sinkEvents(Event.ONCLICK); pp.addHandler(hidepanT, ClickEvent.getType()); pSch.setAnimationEnabled(true); pSch.setAutoHideEnabled(true); pSch.setStyleName("searchPanel"); VerticalPanel vpSch = new VerticalPanel(); HorizontalPanel hpSch = new HorizontalPanel(); vpSch.setWidth("400px"); hpSch.setWidth("400px"); vpSch.add(SchArea); vpSch.setCellHorizontalAlignment(SchArea, HorizontalPanel.ALIGN_CENTER); vpSch.add(hpSch); hpSch.add(SchBtn); hpSch.setCellHorizontalAlignment(SchBtn, HorizontalPanel.ALIGN_LEFT); hpSch.add(CclBtn); hpSch.setCellHorizontalAlignment(SchBtn, HorizontalPanel.ALIGN_RIGHT); pSch.add(vpSch); setbuttonstyle(SchBtn, SchBtn.getText().length() * CHAR_W, H_Unit); setbuttonstyle(CclBtn, CclBtn.getText().length() * CHAR_W, H_Unit); SchArea.setWidth("400px"); SchArea.setStyleName("gwt-srch-text"); }