Example usage for com.google.gwt.user.client.ui Widget addStyleName

List of usage examples for com.google.gwt.user.client.ui Widget addStyleName

Introduction

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

Prototype

public void addStyleName(String style) 

Source Link

Document

Adds a secondary or dependent style name to this object.

Usage

From source file:edu.ucsb.eucalyptus.admin.client.extensions.store.ImageWidget.java

License:Open Source License

private void setProvider(String title, String uri) {
    String styleName = "istore-known-provider-title";

    if (title == null) {
        styleName = "istore-unknown-provider-title";
        title = "Unknown";
    }/*from w w  w . ja  v  a2  s . c  o  m*/

    Widget providerTitleWidget;
    if (uri == null) {
        Label providerLabel = new Label();
        providerLabel.setText(title);
        providerTitleWidget = providerLabel;
    } else {
        Anchor providerAnchor = new Anchor();
        providerAnchor.setText(title);
        providerAnchor.setHref(uri);
        providerTitleWidget = providerAnchor;
    }

    providerTitlePanel.setWidget(providerTitleWidget);
    providerTitleWidget.setStyleName(styleName);
    providerTitleWidget.addStyleName("istore-provider-title");
}

From source file:edu.ucsb.eucalyptus.admin.client.extensions.store.ImageWidget.java

License:Open Source License

public void setInProgress(boolean inProgress) {
    spinnerImage.setVisible(inProgress);
    Widget buttonImage = buttonPanel.getWidget();
    if (buttonImage != null && imageState.getStatus() == ImageState.Status.UNINSTALLED) {
        if (inProgress) {
            buttonImage.addStyleName("istore-install-button-progress");
        } else {/*w  w w. j  a va  2s .c  o m*/
            buttonImage.removeStyleName("istore-install-button-progress");
        }
    }
}

From source file:eu.nextstreet.gwt.components.client.ui.widget.suggest.impl.table.SimpleTableRowItemRenderer.java

License:Apache License

@Override
public void hover(boolean hover) {
    String styleName = getStyleName() + "-hover";
    for (Widget widget : this) {
        if (hover)
            widget.addStyleName(styleName);
        else//from w  w  w  .j  a v  a 2s.  co  m
            widget.removeStyleName(styleName);
    }
}

From source file:fr.aliasource.webmail.client.reader.MessageHeader.java

License:GNU General Public License

public MessageHeader(View ui, DateFormatter dtf, RecipientsStyleHandler rsh, ClientMessage cm,
        ConversationDisplay convDisplay, final AbstractMessageWidget mw, boolean withMenu,
        boolean collapsable) {

    addStyleName("singleMessageHeader");
    setWidth("100%");

    int col = 0;//from  w ww. jav a2  s  . c  o  m

    GWT.log("withMenu: " + withMenu + " collapsable: " + collapsable, null);

    if (withMenu) {
        if (cm.isHighPriority()) {
            Widget hp = createHighPriority();
            setWidget(0, col++, hp);
        }

        Widget star = createStar(ui, cm);
        setWidget(0, col++, star);

        if (cm.isAnswered()) {
            Widget answer = createAnswer();
            setWidget(0, col++, answer);
        }
    }

    Widget recipients = createRecipientsWidget(rsh, cm, mw, withMenu);
    setWidget(0, col++, recipients);
    CellFormatter cf = getCellFormatter();
    cf.addStyleName(0, col - 1, "recipientsCol");
    recipients.addStyleName("recipients");

    showDetails = new Anchor(I18N.strings.showDetail());
    setWidget(0, col++, showDetails);
    showDetails.addStyleName("recipientsDetails");

    Label date = new Label(dtf.formatPretty(cm.getDate()));
    date.addStyleName("noWrap");
    setWidget(0, col++, date);
    date.addStyleName("recipientsDate");

    if (withMenu) {
        MessageMenu menu = new MessageMenu(cm, convDisplay);
        setWidget(0, col++, menu);
    }
}

From source file:fr.aliasource.webmail.client.SideBar.java

License:GNU General Public License

public void setCurrentDefaultLinkStyle(Widget current) {
    if (current != null) {
        current.addStyleName("currentDefaultLinkSelected");
        prevDefaultLink = current;/*w w w .  j  a v  a 2 s. c  o  m*/
    }
}

From source file:fr.fg.client.animation.LoopClassNameUpdater.java

License:Open Source License

public LoopClassNameUpdater(Widget widget, String classPrefix, double currentClass, double increment) {
    this.mode = MODE_TARGET;
    this.widget = widget;
    this.classPrefix = classPrefix;
    this.currentClass = currentClass;
    this.targetClass = currentClass;
    this.increment = increment;

    widget.addStyleName(classPrefix + (int) Math.floor(currentClass));
}

From source file:geogebra.web.gui.advanced.client.ui.widget.ListPopupPanel.java

License:Apache License

/**
 * Sets the highlight row number./*ww w.  jav  a  2  s .c  o  m*/
 *
 * @param row is a row number to become highlight.
 */
protected void setHighlightRow(int row) {
    if (row < getList().getWidgetCount()) {
        Widget widget = null;
        if (this.highlightRow >= 0 && getList().getWidgetCount() > this.highlightRow)
            widget = getList().getWidget(this.highlightRow);

        if (widget != null)
            widget.removeStyleName("selected-row");
        this.highlightRow = row;
        if (row >= 0) {
            widget = getList().getWidget(this.highlightRow);
            widget.addStyleName("selected-row");
        }
    }
}

From source file:gwt.material.design.addins.client.base.mixin.ActiveMixin.java

License:Apache License

@Override
public void setActive(boolean active) {
    this.active = active;
    Widget obj = (Widget) uiObject;
    if (active) {
        obj.removeStyleName("inactive");
        obj.addStyleName("active");
    } else {/* w  w w  .  j a  v  a2  s  .  c  o  m*/
        obj.removeStyleName("active");
        obj.addStyleName("inactive");
    }
}

From source file:gwt.material.design.addins.client.subheader.MaterialSubHeaderContainer.java

License:Apache License

@Override
public void load() {
    if (getType() == SubHeaderType.PINNED) {
        String subHeaderClass = DOM.createUniqueId();
        for (Widget w : getChildren()) {
            if (w instanceof MaterialSubHeader) {
                w.addStyleName(subHeaderClass);
                subHeaders.add((MaterialSubHeader) w);
            }//from   w  w  w .  j ava  2 s.  c om
        }

        JsSubHeader.initSubheader("." + subHeaderClass, getElement());

        if (subHeaders.size() == 0) {
            $(getElement()).find(".top_holder").css("display", "none");
        }
    }
}

From source file:gwt.material.design.addins.client.ui.MaterialSubHeaderContainer.java

License:Apache License

@Override
protected void onLoad() {
    super.onLoad();
    if (getType() == SubHeaderType.PINNED) {
        String uniqueName = DOM.createUniqueId();
        for (Widget w : getChildren()) {
            if (w instanceof MaterialSubHeader) {
                w.addStyleName(uniqueName);
            }/*from  ww  w . ja v a 2  s. com*/
        }
        initSubheaders("." + uniqueName, getElement());
    }
}