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:org.otalo.ao.client.Shortcuts.java

License:Apache License

private void add(Widget widget, ImageResource resource, String caption) {
    widget.addStyleName("mail-StackContent");
    stackPanel.add(widget, createHeaderHTML(resource, caption), true);
}

From source file:org.pentaho.pac.ui.gwt.table.ColumnSupport.java

License:Open Source License

public void addHeaders(AbsolutePanel where) {
    for (int i = 0; i < columns.length; i++) {

        Widget widget = columns[i].getHeader();

        where.add(widget, columnAbsPos[i], 0);
        if (model.getStyles() != null) {
            List<String> styleNames = model.getStyles().getStyleNames(TableStyles.Type.TABLE_HEADER_PANEL);
            if (styleNames != null && styleNames.size() > 0)
                where.addStyleName(styleNames.get(0));

            List<String> lblstyleNames = model.getStyles().getStyleNames(TableStyles.Type.TABLE_HEADER_TEXT);
            if (lblstyleNames != null && lblstyleNames.size() > 0)
                widget.addStyleName(lblstyleNames.get(0));

        }// w  w w .ja v  a  2s.  c  om
        widget.setPixelSize(columns[i].getWidth(), model.getPixelHeaderHeight());
    }
}

From source file:org.rebioma.client.AdvanceSearchView.java

License:Apache License

public void onMouseOut(MouseOutEvent event) {
    Object source = event.getSource();
    Widget widget = (Widget) source;
    widget.removeStyleName("hover");
    widget.addStyleName("out");
}

From source file:org.rebioma.client.AdvanceSearchView.java

License:Apache License

public void onMouseOver(MouseOverEvent event) {
    Object source = event.getSource();
    Widget widget = (Widget) source;
    widget.removeStyleName("out");
    widget.addStyleName("hover");
}

From source file:org.rebioma.client.SingleUploader.java

License:Apache License

/**
 * This constructor allows to use an existing form panel.
 * /* w  ww . j av  a 2s.  c  om*/
 * @param type
 *        file input to use
 * @param status
 *        Customized status widget to use
 * @param submitButton
 *        Customized button which submits the form
 * @param form
 *        Customized form panel
 */
public SingleUploader(FileInputType type, IUploadStatus status, Widget submitButton, FormPanel form) {
    super(type, form);

    final Uploader thisInstance = this;

    if (status == null) {
        status = new BaseUploadStatus();
        super.add(status.getWidget());
    }
    super.setStatusWidget(status);

    this.button = submitButton;
    if (submitButton != null) {
        submitButton.addStyleName("submit");
        if (submitButton instanceof HasClickHandlers) {
            ((HasClickHandlers) submitButton).addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent event) {
                    thisInstance.submit();
                }
            });
        }
        if (submitButton instanceof HasText) {
            ((HasText) submitButton).setText(I18N_CONSTANTS.uploaderSend());
        }
        // The user could have attached the button anywhere in the page.
        if (!submitButton.isAttached()) {
            super.add(submitButton);
        }
    }
}

From source file:org.roda.wui.client.process.CreateDefaultJob.java

public void configurePlugins() {
    List<String> categoriesOnListBox = new ArrayList<>();

    if (plugins != null) {
        PluginUtils.sortByName(plugins);

        for (int p = 0; p < plugins.size(); p++) {
            PluginInfo pluginInfo = plugins.get(p);

            if (pluginInfo != null) {
                List<String> pluginCategories = pluginInfo.getCategories();

                if (pluginCategories != null
                        && !pluginCategories.contains(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE)) {
                    for (String category : pluginCategories) {
                        if (!categoriesOnListBox.contains(category)) {

                            CheckBox box = new CheckBox();
                            box.setText(messages.showPluginCategories(category));
                            box.setName(category);
                            box.addStyleName("form-checkbox-job");

                            box.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

                                @Override
                                public void onValueChange(ValueChangeEvent<Boolean> event) {
                                    workflowList.clear();
                                    boolean noChecks = true;

                                    if (plugins != null) {
                                        PluginUtils.sortByName(plugins);
                                        List<String> pluginsAdded = new ArrayList<>();

                                        for (int p = 0; p < plugins.size(); p++) {
                                            PluginInfo pluginInfo = plugins.get(p);
                                            if (pluginInfo != null) {
                                                List<String> categories = pluginInfo.getCategories();

                                                if (categories != null) {
                                                    for (int i = 0; i < workflowCategoryList
                                                            .getWidgetCount(); i++) {
                                                        CheckBox checkbox = (CheckBox) workflowCategoryList
                                                                .getWidget(i);

                                                        if (checkbox.getValue().booleanValue()) {
                                                            noChecks = false;

                                                            if (categories.contains(checkbox.getName())
                                                                    && !categories.contains(
                                                                            RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE)
                                                                    && !pluginsAdded
                                                                            .contains(pluginInfo.getId())) {
                                                                Widget pluginItem = addPluginItemWidgetToWorkflowList(
                                                                        pluginInfo);
                                                                if (pluginsAdded.isEmpty()) {
                                                                    CreateDefaultJob.this.selectedPlugin = lookupPlugin(
                                                                            pluginInfo.getId());
                                                                    pluginItem.addStyleName(
                                                                            "plugin-list-item-selected");
                                                                }
                                                                pluginsAdded.add(pluginInfo.getId());
                                                            }
                                                        }
                                                    }

                                                    if (noChecks) {
                                                        if (!pluginInfo.getCategories().contains(
                                                                RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE)) {
                                                            Widget pluginItem = addPluginItemWidgetToWorkflowList(
                                                                    pluginInfo);
                                                            if (p == 0) {
                                                                CreateDefaultJob.this.selectedPlugin = lookupPlugin(
                                                                        pluginInfo.getId());
                                                                pluginItem.addStyleName(
                                                                        "plugin-list-item-selected");
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }/*from  w w  w .  j  a v a  2  s . c om*/

                                    updateWorkflowOptions();
                                }
                            });

                            workflowCategoryList.add(box);
                            categoriesOnListBox.add(category);
                        }
                    }

                    if (!pluginCategories.contains(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE)) {
                        Widget pluginItem = addPluginItemWidgetToWorkflowList(pluginInfo);
                        if (p == 0) {
                            CreateDefaultJob.this.selectedPlugin = lookupPlugin(pluginInfo.getId());
                            pluginItem.addStyleName("plugin-list-item-selected");
                        }
                    }
                }

            }
        }

        updateWorkflowOptions();
    }
}

From source file:org.roda.wui.client.process.CreateSelectedJob.java

public void configurePlugins(final String selectedClass) {
    List<String> categoriesOnListBox = new ArrayList<>();

    if (plugins != null) {
        PluginUtils.sortByName(plugins);

        int pluginAdded = 0;
        for (PluginInfo pluginInfo : plugins) {

            if (pluginInfo != null) {
                List<String> pluginCategories = pluginInfo.getCategories();

                if (pluginCategories != null) {
                    for (String category : pluginCategories) {
                        if (!categoriesOnListBox.contains(category)
                                && !category.equals(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE)
                                && ((!isSelectedEmpty() && pluginInfo.hasObjectClass(selectedClass))
                                        || (isSelectedEmpty()
                                                && pluginInfo.hasObjectClass(listSelectedClass)))) {

                            CheckBox box = new CheckBox();
                            box.setText(messages.showPluginCategories(category));
                            box.setName(category);
                            box.addStyleName("form-checkbox-job");

                            box.addValueChangeHandler(new ValueChangeHandler<Boolean>() {

                                @Override
                                public void onValueChange(ValueChangeEvent<Boolean> event) {
                                    workflowList.clear();
                                    boolean noChecks = true;

                                    if (plugins != null) {
                                        PluginUtils.sortByName(plugins);
                                        List<String> pluginsAdded = new ArrayList<>();

                                        for (PluginInfo pluginInfo : plugins) {
                                            if (pluginInfo != null) {
                                                List<String> categories = pluginInfo.getCategories();

                                                if (categories != null) {
                                                    for (int i = 0; i < workflowCategoryList
                                                            .getWidgetCount(); i++) {
                                                        CheckBox checkbox = (CheckBox) workflowCategoryList
                                                                .getWidget(i);

                                                        if (checkbox.getValue()) {
                                                            noChecks = false;

                                                            if (categories.contains(checkbox.getName())
                                                                    && !categories.contains(
                                                                            RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE)
                                                                    && ((!isSelectedEmpty() && pluginInfo
                                                                            .hasObjectClass(selectedClass))
                                                                            || (isSelectedEmpty() && pluginInfo
                                                                                    .hasObjectClass(
                                                                                            listSelectedClass)))
                                                                    && !pluginsAdded
                                                                            .contains(pluginInfo.getId())) {
                                                                Widget pluginItem = addPluginItemWidgetToWorkflowList(
                                                                        pluginInfo);

                                                                if (pluginsAdded.isEmpty()) {
                                                                    CreateSelectedJob.this.selectedPlugin = lookupPlugin(
                                                                            pluginInfo.getId());
                                                                    pluginItem.addStyleName(
                                                                            "plugin-list-item-selected");
                                                                }

                                                                pluginsAdded.add(pluginInfo.getId());
                                                            }

                                                        }
                                                    }

                                                    if (noChecks) {
                                                        if (!pluginInfo.getCategories().contains(
                                                                RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE)
                                                                && ((!isSelectedEmpty() && pluginInfo
                                                                        .hasObjectClass(selectedClass))
                                                                        || (isSelectedEmpty()
                                                                                && pluginInfo.hasObjectClass(
                                                                                        listSelectedClass)))) {
                                                            Widget pluginItem = addPluginItemWidgetToWorkflowList(
                                                                    pluginInfo);
                                                            if (pluginsAdded.isEmpty()) {
                                                                CreateSelectedJob.this.selectedPlugin = lookupPlugin(
                                                                        pluginInfo.getId());
                                                                pluginItem.addStyleName(
                                                                        "plugin-list-item-selected");
                                                            }

                                                            pluginsAdded.add(pluginInfo.getId());
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }//from  w w  w.  j  a v a  2s  .  co m

                                    updateWorkflowOptions();
                                }

                            });

                            workflowCategoryList.add(box);
                            categoriesOnListBox.add(category);
                        }
                    }

                    if (!pluginCategories.contains(RodaConstants.PLUGIN_CATEGORY_NOT_LISTABLE)
                            && ((!isSelectedEmpty() && pluginInfo.hasObjectClass(selectedClass))
                                    || (isSelectedEmpty() && pluginInfo.hasObjectClass(listSelectedClass)))) {
                        Widget pluginItem = addPluginItemWidgetToWorkflowList(pluginInfo);
                        if (pluginAdded == 0) {
                            CreateSelectedJob.this.selectedPlugin = lookupPlugin(pluginInfo.getId());
                            pluginItem.addStyleName("plugin-list-item-selected");
                            pluginAdded++;
                        }
                    }
                }

            }
        }

        updateWorkflowOptions();
    }
}

From source file:org.rstudio.core.client.prefs.PreferencesDialogPaneBase.java

License:Open Source License

protected Widget indent(Widget widget) {
    widget.addStyleName(res_.styles().indent());
    return widget;
}

From source file:org.rstudio.core.client.prefs.PreferencesDialogPaneBase.java

License:Open Source License

protected Widget tight(Widget widget) {
    widget.addStyleName(res_.styles().tight());
    return widget;
}

From source file:org.rstudio.core.client.prefs.PreferencesDialogPaneBase.java

License:Open Source License

protected Widget lessSpaced(Widget widget) {
    if (!BrowseCap.isLinuxDesktop()) {
        widget.addStyleName(res_.styles().lessSpaced());
        return widget;
    } else {// w w  w  .  j  a v a2 s  .c  om
        return widget;
    }
}