本文整理汇总了Java中com.google.gwt.dom.client.LabelElement类的典型用法代码示例。如果您正苦于以下问题:Java LabelElement类的具体用法?Java LabelElement怎么用?Java LabelElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LabelElement类属于com.google.gwt.dom.client包,在下文中一共展示了LabelElement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onLazyLoadingSuccessful
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
@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);
}
}
示例2: QCheckBox
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
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);
}
示例3: RadioContainer
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
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);
}
示例4: CheckboxContainer
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
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);
}
示例5: setItemText
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
/**
* 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);
}
}
示例6: getItemText
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
/**
* 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();
}
示例7: setItemText
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
/**
* 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);
}
}
示例8: onLazyLoadingInProgress
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
@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
}
示例9: Label
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
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);
}
}
示例10: Radio
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
/**
* 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);
}
示例11: CheckBox
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
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);
}
示例12: createLabel
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
private LabelElement createLabel(Document document, String className) {
LabelElement result = document.createLabelElement();
result.addClassName(className);
return result;
}
示例13: createChildLabel
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
private LabelElement createChildLabel(Document document, Element parent, String nameId) {
LabelElement result = createLabel(document, nameId);
parent.appendChild(result);
return result;
}
示例14: getImpl
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
/**
* @return impl nodelet as {@link LabelElement}
*/
private LabelElement getImpl(ContentElement element) {
return LabelElement.as(element.getImplNodelet());
}
示例15: setHtmlFor
import com.google.gwt.dom.client.LabelElement; //导入依赖的package包/类
public void setHtmlFor(String htmlFor)
{
((LabelElement) getElement().cast()).setHtmlFor(htmlFor);
}