List of usage examples for com.google.gwt.user.client.ui Widget addStyleName
public void addStyleName(String style)
From source file:com.codenvy.editor.client.workspace.WorkspaceViewImpl.java
License:Apache License
/** {@inheritDoc} */ @Override// w ww . jav a 2 s. c o m public void selectErrorElement(@Nullable String elementId) { Widget element = elements.get(elementId); if (element != null) { element.addStyleName(resources.editorCSS().errorElement()); } }
From source file:com.codenvy.ide.client.Controllers.NoInsertAtEndIndexedDropController.java
License:Open Source License
@Override public void onDrop(DragContext context) { ElementCount++;/*from w ww . j a v a 2 s.com*/ x = x + 100; for (Widget widget : context.selectedWidgets) { Image newDroppedElem = new Image(); newDroppedElem.getElement().setId("dragged" + ElementCount); newDroppedElem.getElement().setPropertyBoolean("draggable", false); newDroppedElem.addClickHandler(ESBEditor.clickHandler); widget.removeStyleName("gwt-Image dragdrop-draggable dragdrop-handle dragdrop-dragging"); widget.addStyleName("gwt-Image dragdrop-draggable dragdrop-handle"); RootPanel.get("draggablePanel").add(widget); RootPanel.get("droppablePanel").remove(widget); String thisId = widget.getElement().getId(); if (thisId.equalsIgnoreCase("callMediator")) { newDroppedElem.setResource(DropCallImage); } if (thisId.equalsIgnoreCase("callTemplateMediator")) { newDroppedElem.setResource(DropCallTempImage); } if (thisId.equalsIgnoreCase("logMediator")) { newDroppedElem.setResource(DropLogImage); } if (thisId.equalsIgnoreCase("dropMediator")) { newDroppedElem.setResource(DropDropImage); } if (thisId.equalsIgnoreCase("storeMediator")) { newDroppedElem.setResource(DropStoreImage); } if (thisId.equalsIgnoreCase("sendMediator")) { newDroppedElem.setResource(DropSendImage); } if (thisId.equalsIgnoreCase("cloneMediator")) { newDroppedElem.setResource(DropCloneImage); } if (thisId.equalsIgnoreCase("throttleMediator")) { newDroppedElem.setResource(DropThrottleImage); } if (thisId.equalsIgnoreCase("respondMediator")) { newDroppedElem.setResource(DropRespondImage); } if (thisId.equalsIgnoreCase("propertyMediator")) { newDroppedElem.setResource(DropPropertyImage); } if (thisId.equalsIgnoreCase("paylfacMediator")) { newDroppedElem.setResource(DropPayloadFactoryImage); } //ESBEditor.WidgetMap.put(ElementCount, newDroppedElem.getElement().getId()); RootPanel.get("window2").add(newDroppedElem); RootPanel.get("window2").setWidgetPosition(newDroppedElem, x, y); newDroppedElem = null; RootPanel.get("window2").getAbsoluteLeft(); } //setMouseEvent(null); /* int PrevCount = ElementCount - 1; String prevElem = "dragged" + PrevCount; String currElem = "dragged" + ElementCount; //ESBEditor.gwtjsPlumbDemo(prevElem, currElem, ElementCount);*/ super.onDrop(context); }
From source file:com.codenvy.redhat.plugin.quick.start.ide.panel.DocsViewPartImpl.java
License:Open Source License
/** Create guide section. */ private Widget createSection(Project project, SectionDto sectionDto) { if (sectionDto.getTitle() == null) { Widget paragraphsWidget = createParagraphsWidget(project, sectionDto.getParagraphs()); paragraphsWidget.addStyleName(guideResources.getGuideStyle().chapterWithoutTitle()); return paragraphsWidget; }/*from w w w . j a v a 2 s . c o m*/ // create section with title DisclosurePanel advancedDisclosure = new DisclosurePanel(sectionDto.getTitle()); advancedDisclosure.addStyleName(guideResources.getGuideStyle().fullWidthContainer()); advancedDisclosure.setContent(createParagraphsWidget(project, sectionDto.getParagraphs())); return advancedDisclosure; }
From source file:com.dianaui.universal.core.client.ui.base.form.FormElementContainer.java
License:Apache License
@Override public void add(final Widget w) { if (w instanceof ListBox || w instanceof FileUpload) { w.addStyleName(Styles.FORM_CONTROL); }//from w w w . j a v a 2 s . c o m add(w, (Element) getElement()); }
From source file:com.dimdim.conference.ui.common.client.util.CommonModalDialog.java
License:Open Source License
public void drawDialog() { this.defaultCloseListener = new ClickListener() { public void onClick(Widget sender) { hide();/*from ww w .j av a 2 s. c o m*/ } }; closeButton = new Button(closeButtonText, this.defaultCloseListener); // DomUtil.setId(this, "dialog-styled"); vp = new VerticalPanel(); // setWidget(rp); vp.setStyleName("common-dialog-outer-panel"); // Window.alert("1"); if (this.closeListener != null) { this.closeButton.addClickListener(this.closeListener); } closeButton.setStyleName("dm-popup-close-button"); buttonPanel.add(closeButton, DockPanel.EAST); buttonPanel.setSpacing(0); HTML filler1 = new HTML(" "); buttonPanel.add(filler1, DockPanel.EAST); // Window.alert("2"); footerButtons = this.getFooterButtons(); if (footerButtons != null) { int size = footerButtons.size(); for (int i = 0; i < size; i++) { Button button = (Button) footerButtons.elementAt(i); buttonPanel.add(button, DockPanel.EAST); HTML filler2 = new HTML(" "); buttonPanel.add(filler2, DockPanel.EAST); } } // Window.alert("3"); this.messageLabel.setStyleName("common-text"); this.messageLabel.addStyleName("dialog-message-label"); buttonPanel.add(this.messageLabel, DockPanel.WEST); buttonPanel.setCellVerticalAlignment(this.messageLabel, VerticalPanel.ALIGN_MIDDLE); buttonPanel.setCellWidth(this.messageLabel, "100%"); Widget c = getContent(); if (this.dialogName != null) { // Window.alert("4"); // Create a width adjustment panel. String widthStyle = this.dialogName + "-dialog-width"; String heightStyle1 = this.dialogName + "-dialog-height-one"; String heightStyle2 = this.dialogName + "-dialog-height-two"; String contentWidthStyle = this.dialogName + "-dialog-content"; c.addStyleName(contentWidthStyle); upperPanel = new HorizontalPanel(); HTML upperLeftBar = new HTML(" "); upperLeftBar.setStyleName(heightStyle1); upperPanel.add(upperLeftBar); upperPanel.add(c); upperPanel.setCellWidth(c, "100%"); upperPanel.setCellVerticalAlignment(c, VerticalPanel.ALIGN_MIDDLE); HorizontalPanel lowerPanel = new HorizontalPanel(); lowerPanel.setStyleName(widthStyle); HTML lowerLeftBar = new HTML(" "); lowerLeftBar.setStyleName(heightStyle2); lowerPanel.add(lowerLeftBar); lowerPanel.add(buttonPanel); lowerPanel.setCellWidth(buttonPanel, "100%"); lowerPanel.setCellHorizontalAlignment(buttonPanel, HorizontalPanel.ALIGN_RIGHT); lowerPanel.setCellVerticalAlignment(buttonPanel, VerticalPanel.ALIGN_MIDDLE); // Window.alert("5"); vp.add(upperPanel); vp.add(lowerPanel); } else { // Window.alert("6"); vp.add(c); vp.setCellWidth(c, "100%"); vp.add(buttonPanel); vp.setCellWidth(buttonPanel, "100%"); vp.setCellHorizontalAlignment(buttonPanel, HorizontalPanel.ALIGN_RIGHT); // Window.alert("7"); } // RoundedPanel rp = new RoundedPanel(vp); // rp.setStyleName("common-dialog-rounded-corner-panel"); // Window.alert("8"); scrollPanel.add(vp); add(scrollPanel); /* FocusWidget fw = getFocusWidget(); if (fw != null) { this.getFocusModel().add(fw); } else { Window.alert("No focus widget provided"); } */ this.setFocusModel(new FocusModel() { public HasFocus getFocusWidget() { return getDmFocusModel(); } }); DmGlassPanel dgp = new DmGlassPanel(this); dgp.show(); // show(); }
From source file:com.dimdim.conference.ui.common.client.util.LabelHoverStyler.java
License:Open Source License
public void onMouseEnter(Widget sender) { if (sender != null) { sender.removeStyleName(normalStyle); sender.addStyleName(hoverStyle); }// w w w. j av a 2s. c om }
From source file:com.dimdim.conference.ui.common.client.util.LabelHoverStyler.java
License:Open Source License
public void onMouseLeave(Widget sender) { if (sender != null) { sender.removeStyleName(hoverStyle); sender.addStyleName(normalStyle); }// w ww . j ava 2s. co m }
From source file:com.epam.feel.client.ui.util.gwtupload.FixedSingleUploader.java
License:Apache License
/** * This constructor allows to use an existing form panel. * //from w ww . ja v a2 s. co m * @param type * file input to use * @param status * Customized status widget to use * @param submitButton * Customized button which submits the form * @param form * Customized form panel */ public FixedSingleUploader(FileInputType type, IUploadStatus status, Widget submitButton, FormPanel form) { super(type, form); final FixedUploader thisInstance = this; if (status == null) { status = new BaseUploadStatus(); super.add(status.getWidget()); } super.setStatusWidget(status); this.button = submitButton; if (submitButton != null) { submitButton.addStyleName("submit"); if (submitButton instanceof HasClickHandlers) { ((HasClickHandlers) submitButton).addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { thisInstance.submit(); } }); } if (submitButton instanceof HasText) { ((HasText) submitButton).setText(I18N_CONSTANTS.uploaderSend()); } // The user could have attached the button anywhere in the page. if (!submitButton.isAttached()) { super.add(submitButton); } } }
From source file:com.ephesoft.dcma.gwt.admin.bm.client.presenter.plugin.KV_PP_ConfigPresenter.java
License:Open Source License
private void enableButtonCSS(Widget... widgets) { for (Widget widget : widgets) { widget.removeStyleName(AdminConstants.DISABLED_BUTTON_STYLE); widget.addStyleName(AdminConstants.BUTTON_STYLE); }// w w w. j a v a 2s. co m }
From source file:com.ephesoft.dcma.gwt.admin.bm.client.presenter.plugin.KV_PP_ConfigPresenter.java
License:Open Source License
private void disableButtonCSS(Widget... widgets) { for (Widget widget : widgets) { widget.removeStyleName(AdminConstants.BUTTON_STYLE); widget.addStyleName(AdminConstants.DISABLED_BUTTON_STYLE); }/*from w w w.j av a2 s .c om*/ }