Java Code Examples for com.google.gwt.user.client.Element#addClassName()

The following examples show how to use com.google.gwt.user.client.Element#addClassName() . 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: ColoredFlexTable.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void onBrowserEvent(Event event) {
	super.onBrowserEvent(event);
	Element td = getEventTargetCell(event);
	if (td == null)
		return;
	Element tr = DOM.getParent(td);

	switch (DOM.eventGetType(event)) {
		case Event.ONMOUSEOVER:
			tr.addClassName(ROW_STYLE_NAME + "-mouseover");
			break;

		case Event.ONMOUSEOUT: {
			tr.removeClassName(ROW_STYLE_NAME + "-mouseover");
			break;
		}
	}
}
 
Example 2
Source File: VDDVerticalSplitPanel.java    From cuba with Apache License 2.0 6 votes vote down vote up
/**
 * Emphasisizes a container element
 * 
 * @param element
 */
protected void emphasis(Element element) {
    // Remove previous emphasis
    deEmphasis();

    // validate container
    if (element == null || !getElement().isOrHasChild(element)) {
        return;
    }

    if (element == firstContainer || element == secondContainer) {
        element.addClassName(OVER);
        currentEmphasis = element;
    } else if (splitter.isOrHasChild(element)) {
        currentEmphasis = splitter.getChild(0).cast();
        currentEmphasis.addClassName(OVER_SPLITTER);
    }
}
 
Example 3
Source File: StackedBar.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
public Widget asWidget() {

        SafeHtmlBuilder builder = new SafeHtmlBuilder();

        builder.appendHtmlConstant("<div id='"+ outerId +"'><div id='"+innerId+"'/></div>");

        panel = new HTMLPanel(builder.toSafeHtml());

        Element outerElement = panel.getElementById(outerId);
        outerElement.addClassName("stacked-bar-total");
        outerElement.setAttribute("style", "width:100%");
        outerElement.setAttribute("cssText", "width:100%!important");


        Element innerElement = panel.getElementById(innerId);
        innerElement.addClassName("stacked-bar-actual");
        innerElement.setInnerText(label);

        return panel;
    }