List of usage examples for com.google.gwt.user.client.ui Widget addStyleName
public void addStyleName(String style)
From source file:com.threerings.gwt.ui.FloatPanel.java
License:Open Source License
@Override // from FlowPanel public void insert(Widget widget, int beforeIndex) { widget.addStyleName("fpFloatLeft"); super.insert(widget, beforeIndex); }
From source file:com.threerings.gwt.ui.InlinePanel.java
License:Open Source License
@Override public void add(Widget widget) { widget.addStyleName("inline" + ((getWidgetCount() > 0) ? "L" : "")); super.add(widget); }
From source file:com.threerings.gwt.ui.InlinePanel.java
License:Open Source License
@Override public void insert(Widget widget, int beforeIndex) { if (beforeIndex == 0) { if (getWidgetCount() > 0) { getWidget(0).removeStyleName("inline"); getWidget(0).addStyleName("inlineL"); }/*from www.jav a 2s . c o m*/ widget.addStyleName("inline"); } else { widget.addStyleName("inlineL"); } super.insert(widget, beforeIndex); }
From source file:com.threerings.gwt.ui.PagedWidget.java
License:Open Source License
protected void displayResults(int start, int count, List<T> list) { clear();//from w w w . j av a 2 s . c o m if (_navLoc != NAV_ON_BOTTOM && displayNavi(_lastItem)) { add(_controls); } add((list.size() == 0) ? createEmptyContents() : createContents(start, count, list)); if (_navLoc != NAV_ON_TOP && displayNavi(_lastItem)) { add(_controls); } else { Widget cap = new Label(""); cap.addStyleName("EndCap"); add(cap); } _prev.setEnabled(start > 0); _next.setEnabled(_lastItem < 0 || start + count < _lastItem); if (_lastItem != 0) { int shown = Math.max(list.size(), count); configureNavi(_controls, 0, _infoCol, start, shown, _lastItem); } else { _controls.setHTML(0, _infoCol, " "); } }
From source file:com.totsp.gwittir.client.ui.util.ChangeMarkerListener.java
License:Open Source License
static void showMarker(Widget widget) { widget.addStyleName("gwittir-ChangeMarker"); }
From source file:com.webgocommerce.client.model.ContentForm.java
public void addWidget(String text, Widget widget) { MyResource.INSTANCE.getStlModel().ensureInjected(); flexTable.setText(row, 0, text);/*from w w w. java 2 s. c om*/ flexTable.setWidget(row, 1, widget); FlexCellFormatter cellFormatter = flexTable.getFlexCellFormatter(); cellFormatter.setWidth(row, 0, "30%"); cellFormatter.setWidth(row, 1, "70%"); cellFormatter.getElement(row, 1).getStyle().setPadding(10, Style.Unit.PX); cellFormatter.getElement(row, 1).getStyle().setBackgroundColor("#fff"); row++; widget.addStyleName(MyResource.INSTANCE.getStlModel().widgetContentForm()); }
From source file:com.xpn.xwiki.watch.client.ui.articles.ArticleListWidget.java
License:Open Source License
protected Panel getTitlePanel(final FeedArticle article, final Widget articlePanel, final Widget contentZonePanel) { FlowPanel p = new FlowPanel(); p.setStyleName(watch.getStyleName("article", "title")); HTML titleLabel = new HTML(article.getTitle()); p.add(titleLabel);//from w ww. ja v a 2 s . com titleLabel.addClickListener(new ClickListener() { public void onClick(Widget widget) { ArticleListWidget.this.showContentPanel(!contentZonePanel.isVisible(), (ComplexPanel) contentZonePanel, article); resizeWindow(); watch.getDataManager().updateArticleReadStatus(article, new AsyncCallback() { public void onFailure(Throwable throwable) { } public void onSuccess(Object object) { articlePanel.removeStyleName(watch.getStyleName("article", "unread")); articlePanel.addStyleName(watch.getStyleName("article", "read")); } }); } }); return p; }
From source file:com.xpn.xwiki.watch.client.ui.filterbar.TagCloudWidget.java
License:Open Source License
public void setActiveTags(Object[] tags) { Iterator it = tagsLink.values().iterator(); while (it.hasNext()) { ((Widget) it.next()).removeStyleName(watch.getStyleName("tagscloud", "active")); }/*from w ww .j a v a 2 s .co m*/ for (int i = 0; i < tags.length; i++) { Widget tag = (Widget) tagsLink.get(tags[i]); if (tag != null) { tag.addStyleName(watch.getStyleName("tagscloud", "active")); } } }
From source file:cz.incad.kramerius.editor.client.view.EditorViewImpl.java
License:Open Source License
@Override public void setLanguages(String[] languages, int selected) { if (languages == null || languages.length < 2) { languagesClickable.setVisible(false); return;/* www . j a v a 2 s.c o m*/ } languagesPopup = new PopupPanel(true, false); VerticalPanel vp = new VerticalPanel(); vp.setSpacing(2); for (int i = 0; i < languages.length; i++) { String language = languages[i]; Widget item; if (i == selected) { item = new Label(language + " \u00AB"); item.addStyleName("languageMenuItemCurrent"); } else { final Anchor anchor = new Anchor(language); anchor.getElement().setPropertyInt("LanguageIndex", i); anchor.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { int index = anchor.getElement().getPropertyInt("LanguageIndex"); callback.onLanguagesClick(index); languagesPopup.hide(); } }); item = anchor; item.addStyleName("languageMenuItem"); } vp.add(item); } languagesPopup.setWidget(vp); }
From source file:cz.incad.kramerius.editor.client.view.SaveViewImpl.java
License:Open Source License
@Override public void setSaveables(List<T> saveables) { this.saveablePanel.clear(); int saveablesSize = saveables.size(); if (saveablesSize == 0) { this.saveablePanel.add(new Label(I18N.nothingToSaveLabel())); this.okButton.setEnabled(false); // for (int i = 0; i < 10; i++) { // CheckBox checkBox = new CheckBox("Very long CheckBox Very long CheckBox"); // checkBox.setValue(Boolean.valueOf(true)); // checkBox.addStyleName(style.listItem()); // String styleName = saveablePanel.getWidgetCount() % 2 == 0 // ? style.listItemOdd(): style.listItemEven(); // checkBox.addStyleName(styleName); // this.saveablePanel.add(checkBox); // } } else {//from w w w . j a v a2 s . c o m this.okButton.setEnabled(true); } for (T saveable : saveables) { Widget saveableWidget = saveablesSize == 1 ? createSaveableLabel(saveable) : createSaveableCheckBox(saveable); saveableWidget.addStyleName(style.listItem()); String styleName = saveablePanel.getWidgetCount() % 2 == 0 ? style.listItemOdd() : style.listItemEven(); saveableWidget.addStyleName(styleName); this.saveablePanel.add(saveableWidget); } this.saveables = saveables; }