![JAR search and dependency download from the Maven repository](/logo.png)
com.extjs.gxt.ui.client.widget.Label Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gxt Show documentation
Show all versions of gxt Show documentation
Rich Internet Application Framework for GWT
/*
* Sencha GXT 2.3.1a - Sencha for GWT
* Copyright(c) 2007-2013, Sencha, Inc.
* [email protected]
*
* http://www.sencha.com/products/gxt/license/
*/
package com.extjs.gxt.ui.client.widget;
import com.google.gwt.user.client.Element;
/**
* A component that contains text in a HTML label element.
*
*
* - Inherited Events:
* - BoxComponent Move
* - BoxComponent Resize
* - Component Enable
* - Component Disable
* - Component BeforeHide
* - Component Hide
* - Component BeforeShow
* - Component Show
* - Component Attach
* - Component Detach
* - Component BeforeRender
* - Component Render
* - Component BrowserEvent
* - Component BeforeStateRestore
* - Component StateRestore
* - Component BeforeStateSave
* - Component SaveState
*
*/
public class Label extends Html {
private String labelFor;
/**
* Creates a new label.
*/
public Label() {
setTagName("label");
}
/**
* Creates a new label.
*
* @param html the label's text
*/
public Label(String html) {
this();
setHtml(html);
}
/**
* Sets the label for id.
*
* @param id the element id
*/
public void setLabelFor(String id) {
this.labelFor = id;
}
@Override
protected void onRender(Element target, int index) {
super.onRender(target, index);
if (labelFor != null) {
getElement().setAttribute("for", labelFor);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy