List of usage examples for com.google.gwt.dom.client LIElement setInnerText
@Override
public void setInnerText(String text)
From source file:fr.putnami.pwt.core.widget.client.ErrorGroup.java
License:Open Source License
@Override public void redraw() { this.getElement().removeAllChildren(); for (Error error : this.errors) { LIElement errorElement = Document.get().createLIElement(); errorElement.setInnerText(error.getMessageKey()); this.getElement().appendChild(errorElement); }// w ww .j av a 2 s .c o m }
From source file:fr.putnami.pwt.core.widget.client.InputDatePicker.java
License:Open Source License
private void openMonthOfYear(int year) { String yearString = String.valueOf(year); this.monthPickerUlMonthElement.removeFromParent(); for (int i = 0; i < this.monthPickerInner.getChildCount(); i++) { Element child = (Element) this.monthPickerInner.getChild(i); if (yearString.equals(child.getAttribute(InputDatePicker.ATTRIBUTE_DATA_YEAR))) { this.monthPickerInner.insertAfter(this.monthPickerUlMonthElement, child); Date monthButtonDate = new Date(this.cursor.getTime()); monthButtonDate.setYear(year - InputDatePicker.YEAR_OFFSET); if (this.monthPickerUlMonthElement.getChildCount() == 0) { for (int month = 0; month < 12; month++) { LIElement monthElement = Document.get().createLIElement(); this.monthPickerUlMonthElement.appendChild(monthElement); Event.sinkEvents(monthElement, Event.ONCLICK); monthButtonDate.setMonth(month); monthElement.setInnerText(InputDatePicker.MONTH_ABBR_FORMAT.format(monthButtonDate)); }/*from w ww .ja v a 2 s. co m*/ } for (int month = 0; month < 12; month++) { LIElement monthElement = (LIElement) this.monthPickerUlMonthElement.getChild(month); monthButtonDate.setMonth(month); monthElement.setAttribute(InputDatePicker.ATTRIBUTE_DATA_CURSOR, InputDatePicker.ATTRIBUTE_DATE_FORMAT.format(monthButtonDate)); } this.monthPicker.setScrollTop(child.getOffsetTop()); break; } } }
From source file:org.jboss.demo.widgets.client.local.PickListWidget.java
License:Open Source License
public void initCapitals(List<Capital> capitals, List<Capital> selectedCapitals) { this.capitals = capitals; clearChildren(sourceList);/* w w w. j a v a 2 s . c o m*/ clearChildren(targetList); Document document = Document.get(); for (Capital capital : capitals) { LIElement li = document.createLIElement(); li.setInnerText(capital.getName()); // "data-key" is used by the jQuery plugin to uniquely identify the list elements li.setAttribute("data-key", capital.getName()); // use JSNI to store the item object in the "data-object" attribute of the list element setCapital(li, capital); if (selectedCapitals.contains(capital)) { targetList.appendChild(li); } else { sourceList.appendChild(li); } } // We don't initialize the jQuery plugin until the list elements are in place initPlugin(); }