Example usage for com.google.gwt.user.client.ui UIObject setStyleName

List of usage examples for com.google.gwt.user.client.ui UIObject setStyleName

Introduction

In this page you can find the example usage for com.google.gwt.user.client.ui UIObject setStyleName.

Prototype

public void setStyleName(String style, boolean add) 

Source Link

Document

Adds or removes a style name.

Usage

From source file:com.allen_sauer.gwt.dnd.demo.client.ui.StylableVerticalPanel.java

License:Apache License

public void setCellStyleName(Widget widget, String styleName) {
    Element td = DOM.getParent(widget.getElement());
    UIObject.setStyleName(td, styleName);
}

From source file:com.edgenius.wiki.gwt.client.widgets.ZebraTable.java

License:Open Source License

/**
 * @param startRow/*from   w w w  . j a  va  2s. c o  m*/
 */
private void updateHeaderStyle() {
    int colSize = this.getCellCount(0);

    for (int col = 0; col < colSize; col++) {
        if (style == STYLE_LIST && noBorderHeaders.contains(col)) {
            //!!! can not use this.getCellFormatter().setStyleName() as it call prepareCell and cause recursive looping 
            UIObject.setStyleName(this.getCellFormatter().getElement(0, col), Css.NOBORDER_HEADER);
        } else {
            //!!! can not use this.getCellFormatter().setStyleName() as it call prepareCell and cause recursive looping 
            UIObject.setStyleName(this.getCellFormatter().getElement(0, col), Css.HEADER);
        }
    }
}

From source file:com.qualogy.qafe.gwt.client.component.ComponentRendererHelper.java

License:Apache License

private static void processConditionalStyleClass(EditableComponentGVO component, UIObject uiObject,
        ConditionGVO condition, boolean matched) {
    if (condition.getStyleClass() != null) {
        uiObject.setStyleName(condition.getStyleClass(), matched);
        if (uiObject instanceof SpreadsheetCell) {
            SpreadsheetCell ui = (SpreadsheetCell) uiObject;
            // spreadsheetcell have a focuslabel inside(which is a container of html component). So we have apply the style for that also.
            ui.getLabel().setStyleName(condition.getStyleClass(), matched);
        }// w  w  w . jav a  2s. c  o m
    }
}

From source file:com.tensegrity.wpalo.client.ui.mvc.fasttree.FastMSTreeItem.java

License:Apache License

/**
 * Sets whether this item's children are displayed.
 * //from w  ww. jav a 2 s. c om
 * @param open
 *          whether the item is open
 * @param fireEvents
 *          <code>true</code> to allow open/close events to be fired
 */
public void setState(boolean open, boolean fireEvents) {
    if (open == isOpen()) {
        return;
    }
    // Cannot open leaf nodes.
    if (isLeafNode()) {
        return;
    }
    if (open) {
        beforeOpen();
        if (state == TREE_NODE_INTERIOR_NEVER_OPENED) {
            ensureChildren();
            childElems = DOM.createDiv();
            UIObject.setStyleName(childElems, STYLENAME_CHILDREN);
            convertElementToHaveChildren(childElems);

            if (children != null) {
                for (FastMSTreeItem item : children) {
                    DOM.appendChild(childElems, item.getElement());
                }
            }
        }

        state = TREE_NODE_INTERIOR_OPEN;
    } else {
        beforeClose();
        state = TREE_NODE_INTERIOR_CLOSED;
    }
    updateState();
    if (open) {
        afterOpen();
    } else {
        afterClose();
    }
}

From source file:org.palaso.languageforge.client.lex.controls.FastTreeItem.java

License:Apache License

/**
 * Sets whether this item's children are displayed.
 * //from w  w  w  . j ava 2s  .  c  o m
 * @param open
 *            whether the item is open
 * @param fireEvents
 *            <code>true</code> to allow open/close events to be fired
 */
public void setState(boolean open, boolean fireEvents) {
    if (open == isOpen()) {
        return;
    }
    // Cannot open leaf nodes.
    if (isLeafNode()) {
        return;
    }
    if (open) {
        beforeOpen();
        if (state == TreeNodeStateEnum.TREE_NODE_INTERIOR_NEVER_OPENED) {
            ensureChildren();
            childElems = DOM.createDiv();
            UIObject.setStyleName(childElems, STYLENAME_CHILDREN);
            convertElementToHaveChildren(childElems);

            if (children != null) {
                for (FastTreeItem item : children) {
                    DOM.appendChild(childElems, item.getElement());
                }
            }
        }

        state = TreeNodeStateEnum.TREE_NODE_INTERIOR_OPEN;
    } else {
        beforeClose();
        state = TreeNodeStateEnum.TREE_NODE_INTERIOR_CLOSED;
    }
    updateState();
    if (open) {
        afterOpen();
    } else {
        afterClose();
    }
}