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:com.google.testing.testify.risk.frontend.client.view.widgets.PageSectionVerticalPanel.java

License:Apache License

@Override
public void add(Widget w) {
    w.addStyleName("tty-PageSectionVerticalPanelItem");
    content.add(w);
}

From source file:com.googlecode.mgwt.ui.client.widget.HeaderPanel.java

License:Apache License

/**
 * Set a widget that should appear in the center of the header panel
 * /*  w  ww .  j  a  v  a  2  s. c  o m*/
 * @param w the widget that is displayed in the center
 */
@UiChild(limit = 1, tagname = "center")
public void setCenterWidget(Widget w) {
    if (title != null) {
        container.remove(title);
        title.removeStyleName(css.center());
    }
    title = w;
    if (title != null) {
        w.addStyleName(this.css.center());
        container.add(w);

    }

}

From source file:com.googlecode.mgwt.ui.client.widget.LayoutPanel.java

License:Apache License

/** {@inheritDoc} */
@Override//from   w  w w. j a  v a  2s . co m
public void add(Widget w) {

    if (w instanceof ScrollPanel) {
        w.addStyleName(css.fillPanelExpandChild());
    }

    main.add(w);
}

From source file:com.googlecode.mgwt.ui.client.widget.panel.flex.FlexPanel.java

License:Apache License

@Override
public void add(Widget w) {
    if (w instanceof IsFlexible) {
        w.addStyleName(appearance.css().flexible());
    }/*w ww  . j a v  a 2 s.c o  m*/
    container.add(w);
}

From source file:com.gwtmobile.ui.client.widgets.CheckBoxGroup.java

License:Apache License

@Override
public void onDragStart(DragEvent e) {
    _pressed = Utils.getTargetItemIndex(getElement(), e.getNativeEvent().getEventTarget());
    if (_pressed >= 0) {
        Widget item = getWidget(_pressed);
        item.addStyleName(Secondary.Pressed);
    }/*from w w w  .  jav  a 2 s  .  c o m*/
}

From source file:com.gwtmobile.ui.client.widgets.IsGwtMobileWidgetHelper.java

License:Apache License

public void setSecondaryStyle(Widget widget, String style) {
    widget.addStyleName(style);
}

From source file:com.haulmont.cuba.web.toolkit.ui.client.popupbutton.CubaPopupButtonWidget.java

License:Apache License

protected void childWidgetFocused(Widget target) {
    resetSelectedItem();

    target.addStyleName(SELECTED_ITEM_STYLE);
}

From source file:com.haulmont.cuba.web.toolkit.ui.client.Tools.java

License:Apache License

public static void focusSelectedItem(Widget parentWidget, Widget target) {
    resetItemSelection(parentWidget);//from   ww w .  j a  v a 2  s .co  m
    target.addStyleName(SELECTED_ITEM_STYLE);
}

From source file:com.haulmont.cuba.web.toolkit.ui.client.Tools.java

License:Apache License

public static void showPopup(VOverlay overlay, int left, int top) {
    overlay.setAutoHideEnabled(true);/*from  ww w  . ja  va2  s .c  o m*/
    overlay.setVisible(false);
    overlay.show();

    Widget widget = overlay.getWidget();
    if (widget instanceof VVerticalLayout) {
        resetItemSelection(widget);

        VVerticalLayout verticalLayout = (VVerticalLayout) widget;
        if (verticalLayout.getStyleName().contains(CUBA_CONTEXT_MENU_CONTAINER)) {
            int widgetCount = verticalLayout.getWidgetCount();
            if (widgetCount > 1) {
                Widget verticalSlot = verticalLayout.getWidget(0);
                Widget buttonWidget = ((Slot) verticalSlot).getWidget();
                buttonWidget.addStyleName(SELECTED_ITEM_STYLE);
                if (buttonWidget instanceof FocusWidget) {
                    ((FocusWidget) buttonWidget).setFocus(true);
                }
            }
        }
    }

    // mac FF gets bad width due GWT popups overflow hacks,
    // re-determine width
    int offsetWidth = overlay.getOffsetWidth();
    int offsetHeight = overlay.getOffsetHeight();
    if (offsetWidth + left > Window.getClientWidth()) {
        left = left - offsetWidth;
        if (left < 0) {
            left = 0;
        }
    }
    if (offsetHeight + top > Window.getClientHeight()) {
        top = top - offsetHeight;
        if (top < 0) {
            top = 0;
        }
    }

    overlay.setPopupPosition(left, top);
    overlay.setVisible(true);
}

From source file:com.isotrol.impe3.pms.gui.client.widget.systemmanagement.user.GrantedAuthoritiesWindow.java

License:Open Source License

/**
 * Shows retrieved authorities info:<br/>
 * <ul>/*  w  ww  .ja va  2 s .  co m*/
 * <li>if the authorities set is empty, a message is displayed</li>
 * <li>otherwise, a list is displayed with the associated authorities.</li>
 * </ul>
 * @param dto
 */
private void showAuthoritiesInfo(AuthorizationDTO dto) {
    cbRoot.setValue(dto.isRoot());
    Widget widget = null;
    if (dto.getAuthorities().isEmpty()) {
        // create and show a label:
        Label fNoAuthorities = new Label(pmsMessages.msgUserHasNoAuthorities());
        fNoAuthorities.addStyleName(styles.labelInfoMessage());
        widget = fNoAuthorities;
    } else {
        // create, populate and show a data list:
        ListView<MenuItemModelData> lvAuthorities = new ListView<MenuItemModelData>();
        lvAuthorities.setSimpleTemplate(settings.tplListView());
        lvAuthorities.setStore(new ListStore<MenuItemModelData>());
        lvAuthorities.setBorders(false);
        lvAuthorities.setAutoHeight(true);
        lvAuthorities.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);

        List<MenuItemModelData> lModels = new LinkedList<MenuItemModelData>();
        for (GlobalAuthority authority : dto.getAuthorities()) {
            MenuItemModelData model = new MenuItemModelData(authorities.get(authority),
                    pmsStyles.iconAuthorityGranted(), null);
            lModels.add(model);
        }
        lvAuthorities.getStore().add(lModels);
        widget = lvAuthorities;
    }
    widget.addStyleName(styles.marginLeft10px());
    add(widget);
}