Java 类com.google.gwt.dom.client.LabelElement 实例源码

项目:r01fb    文件:TreeViewItem.java   
@Override
    public void onLazyLoadingSuccessful(final Collection<ViewObject> children) {
//      GWT.log("====>" + this.getText() + " > " + (children != null ? children.size() : 0) + " child loaded");
        // Remove the loading... label
        LabelElement loadingLabel = _childLoadingSPANElement();
        LIElement parentLI = this.getElement().cast();
        parentLI.removeChild(loadingLabel);

        // if the number of children loaded is 0 (there where no child items), hide the expander 
        // otherwise paint the children
        if (CollectionUtils.isNullOrEmpty(children)) {
            _expanderINPUTElement().setDisabled(true);
        } else {
            this.paintChildren(children);
        }
    }
项目:qafe-platform    文件:QCheckBox.java   
public QCheckBox(Element elem, String displaynamePosition) {
    inputElem = (InputElement) this.getElement().getChild(0);
    labelElem =  (LabelElement) this.getElement().getChild(1);
    if (displaynamePosition.equals(DISPLAYNAME_POSITION_LEFT)) {
        getElement().appendChild(labelElem);
        getElement().appendChild(inputElem);
    } else {
        getElement().appendChild(inputElem);
        getElement().appendChild(labelElem);
    }
    String uid = DOM.createUniqueId();
    inputElem.setPropertyString("id", uid);
    labelElem.setHtmlFor(uid);
    directionalTextHelper = new DirectionalTextHelper(labelElem, true);

    // Accessibility: setting tab index to be 0 by default, ensuring element
    // appears in tab sequence. FocusWidget's setElement method already
    // calls setTabIndex, which is overridden below. However, at the time
    // that this call is made, inputElem has not been created. So, we have
    // to call setTabIndex again, once inputElem has been created.
    setTabIndex(0);
}
项目:putnami-web-toolkit    文件:InputRadio.java   
RadioContainer(T value) {
    this.value = value;
    Container newContainer = null;
    Container label = new Container(LabelElement.TAG);
    if (Type.INLINE.equals(InputRadio.this.type)) {
        newContainer = label;
    } else {
        newContainer = new Container();
        newContainer.append(label);
    }
    this.initWidget(newContainer);
    label.getElement().appendChild(this.radioElement);
    label.getElement().appendChild(
        Document.get().createTextNode(" " + InputRadio.this.getChoiceRenderer().renderItem(value)));
    StyleUtils.addStyle(newContainer, InputRadio.this.type);
    newContainer.addDomHandler(this, ClickEvent.getType());
    InputRadio.this.itemsContainer.put(value, this);
}
项目:putnami-web-toolkit    文件:InputCheckBox.java   
CheckboxContainer(T value) {
    this.value = value;
    Container newContainer = null;
    Container label = new Container(LabelElement.TAG);
    if (Type.INLINE.equals(InputCheckBox.this.type)) {
        newContainer = label;
    } else {
        newContainer = new Container();
        InputCheckBox.this.container.append(label);
    }
    this.initWidget(newContainer);
    label.getElement().appendChild(this.checkboxElement);
    label.getElement().appendChild(
        Document.get().createTextNode(" " + InputCheckBox.this.getChoiceRenderer().renderItem(value)));
    StyleUtils.addStyle(newContainer, InputCheckBox.this.type);
    newContainer.addDomHandler(this, ClickEvent.getType());
    InputCheckBox.this.itemsContainer.put(value, this);
}
项目:che    文件:CustomComboBox.java   
/**
 * Sets the text associated with the item at a given index.
 *
 * @param index the index of the item to be set
 * @param text the item's new text
 * @throws IndexOutOfBoundsException if the index is out of range
 */
public void setItemText(int index, String text) {
  checkIndex(index);
  final Element optionElement = (Element) optionsPanel.getElement().getChild(index);
  final LabelElement labelElement =
      (LabelElement) optionElement.getElementsByTagName("label").getItem(0);
  labelElement.setInnerText(text);
  if (selectedIndex == index) {
    currentInputElement.setValue(text);
  }
}
项目:che    文件:CustomListBox.java   
/**
 * Gets the text associated with the item at the specified index.
 *
 * @param index the index of the item whose text is to be retrieved
 * @return the text associated with the item
 * @throws IndexOutOfBoundsException if the index is out of range
 */
public String getItemText(int index) {
  checkIndex(index);
  final Element optionElement = (Element) optionsPanel.getElement().getChild(index);
  final LabelElement labelElement =
      (LabelElement) optionElement.getElementsByTagName("label").getItem(0);

  return labelElement.getInnerText();
}
项目:che    文件:CustomListBox.java   
/**
 * Sets the text associated with the item at a given index.
 *
 * @param index the index of the item to be set
 * @param text the item's new text
 * @throws IndexOutOfBoundsException if the index is out of range
 */
public void setItemText(int index, String text) {
  checkIndex(index);
  final Element optionElement = (Element) optionsPanel.getElement().getChild(index);
  final LabelElement labelElement =
      (LabelElement) optionElement.getElementsByTagName("label").getItem(0);
  labelElement.setInnerText(text);
  if (selectedIndex == index) {
    currentItemLabel.setInnerText(text);
  }
}
项目:r01fb    文件:TreeViewItem.java   
@Override
public void onLazyLoadingInProgress() {
    // [1] - Create a child label element with the "loading..." text
    LabelElement loadingLabelEl = DOM.clone(BASE_LOADING_ELEM,      // a label
                                            true)                   // deep cloning
                                     .cast();
    // [2] - set the label as a child of the item (the LI) 
    LIElement parentLI = this.getElement().cast();
    parentLI.insertAfter(loadingLabelEl,
                         _widget.getElement());         // the loading label is ALLWAYS after the widget
}
项目:putnami-web-toolkit    文件:Label.java   
private Label(Label source) {
    super(source);
    this.labelElement = LabelElement.as(this.getElement());
    StyleUtils.addStyle(this, Label.STYLE_CONTROL_LABEL);
    this.path = source.path;
    this.setText(source.text);
    if (source.htmlFor != null) {
        this.setHtmlFor(source.htmlFor);
    }
}
项目:gwtbootstrap3    文件:Radio.java   
/**
 * Creates a new radio associated with a particular group name. All radio
 * buttons associated with the same group name belong to a
 * mutually-exclusive set.
 * 
 * Radio buttons are grouped by their name attribute, so changing their name
 * using the setName() method will also change their associated group.
 * 
 * @param name
 *            the group name with which to associate the radio button
 */
@UiConstructor
public Radio(String name) {
    super(DOM.createDiv(), Document.get().createRadioInputElement(name));
    setStyleName(Styles.RADIO);

    LabelElement label = Document.get().createLabelElement();
    label.appendChild(inputElem);
    label.appendChild(labelElem);

    getElement().appendChild(label);
}
项目:gwtbootstrap3    文件:CheckBox.java   
public CheckBox() {
    this(DOM.createDiv(), Document.get().createCheckInputElement());
    setStyleName(Styles.CHECKBOX);

    LabelElement label = Document.get().createLabelElement();
    label.appendChild(inputElem);
    label.appendChild(labelElem);

    getElement().appendChild(label);
}
项目:wt-pdf-viewer    文件:WTPdfViewerWidget.java   
private LabelElement createLabel(Document document, String className) {
    LabelElement result = document.createLabelElement();
    result.addClassName(className);

    return result;
}
项目:wt-pdf-viewer    文件:WTPdfViewerWidget.java   
private LabelElement createChildLabel(Document document, Element parent, String nameId) {
    LabelElement result = createLabel(document, nameId);
    parent.appendChild(result);

    return result;
}
项目:Wiab.pro    文件:LabelRenderingMutationHandler.java   
/**
 * @return impl nodelet as {@link LabelElement}
 */
private LabelElement getImpl(ContentElement element) {
  return LabelElement.as(element.getImplNodelet());
}
项目:listmaker    文件:LabelWidget.java   
public void setHtmlFor(String htmlFor)
{
    ((LabelElement) getElement().cast()).setHtmlFor(htmlFor);
}
项目:r01fb    文件:TreeViewItem.java   
private static LabelElement _createBaseLoadingElement() {
    LabelElement label = DOM.createLabel().cast();
    label.addClassName("loading");
    label.setInnerHTML("loading...");
    return label;
}
项目:r01fb    文件:TreeViewItem.java   
LabelElement _childLoadingSPANElement() {
    LIElement containerLI = this.getElement().cast();
    if (containerLI.getChildCount() < 4) return null;
    LabelElement loadingSPAN = containerLI.getChild(4).cast();
    return loadingSPAN;
}
项目:r01fb    文件:TreeViewItem.java   
@Override
public void onLazyLoadingError(final String err) {
    // Change the loading... label for ERROR!!
    LabelElement loadingLabel = _childLoadingSPANElement();
    loadingLabel.setInnerHTML("ERROR!!!");
}
项目:putnami-web-toolkit    文件:Label.java   
public Label() {
    super(LabelElement.TAG);
    this.labelElement = LabelElement.as(this.getElement());
    StyleUtils.addStyle(this, Label.STYLE_CONTROL_LABEL);
}
项目:incubator-wave    文件:LabelRenderingMutationHandler.java   
/**
 * @return impl nodelet as {@link LabelElement}
 */
private LabelElement getImpl(ContentElement element) {
  return LabelElement.as(element.getImplNodelet());
}
项目:xapi    文件:LogLevelView.java   
private void setLabelFor(InputElement radio, LabelElement label) {
  if (radio.getId().length()==0)
    radio.setId(DOM.createUniqueId());
  label.setHtmlFor(radio.getId());
}