Java Code Examples for com.google.gwt.user.client.DOM#createLabel()

The following examples show how to use com.google.gwt.user.client.DOM#createLabel() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JoinDataTool.java    From geowe-core with GNU General Public License v3.0 6 votes vote down vote up
private SubmitCompleteHandler getSubmitCompleteHandler() {
	return new SubmitCompleteHandler() {
		public void onSubmitComplete(final SubmitCompleteEvent event) {

			final Element label = DOM.createLabel();
			label.setInnerHTML(event.getResults());

			final String csvData = label.getInnerText();
			if (hasError(csvData)) {
				showAlert("Error: " + csvData);
			} else {
				parseCsvData(csvData);
				autoMessageBox.hide();
			}
		}

		private boolean hasError(final String contentFile) {
			return contentFile.startsWith("413")
					|| contentFile.startsWith("500");
		}
	};
}
 
Example 2
Source File: AriaCheckBox.java    From unitime with Apache License 2.0 5 votes vote down vote up
public AriaCheckBox(Element elem) {
	super(elem);
	
	iAriaLabel = DOM.createLabel();
	iAriaLabel.setId(DOM.createUniqueId());
	iAriaLabel.setClassName("unitime-AriaLabel");
	DOM.appendChild(getElement(), iAriaLabel);
	Roles.getCheckboxRole().setAriaLabelledbyProperty(elem, Id.of(iAriaLabel));
}
 
Example 3
Source File: UniTimeWidget.java    From unitime with Apache License 2.0 5 votes vote down vote up
@Override
public void setAriaLabel(String text) {
	if (iWidget instanceof HasAriaLabel) {
		((HasAriaLabel)iWidget).setAriaLabel(text);
	} else {
		if (iAriaLabel == null) {
			iAriaLabel = DOM.createLabel();
			iAriaLabel.setId(DOM.createUniqueId());
			iAriaLabel.setClassName("hidden-label");
			DOM.appendChild(getElement(), iAriaLabel);
			Roles.getCheckboxRole().setAriaLabelledbyProperty(iWidget.getElement(), Id.of(iAriaLabel));
		}
		iAriaLabel.setInnerText(text);
	}
}
 
Example 4
Source File: Label.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Label() {
    super(DOM.createLabel());
}