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:nl.strohalm.cyclos.mobile.client.ui.widgets.FormField.java

License:Open Source License

/**
 * Sets the form widgets and labels//from  w w  w .  ja  v  a  2 s .com
 */
public void setWidgets(Map<String, Widget> widgets) {
    int row = 0;
    for (String label : widgets.keySet()) {
        Widget widget = widgets.get(label);

        // Add style to the widget to fit in form
        widget.addStyleName(valueStyle);

        // Resize grid row per new value added
        grid.resizeRows(row + 1);

        // Add label and value
        LabelField labelField = new LabelField(label, labelStyle);
        grid.setWidget(row, 0, labelField);
        grid.setWidget(row, 1, widget);

        // Increment rows size
        row++;
    }
    // No data available
    if (row == 0) {
        if (hideParentOnNoData && getParent() != null) {
            getParent().setVisible(false);
        }
    }
}

From source file:nl.strohalm.cyclos.mobile.client.utils.ComponentEventHelper.java

License:Open Source License

/**
 * Adds the given style to the component on click down event
 *///from   ww  w  .  java  2  s .c  o  m
public static void addClickDown(final Widget container, final String style) {
    container.addDomHandler(new MouseDownHandler() {
        @Override
        public void onMouseDown(MouseDownEvent event) {
            container.addStyleName(style);
        }
    }, MouseDownEvent.getType());
}

From source file:nl.strohalm.cyclos.mobile.client.utils.ComponentEventHelper.java

License:Open Source License

/**
 * Adds the given style to the component on touch start event<br>
 * Used in touch devices//  ww  w. j  a va2s  .  co  m
 */
public static void addTouchStart(final Widget container, final String downStyle) {
    container.addDomHandler(new TouchStartHandler() {
        @Override
        public void onTouchStart(TouchStartEvent event) {
            container.addStyleName(downStyle);
        }
    }, TouchStartEvent.getType());
}

From source file:org.apache.hupa.client.mvp.AppView.java

License:Apache License

public void addWidget(Widget widget) {
    widget.addStyleName(HupaCSS.C_main_container);
    centralContainer.setWidget(widget);
}

From source file:org.apache.solr.explorer.client.core.ui.searchpane.SearchPane.java

License:Apache License

public void setSearchTextBox(Widget searchTextBox) {
    this.searchTextBox = searchTextBox;
    searchTextBox.addStyleName("SearchBox");
    searchTextBoxHolder.setWidget(searchTextBox);
}

From source file:org.bonitasoft.forms.client.view.widget.FormFieldWidget.java

License:Open Source License

/**
 * add generic features to the field widgets
 *
 * @param fieldWidget//  w w w .  j  ava 2 s.c  o m
 *        the GWT widget
 * @param widgetData
 *        the widget data object
 */
protected void addStandardWidgetFeatures(final Widget fieldWidget, final ReducedFormWidget widgetData) {
    if (isStaticField()) {
        if (widgetType.equals(WidgetType.IMAGE)) {
            fieldWidget.setStyleName("bonita_form_image_container");
        } else {
            fieldWidget.setStyleName("bonita_form_text");
        }
    } else {
        fieldWidget.setStyleName("bonita_form_field");
        if (widgetType.equals(WidgetType.DATE)) {
            fieldWidget.addStyleName("bonita_form_date");
        }
    }
    if (widgetData.getTitle() != null && widgetData.getTitle().length() > 0) {
        fieldWidget.setTitle(widgetData.getTitle());
    }
    insertWidgetInPanel(fieldWidget, widgetData);
}

From source file:org.cruxframework.crux.core.client.errors.ErrorHandlerImpl.java

License:Apache License

@Override
//TODO: when calling this handler, threat required widgets when they implement HasData.
public Widget handleValidationError(Widget widget, String errorMessage) {
    widget.addStyleName("error");
    DialogBox errorMsgDialog = new DialogBox();
    errorMsgDialog.setStyleName("errorMsg");
    errorMsgDialog.showRelativeTo(widget);
    return errorMsgDialog;
}

From source file:org.cruxframework.crux.smartfaces.client.tab.TabBar.java

License:Apache License

private void setSelectionStyle(Widget item, boolean selected) {
    if (item != null) {
        if (selected) {
            item.addStyleName(TAB_BAR_ITEM_SELECTED_STYLE_NAME);
        } else {//from   w  w w .ja  v a  2  s .c  o m
            item.removeStyleName(TAB_BAR_ITEM_SELECTED_STYLE_NAME);
        }
    }
}

From source file:org.cruxframework.crux.widgets.client.rollingtabs.RollingTabBar.java

License:Apache License

private void setSelectionStyle(Widget item, boolean selected) {
    if (item != null) {
        if (selected) {
            item.addStyleName("crux-TabBarItem-selected");
            setStyleName(DOM.getParent(item.getElement()), "crux-TabBarItem-wrapper-selected", true);
        } else {/*from   ww  w. ja va 2 s  .  c  om*/
            item.removeStyleName("crux-TabBarItem-selected");
            setStyleName(DOM.getParent(item.getElement()), "crux-TabBarItem-wrapper-selected", false);
        }
    }
}

From source file:org.cruxframework.mediamanager.client.controller.LoginController.java

License:Apache License

private void animateIntroduction() {
    Timer delay = new Timer() {
        @Override/*from w  ww  . ja v a  2 s  .  c  o m*/
        public void run() {
            final Widget introductionText = View.of(LoginController.this).getWidget("introductionText");

            StandardAnimation animation = new StandardAnimation(StandardAnimation.Type.fadeIn);

            animation.animate(introductionText, new Animation.Callback() {
                @Override
                public void onAnimationCompleted() {
                    introductionText.addStyleName("opaque");
                }
            });
        }
    };
    delay.schedule(600);
}