Example usage for com.vaadin.client.ui VLabel VLabel

List of usage examples for com.vaadin.client.ui VLabel VLabel

Introduction

In this page you can find the example usage for com.vaadin.client.ui VLabel VLabel.

Prototype

public VLabel(String text) 

Source Link

Usage

From source file:com.wcs.wcslib.vaadin.widget.filtertablestate.client.FilterTableStateConnector.java

License:Apache License

private void initClickFunctions() {
    HTML functionMainDiv = new HTML();
    functionMainDiv.addStyleName(FUNCTION_LAYOUT_STYLE);
    if (getState().functions.isEmpty()) {
        return;/*  ww w  .j a  v  a 2s  .c  o m*/
    }
    VLabel vLabel = new VLabel(getMsg(FUNCTIONS));
    vLabel.addStyleName(LABEL_STYLE);
    $(functionMainDiv).append($(vLabel));
    layout.add(functionMainDiv);

    for (final ClickFunction function : getState().functions) {

        HTML functionDiv = new HTML();
        functionDiv.addStyleName(ITEM_STYLE);
        functionDiv.setTitle(getMsg(SELECT_FUNCTION));

        InlineHTML functionSpan = new InlineHTML("<div>" + function.getName() + "</div>");

        if (getState().selectedFunctionCode != null
                && getState().selectedFunctionCode.equals(function.getCode())) {
            functionSpan.addStyleName(SELECTED_STYLE);
        } else {
            functionSpan.addStyleName(UNSELECTED_STYLE);
        }
        $(functionDiv).click(new Function() {
            @Override
            public void f() {
                closeOverlay();
                rpc.setSelectedFunction(function.getCode());
            }
        });

        $(functionDiv).append($(functionSpan));
        $(functionMainDiv).append($(functionDiv));
    }
}

From source file:com.wcs.wcslib.vaadin.widget.filtertablestate.client.FilterTableStateConnector.java

License:Apache License

private void initColumnVisibilities() {
    HTML functionMainDiv = new HTML();
    functionMainDiv.addStyleName(COLUMN_LAYOUT_STYLE);

    VLabel vLabel = new VLabel(getMsg(COLUMNS));
    vLabel.addStyleName(LABEL_STYLE);/*from  w  w  w.j av  a  2 s. com*/
    $(functionMainDiv).append($(vLabel));
    layout.add(functionMainDiv);

    for (final Action action : filterTable.tHead.getActions()) {
        HTML html = new HTML(action.getHTML());
        html.addStyleName(ITEM_STYLE);

        $(html).click(new Function() {
            @Override
            public void f() {
                action.execute();
                closeOverlay();
            }
        });
        $(functionMainDiv).append($(html));
    }
}

From source file:com.wcs.wcslib.vaadin.widget.filtertablestate.client.FilterTableStateConnector.java

License:Apache License

private void initProfileLayout() {
    final HTML profileLayoutDiv = new HTML();
    profileLayoutDiv.setStyleName(PROFILE_LAYOUT_STYLE);
    layout.add(profileLayoutDiv);// w w w  . j a  v  a2 s  . co  m
    $("." + PROFILE_LAYOUT_STYLE).live(Event.ONMOUSEOVER, new Function() {
        @Override
        public boolean f(Event e) {
            displayBtn(profileLayoutDiv, false);
            return true;
        }
    });
    $("." + PROFILE_LAYOUT_STYLE).live(Event.ONMOUSEOUT, new Function() {
        @Override
        public boolean f(Event e) {
            displayBtn(profileLayoutDiv, true);
            return true;
        }
    });
    VLabel vLabel = new VLabel(getMsg(PROFILES));
    vLabel.addStyleName(LABEL_STYLE);
    $(profileLayoutDiv).append($(vLabel));

    initAddProfileBtn(vLabel, profileLayoutDiv);
    initResetProfileBtn(vLabel, profileLayoutDiv);

    for (final String profile : getState().stateProfiles) {
        HTML profileSpan = initProfileSpan(profile, profileLayoutDiv);

        HTML hideableDiv = new HTML();
        $(hideableDiv).css("display", "inline");
        hideableDiv.addStyleName(HIDEABLE_STYLE);

        InlineHTML saveProfileBtn = null;
        if (getState().selectedProfile != null && getState().selectedProfile.equals(profile)) {
            saveProfileBtn = initProfileSaveButton(profile, profileLayoutDiv);
        }

        InlineHTML deleteProfileBtn = initProfileDeleteButton(profile, profileLayoutDiv);
        InlineHTML defaultProfileBtn = initDefaultProfileButton(profile, profileLayoutDiv);

        $(hideableDiv).append($(deleteProfileBtn));
        $(hideableDiv).append($(defaultProfileBtn));

        if (saveProfileBtn != null) {
            $(hideableDiv).append($(saveProfileBtn));
        }

        HTML profileDiv = new HTML();
        $(profileDiv).append($(profileSpan));
        $(profileDiv).append($(hideableDiv));

        $(profileLayoutDiv).append($(profileDiv));
    }
    displayBtn(profileLayoutDiv, true);
}