Example usage for com.vaadin.ui PopupView PopupView

List of usage examples for com.vaadin.ui PopupView PopupView

Introduction

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

Prototype

public PopupView(final String small, final Component large) 

Source Link

Document

A simple way to create a PopupPanel.

Usage

From source file:dhbw.clippinggorilla.userinterface.windows.GroupProfileWindow.java

public GroupProfileWindow(GroupInterestProfile p, Runnable onClose, boolean isAdmin) {
    VerticalLayout profileSettingsLayout = new VerticalLayout();
    GridLayout windowContent;/*  ww  w  .  jav a 2 s .  c o m*/
    Button buttonSave = new Button();

    if (isAdmin) {
        windowContent = new GridLayout(3, 3);

        TextField textFieldName = new TextField();
        Language.set(Word.NAME, textFieldName);
        textFieldName.setWidth("100%");
        textFieldName.setValue(p.getName());
        textFieldName.setMaxLength(255);

        Language.set(Word.SAVE, buttonSave);
        buttonSave.setIcon(VaadinIcons.CHECK);
        buttonSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
        buttonSave.addClickListener(ce -> {
            GroupInterestProfileUtils.changeName(p, textFieldName.getValue());
            GroupInterestProfileUtils.changeSources(p, p.getSources());
            GroupInterestProfileUtils.changeCategories(p, p.getCategories());
            GroupInterestProfileUtils.changeAllTags(p, p.getTags());
            VaadinUtils.infoNotification(Language.get(Word.SUCCESSFULLY_SAVED));
            close();
            onClose.run();
        });

        Label placeholder2 = new Label();
        placeholder2.setWidth("100%");
        windowContent.addComponents(textFieldName, placeholder2);
        windowContent.setComponentAlignment(textFieldName, Alignment.MIDDLE_LEFT);
        windowContent.addComponent(getSources(p, true), 0, 1, 1, 1);
        windowContent.addComponent(getCategories(p, true), 2, 1);
        windowContent.addComponent(getTags(p, true), 0, 2, 2, 2);
    } else {
        windowContent = new GridLayout(3, 2);

        Language.set(Word.CLOSE, buttonSave);
        buttonSave.setIcon(VaadinIcons.CLOSE);
        buttonSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
        buttonSave.addClickListener(ce -> {
            close();
            onClose.run();
        });

        windowContent.addComponent(getSources(p, false), 0, 0, 1, 0);
        windowContent.addComponent(getCategories(p, false), 2, 0);
        windowContent.addComponent(getTags(p, false), 0, 1, 2, 1);
    }

    buttonSave.setClickShortcut(ShortcutAction.KeyCode.ENTER, null);

    Label placeholder = new Label();

    Label labelHelp = new Label(Language.get(Word.HELP_TEXT), ContentMode.HTML);
    labelHelp.setWidth("500px");
    PopupView popupHelp = new PopupView(null, labelHelp);

    Button buttonHelp = new Button(Language.get(Word.HELP), VaadinIcons.QUESTION);
    buttonHelp.addClickListener(ce -> {
        popupHelp.setPopupVisible(true);
    });

    GridLayout footer;
    if (isAdmin) {
        footer = new GridLayout(4, 1);
        footer.addComponents(buttonHelp, popupHelp, placeholder, buttonSave);
        footer.setColumnExpandRatio(2, 5);
    } else {
        footer = new GridLayout(2, 1);
        footer.addComponents(placeholder, buttonSave);
        footer.setColumnExpandRatio(0, 5);

    }
    footer.setSpacing(true);
    footer.setSizeUndefined();
    footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    footer.setWidth("100%");
    footer.addStyleName("menubar");
    footer.setComponentAlignment(buttonSave, Alignment.MIDDLE_CENTER);

    windowContent.setWidth("100%");
    windowContent.setSpacing(true);
    windowContent.setMargin(true);
    windowContent.addStyleName("profiles");
    profileSettingsLayout.addComponents(windowContent, footer);
    profileSettingsLayout.setMargin(false);
    profileSettingsLayout.setSpacing(false);
    profileSettingsLayout.setWidth("100%");

    setContent(profileSettingsLayout);
    center();
    setWidthUndefined();
    setCaption(p.getName());
    setWidth("950px");
}

From source file:dhbw.clippinggorilla.userinterface.windows.GroupProfileWindow.java

public Component getSources(GroupInterestProfile profile, boolean isAdmin) {
    VerticalLayout windowLayout = new VerticalLayout();
    windowLayout.setWidth("100%");
    VerticalLayout sourcesLayout = new VerticalLayout();
    sourcesLayout.setWidth("100%");
    Panel sourcesPanel = new Panel(sourcesLayout);

    List<CheckBox> checkBoxes = new ArrayList<>();
    HashMap<String, GridLayout> sourceLayouts = new HashMap<>();
    profile.getSources().entrySet().stream()
            .sorted((e1, e2) -> e1.getKey().getName().compareToIgnoreCase(e2.getKey().getName())).forEach(e -> {
                Source source = e.getKey();
                boolean enabled = e.getValue();
                GridLayout sourceLayout = new GridLayout(5, 1);
                sourceLayout.setSizeFull();

                CheckBox sourceSelected = new CheckBox();
                sourceSelected.setValue(enabled);
                sourceSelected.addStyleName(ValoTheme.CHECKBOX_LARGE);
                sourceSelected.addValueChangeListener(v -> profile.getSources().replace(source, v.getValue()));
                sourceSelected.setEnabled(isAdmin);
                checkBoxes.add(sourceSelected);

                Image sourceLogo = new Image();
                sourceLogo.addStyleName("logosmall");
                sourceLogo.setSource(new ExternalResource(source.getLogo()));
                if (isAdmin) {
                    sourceLogo.addClickListener(c -> {
                        sourceSelected.setValue(!sourceSelected.getValue());
                        profile.getSources().replace(source, sourceSelected.getValue());
                    });/*  ww  w .  j  a v a2s  . com*/
                }
                VerticalLayout layoutLogo = new VerticalLayout(sourceLogo);
                layoutLogo.setWidth("150px");
                layoutLogo.setHeight("50px");
                layoutLogo.setMargin(false);
                layoutLogo.setSpacing(false);
                layoutLogo.setComponentAlignment(sourceLogo, Alignment.MIDDLE_LEFT);

                Label labelHeadLine = new Label(
                        source.getCategory().getIcon().getHtml() + "  " + source.getName(), ContentMode.HTML);
                labelHeadLine.addStyleName(ValoTheme.LABEL_H3);

                Label labelDescription = new Label(source.getDescription(), ContentMode.HTML);
                labelDescription.setWidth("300px");
                PopupView popup = new PopupView(null, labelDescription);

                Button buttonDescription = new Button(VaadinIcons.INFO_CIRCLE_O);
                buttonDescription.addClickListener(ce -> {
                    popup.setPopupVisible(true);
                });

                sourceLayout.addComponents(sourceSelected, layoutLogo, labelHeadLine, popup, buttonDescription);
                sourceLayout.setComponentAlignment(sourceSelected, Alignment.MIDDLE_CENTER);
                sourceLayout.setComponentAlignment(layoutLogo, Alignment.MIDDLE_CENTER);
                sourceLayout.setColumnExpandRatio(2, 5);
                sourceLayout.setSpacing(true);

                sourceLayouts.put(source.getName().toLowerCase().replaceAll(" ", "").replaceAll("-", "")
                        .replaceAll("_", ""), sourceLayout);
                sourcesLayout.addComponent(sourceLayout);
            });

    sourcesPanel.setContent(sourcesLayout);
    sourcesPanel.setHeight("100%");
    sourcesPanel.setCaption(Language.get(Word.SOURCES));
    Language.setCustom(Word.SOURCES, s -> sourcesPanel.setCaption(s));
    windowLayout.addComponent(sourcesPanel);
    windowLayout.setExpandRatio(sourcesPanel, 1);
    windowLayout.setSpacing(false);
    windowLayout.setMargin(false);

    CheckBox checkBoxSelectAll = new CheckBox();
    Language.setCustom(Word.SELECT_ALL, s -> checkBoxSelectAll.setCaption(s));
    checkBoxSelectAll.setWidth("100%");
    checkBoxSelectAll.addValueChangeListener(e -> {
        profile.getSources().replaceAll((c, enabled) -> checkBoxSelectAll.getValue());
        checkBoxes.forEach(c -> c.setValue(checkBoxSelectAll.getValue()));
    });
    checkBoxSelectAll.setEnabled(isAdmin);

    TextField textFieldSearch = new TextField();
    Language.setCustom(Word.SEARCH, s -> textFieldSearch.setPlaceholder(s));
    textFieldSearch.setWidth("100%");
    textFieldSearch.setMaxLength(255);
    textFieldSearch.setPlaceholder(Language.get(Word.SEARCH));
    textFieldSearch.addValueChangeListener(searchValue -> {
        sourceLayouts.forEach((sourceName, sourceLayout) -> {
            if (!sourceName.contains(searchValue.getValue().toLowerCase().replaceAll(" ", "")
                    .replaceAll("-", "").replaceAll("_", ""))) {
                sourcesLayout.removeComponent(sourceLayout);
            } else {
                sourcesLayout.addComponent(sourceLayout);
            }
        });
    });

    Label placeholder = new Label();
    placeholder.setWidth("100%");

    GridLayout footer = new GridLayout(3, 1);
    footer.setSpacing(true);
    footer.setMargin(new MarginInfo(true, false, false, false));
    footer.addStyleName("menubar");
    footer.setWidth("100%");
    footer.addComponents(checkBoxSelectAll, textFieldSearch, placeholder);
    footer.setComponentAlignment(checkBoxSelectAll, Alignment.MIDDLE_LEFT);
    footer.setComponentAlignment(textFieldSearch, Alignment.MIDDLE_CENTER);

    windowLayout.addComponent(footer);
    windowLayout.setHeight("350px");
    return windowLayout;
}

From source file:edu.kit.dama.ui.repo.components.ShareObjectComponent.java

/**
 * Get the popup view containing this component.
 *
 * @return The popup view.//w  w w .  j a  v a 2s.  c om
 */
public final PopupView getPopupView() {
    if (sharePopup == null) {
        sharePopup = new PopupView(null, mainLayout);
        sharePopup.setHideOnMouseOut(false);
    }

    return sharePopup;
}

From source file:edu.kit.dama.ui.repo.MyVaadinUI.java

License:Apache License

/**
 * Build the search view and execute the provided query immediately.
 *
 * @param pQuery The query to execute or null if an empty view should be
 * shown./*  ww  w  .  ja  v a2s .c  om*/
 */
private void buildSearchView(String pQuery) {
    loginButton.setWidth("70px");
    loginButton.setStyleName(BaseTheme.BUTTON_LINK);
    logoutButton.setWidth("70px");
    logoutButton.setStyleName(BaseTheme.BUTTON_LINK);
    adminButton.setWidth("70px");
    adminButton.setStyleName(BaseTheme.BUTTON_LINK);

    logoutButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            loggedInUser = UserData.NO_USER;
            refreshMainLayout();
        }
    });

    adminButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            Page.getCurrent()
                    .open(DataManagerSettings.getSingleton().getStringProperty(
                            DataManagerSettings.GENERAL_BASE_URL_ID, "http://localhost:8889/BaReDemo")
                            + "/admin", "_blank");
        }
    });

    searchField = UIUtils7.factoryTextField(null, "Search for...");
    searchField.setWidth("920px");
    searchField.setHeight("60px");
    searchField.addStyleName("searchField");

    paginationPanel = new PaginationPanel(this);
    paginationPanel.setSizeFull();
    paginationPanel.setAllEntries(new LinkedList<DigitalObjectId>());

    searchProvider = new FulltextElasticSearchProvider(
            DataManagerSettings.getSingleton()
                    .getStringProperty(DataManagerSettings.ELASTIC_SEARCH_DEFAULT_CLUSTER_ID, "KITDataManager"),
            DataManagerSettings.getSingleton()
                    .getStringProperty(DataManagerSettings.ELASTIC_SEARCH_DEFAULT_HOST_ID, "localhost"),
            DataManagerSettings.getSingleton().getStringProperty(
                    DataManagerSettings.ELASTIC_SEARCH_DEFAULT_INDEX_ID,
                    ElasticsearchHelper.ELASTICSEARCH_TYPE),
            ElasticsearchHelper.ELASTICSEARCH_TYPE);
    NativeButton goButton = new NativeButton();
    goButton.setIcon(new ThemeResource("img/24x24/search.png"));
    goButton.setWidth("60px");
    goButton.setHeight("60px");
    goButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            doSearch();
        }
    });
    goButton.setClickShortcut(KeyCode.ENTER);

    setupLoginForm();
    loginForm.setWidth("320px");
    loginForm.setHeight("150px");
    final PopupView loginPopup = new PopupView(null, loginForm);
    loginPopup.setHideOnMouseOut(false);
    loginButton.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            //mainLayout.replaceComponent(searchLayout, loginForm);
            loginPopup.setPopupVisible(true);
        }
    });

    Label filler = new Label();
    memberLayout = new HorizontalLayout(filler, adminButton, loginButton, loginPopup);
    memberLayout.setComponentAlignment(loginButton, Alignment.TOP_RIGHT);
    memberLayout.setComponentAlignment(adminButton, Alignment.TOP_RIGHT);
    memberLayout.setComponentAlignment(loginPopup, Alignment.TOP_RIGHT);

    memberLayout.setExpandRatio(filler, 1.0f);
    memberLayout.setMargin(false);
    memberLayout.setSpacing(false);
    memberLayout.setWidth("100%");
    memberLayout.setHeight("30px");

    Label spacer = new Label("<hr/>", ContentMode.HTML);
    spacer.setHeight("20px");

    searchLayout = new UIUtils7.GridLayoutBuilder(3, 4)
            .addComponent(searchField, Alignment.TOP_LEFT, 0, 0, 2, 1)
            .addComponent(goButton, Alignment.TOP_RIGHT, 2, 0, 1, 1).fillRow(spacer, 0, 1, 1)
            .addComponent(paginationPanel, Alignment.MIDDLE_CENTER, 0, 2, 3, 2).getLayout();
    searchLayout.addStyleName("paper");
    searchLayout.setSpacing(true);
    searchLayout.setMargin(true);
    paginationPanel.setWidth("980px");
    //wrapper
    Label icon8Link = new Label("<a href=\"http://icons8.com\">Icons by icon8.com</a>", ContentMode.HTML);
    mainLayout = new VerticalLayout(memberLayout, searchLayout, icon8Link);
    mainLayout.setComponentAlignment(memberLayout, Alignment.TOP_CENTER);
    mainLayout.setComponentAlignment(searchLayout, Alignment.TOP_CENTER);
    mainLayout.setComponentAlignment(icon8Link, Alignment.BOTTOM_RIGHT);
    mainLayout.setExpandRatio(memberLayout, .05f);
    mainLayout.setExpandRatio(searchLayout, .93f);
    mainLayout.setExpandRatio(icon8Link, .02f);

    VerticalLayout fullscreen = new VerticalLayout(mainLayout);
    fullscreen.setComponentAlignment(mainLayout, Alignment.TOP_CENTER);
    fullscreen.setSizeFull();
    setContent(fullscreen);

    mainLayout.setWidth("1024px");
    mainLayout.setHeight("768px");

    if (pQuery != null) {
        searchField.setValue(pQuery);
        doSearch();
    }
}

From source file:edu.nps.moves.mmowgli.modules.administration.VipListManager.java

License:Open Source License

@SuppressWarnings({ "unchecked", "serial" })
private void showViewOrDelete(final DeleteListener lis) {
    dialog = new Window("View / Delete VIPs");
    dialog.setModal(true);/*from  w  w w  .j a v a  2 s .c  o m*/

    VerticalLayout layout = new VerticalLayout();
    dialog.setContent(layout);
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setSizeFull();

    List<VipPii> vLis = VHibPii.getAllVips();

    vipListSelect = new ListSelect("Select items to delete");
    StringBuffer sb = new StringBuffer(); // for popup
    vipListSelect.addStyleName("m-greyborder");
    String lf = System.getProperty("line.separator");
    for (int i = 0; i < vLis.size(); i++) {
        VipPii v;
        vipListSelect.addItem(v = vLis.get(i));
        sb.append(v.getEntry());
        sb.append(lf);
    }
    if (sb.length() > 0)
        sb.setLength(sb.length() - 1); // last space

    vipListSelect.setNullSelectionAllowed(true);
    vipListSelect.setMultiSelect(true);
    vipListSelect.setImmediate(true);
    vipListSelect.addValueChangeListener(new VipSelectListener());

    layout.addComponent(vipListSelect);

    Label copyPopupList = new HtmlLabel("<pre>" + sb.toString() + "</pre>");
    Panel p = new Panel();
    VerticalLayout lay = new VerticalLayout();
    p.setContent(lay);
    lay.addComponent(copyPopupList);
    p.setWidth("400px");
    p.setHeight("300px");
    PopupView popup = new PopupView("Display list as copyable text", p);
    popup.setHideOnMouseOut(false);
    if (sb.length() <= 0)
        popup.setEnabled(false);

    layout.addComponent(popup);
    layout.setComponentAlignment(popup, Alignment.MIDDLE_CENTER);

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);
    Button cancelButt = new Button("Cancel", new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            dialog.close();
            lis.continueOrCancel(null);
        }
    });

    deleteButt = new Button("Delete & Close", new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            Set<VipPii> set = (Set<VipPii>) vipListSelect.getValue();
            if (set.size() <= 0)
                set = null;
            dialog.close();
            lis.continueOrCancel(set);
        }
    });
    deleteButt.setEnabled(false);
    hl.addComponent(cancelButt);
    hl.addComponent(deleteButt);
    hl.setComponentAlignment(cancelButt, Alignment.MIDDLE_RIGHT);
    hl.setExpandRatio(cancelButt, 1.0f);

    // The components added to the window are actually added to the window's
    // layout; you can use either. Alignments are set using the layout
    layout.addComponent(hl);
    dialog.setWidth("300px");
    dialog.setHeight("350px");
    hl.setWidth("100%");
    vipListSelect.setWidth("99%");
    vipListSelect.setHeight("99%");
    layout.setExpandRatio(vipListSelect, 1.0f);

    UI.getCurrent().addWindow(dialog);
    dialog.center();
}

From source file:eu.fp7.eagle.portal.ui.dashboard.design.impl.ActivitiesDesignImpl.java

License:Apache License

private GridLayout buildSubjectsLayout() {

    gridLayoutSubjects = new GridLayout(8, 1);
    gridLayoutSubjects.setImmediate(false);
    gridLayoutSubjects.setWidth("100%");
    gridLayoutSubjects.setHeight("-1px");
    gridLayoutSubjects.setSpacing(true);
    gridLayoutSubjects.setCaption("My Subjects");
    gridLayoutSubjects.addStyleName("gridLayoutSubjects");
    MarginInfo margin = new MarginInfo(true, false, true, false);
    gridLayoutSubjects.setMargin(margin);
    gridLayoutSubjects.setSpacing(false);
    gridLayoutSubjects.setColumnExpandRatio(7, 1.0f);

    PopupView popup = new PopupView(null, buildTableActivity("Migration", 3, 2));
    popup.addStyleName("popupviewActivities");
    Button migration = new Button("Migration" + " " + "(5)", click -> popup.setPopupVisible(true));
    migration.addStyleName("buttonSubjectsListAct");
    gridLayoutSubjects.addComponent(migration, 0, 0);
    //popup.setWidth("100px");
    gridLayoutSubjects.addComponent(popup, 1, 0);

    PopupView popup2 = new PopupView(null, buildTableActivity("Housing", 0, 0));
    popup2.addStyleName("popupviewActivities");
    Button housing = new Button("Housing", click -> popup.setPopupVisible(false));
    housing.addStyleName("buttonSubjectsEmptyAct");
    gridLayoutSubjects.addComponent(housing, 2, 0);
    //popup2.setWidth("100px");
    gridLayoutSubjects.addComponent(popup2, 3, 0);

    return gridLayoutSubjects;
}

From source file:eu.fp7.eagle.portal.ui.dashboard.design.impl.ActivitiesDesignImpl.java

License:Apache License

private GridLayout buildResourcesLayout() {

    gridLayoutResources = new GridLayout(8, 1);
    gridLayoutResources.setImmediate(false);
    gridLayoutResources.setWidth("100%");
    gridLayoutResources.setHeight("-1px");
    gridLayoutResources.setSpacing(true);
    gridLayoutResources.setCaption("My Resources");
    gridLayoutResources.addStyleName("gridLayoutResources");
    MarginInfo margin = new MarginInfo(true, false, true, false);
    gridLayoutResources.setMargin(margin);
    gridLayoutResources.setSpacing(false);
    gridLayoutResources.setColumnExpandRatio(7, 1.0f);

    PopupView popup = new PopupView(null, buildTableActivity("OER", 2, 2));
    popup.addStyleName("popupviewActivities");
    Button oer = new Button("OER" + " " + "(4)", click -> popup.setPopupVisible(true));
    oer.addStyleName("buttonResourcesListAct");
    gridLayoutResources.addComponent(oer, 0, 0);
    //popup.setWidth("100px");
    gridLayoutResources.addComponent(popup, 1, 0);

    PopupView popup2 = new PopupView(null, buildTableActivity("Wiki", 1, 2));
    popup2.addStyleName("popupviewActivities");
    Button wiki = new Button("Wiki" + " " + "(3)", click -> popup2.setPopupVisible(true));
    wiki.addStyleName("buttonResourcesListAct");
    gridLayoutResources.addComponent(wiki, 2, 0);
    popup2.setWidth("100px");
    gridLayoutResources.addComponent(popup2, 3, 0);

    PopupView popup3 = new PopupView(null, buildTableActivity("Blogs", 0, 0));
    popup3.addStyleName("popupviewActivities");
    Button blogs = new Button("Blogs", click -> popup3.setPopupVisible(false));
    blogs.addStyleName("buttonResourcesEmptyAct");
    gridLayoutResources.addComponent(blogs, 4, 0);
    //popup3.setWidth("100px");
    gridLayoutResources.addComponent(popup3, 5, 0);

    PopupView popup4 = new PopupView(null, buildTableActivity("Comments", 5, 5));
    popup4.addStyleName("popupviewActivities");
    Button comments = new Button("Comments" + " " + "(10)", click -> popup4.setPopupVisible(true));
    comments.addStyleName("buttonResourcesListAct");
    gridLayoutResources.addComponent(comments, 6, 0);
    //popup4.setWidth("100px");
    gridLayoutResources.addComponent(popup4, 7, 0);

    return gridLayoutResources;
}

From source file:eu.fp7.eagle.portal.ui.dashboard.design.impl.BadgesDesignImpl.java

License:Apache License

/**
 * @return badgeLayoutOERCreator//from  ww w .j a va 2 s  .  co m
 */
private HorizontalLayout buildBadgeLayoutOERCreator() {

    badgeLayoutOERCreator = new HorizontalLayout();
    badgeLayoutOERCreator.setWidth("100%");
    badgeLayoutOERCreator.setMargin(false);
    badgeLayoutOERCreator.setSpacing(false);

    imageLayoutOERCreator = new VerticalLayout();
    imageLayoutOERCreator.setWidth("100%");
    imageLayoutOERCreator.setMargin(false);
    imageLayoutOERCreator.setSpacing(false);
    badgeLayoutOERCreator.addComponent(imageLayoutOERCreator);
    badgeLayoutOERCreator.setExpandRatio(imageLayoutOERCreator, 0.2f);

    labelBadgeOERCreator = new Label("OER Creator");
    imageLayoutOERCreator.addComponent(labelBadgeOERCreator);

    imageBadgeOC.setId("OER_CREATOR");
    imageLayoutOERCreator.addComponent(imageBadgeOC);

    tableAchOERCreator = new Table();
    popupViewAchOERCreator = new PopupView(null, tableAchOERCreator);
    imageLayoutOERCreator.addComponent(popupViewAchOERCreator);

    barLayoutOERCreator = new VerticalLayout();
    barLayoutOERCreator.setId("BL_OER_CREATOR");
    barLayoutOERCreator.setWidth("100%");
    badgeLayoutOERCreator.addComponent(barLayoutOERCreator);
    badgeLayoutOERCreator.setExpandRatio(barLayoutOERCreator, 0.8f);

    starLayoutOERCreator = new HorizontalLayout();
    starLayoutOERCreator.setWidth("100%");
    starLayoutOERCreator.setSpacing(false);
    starLayoutOERCreator.setMargin(false);
    barLayoutOERCreator.addComponent(starLayoutOERCreator);

    starLayoutOERCreator.addComponent(imageBadgeStar1OC);

    starLayoutOERCreator.addComponent(imageBadgeStar2OC);

    starLayoutOERCreator.addComponent(imageBadgeStar3OC);

    starLayoutOERCreator.addComponent(imageBadgeFlagOC);

    progressBarOERCreator = new ProgressBar(0.0f);
    progressBarOERCreator.setId("PB_OER_CREATOR");
    progressBarOERCreator.setWidth("100%");
    progressBarOERCreator.setHeight("100%");
    barLayoutOERCreator.addComponent(progressBarOERCreator);

    levelLayoutOERCreator = new HorizontalLayout();
    levelLayoutOERCreator.setWidth("100%");

    labelLevelNoviceOC = new Label("<div id= level><b>Novice</b></div>", ContentMode.HTML);
    levelLayoutOERCreator.addComponent(labelLevelNoviceOC);

    labelLevelInterOC = new Label("<div id= level><b>Intermediate</b></div>", ContentMode.HTML);
    levelLayoutOERCreator.addComponent(labelLevelInterOC);

    labelLevelAdvOC = new Label("<div id= level><b>Advanced</b></div>", ContentMode.HTML);
    levelLayoutOERCreator.addComponent(labelLevelAdvOC);

    labelLevelExpOC = new Label("<div id= level><b>Expert</b></div>", ContentMode.HTML);
    ;
    levelLayoutOERCreator.addComponent(labelLevelExpOC);

    barLayoutOERCreator.addComponent(levelLayoutOERCreator);

    tableTasksOERCreator = new Table();
    popupViewTasksOERCreator = new PopupView(null, tableTasksOERCreator);
    barLayoutOERCreator.addComponent(popupViewTasksOERCreator);

    return badgeLayoutOERCreator;

}

From source file:eu.fp7.eagle.portal.ui.dashboard.design.impl.BadgesDesignImpl.java

License:Apache License

/**
 * @return badgeLayoutReviewer//from   w  ww .j  a  va  2  s  . c o  m
 */
private HorizontalLayout buildBadgeLayoutReviewer() {

    badgeLayoutReviewer = new HorizontalLayout();
    badgeLayoutReviewer.setWidth("100%");
    badgeLayoutReviewer.setMargin(false);
    badgeLayoutReviewer.setSpacing(false);

    imageLayoutReviewer = new VerticalLayout();
    imageLayoutReviewer.setWidth("100%");
    imageLayoutReviewer.setMargin(false);
    imageLayoutReviewer.setSpacing(false);
    badgeLayoutReviewer.addComponent(imageLayoutReviewer);
    badgeLayoutReviewer.setExpandRatio(imageLayoutReviewer, 0.2f);

    labelBadgeReviewer = new Label("Reviewer");
    imageLayoutReviewer.addComponent(labelBadgeReviewer);

    imageBadgeRev.setId("REVIEWER");
    imageLayoutReviewer.addComponent(imageBadgeRev);

    tableAchReviewer = new Table();
    popupViewAchReviewer = new PopupView(null, tableAchReviewer);
    imageLayoutReviewer.addComponent(popupViewAchReviewer);

    barLayoutReviewer = new VerticalLayout();
    barLayoutReviewer.setId("BL_REVIEWER");
    barLayoutReviewer.setWidth("100%");
    badgeLayoutReviewer.addComponent(barLayoutReviewer);
    badgeLayoutReviewer.setExpandRatio(barLayoutReviewer, 0.8f);

    starLayoutReviewer = new HorizontalLayout();
    starLayoutReviewer.setWidth("100%");
    starLayoutReviewer.setSpacing(false);
    starLayoutReviewer.setMargin(false);
    barLayoutReviewer.addComponent(starLayoutReviewer);

    starLayoutReviewer.addComponent(imageBadgeStar1Rev);

    starLayoutReviewer.addComponent(imageBadgeStar2Rev);

    starLayoutReviewer.addComponent(imageBadgeStar3Rev);

    starLayoutReviewer.addComponent(imageBadgeFlagRev);

    progressBarReviewer = new ProgressBar(0.0f);
    progressBarReviewer.setId("PB_REVIEWER");
    progressBarReviewer.setWidth("100%");
    progressBarReviewer.setHeight("100%");
    barLayoutReviewer.addComponent(progressBarReviewer);

    levelLayoutReviewer = new HorizontalLayout();
    levelLayoutReviewer.setWidth("100%");

    labelLevelNoviceRev = new Label("<div id= level><b>Novice</b></div>", ContentMode.HTML);
    levelLayoutReviewer.addComponent(labelLevelNoviceRev);

    labelLevelInterRev = new Label("<div id= level><b>Intermediate</b></div>", ContentMode.HTML);
    levelLayoutReviewer.addComponent(labelLevelInterRev);

    labelLevelAdvRev = new Label("<div id= level><b>Advanced</b></div>", ContentMode.HTML);
    levelLayoutReviewer.addComponent(labelLevelAdvRev);

    labelLevelExpRev = new Label("<div id= level><b>Expert</b></div>", ContentMode.HTML);
    ;
    levelLayoutReviewer.addComponent(labelLevelExpRev);

    barLayoutReviewer.addComponent(levelLayoutReviewer);

    tableTasksReviewer = new Table();
    popupViewTasksReviewer = new PopupView(null, tableTasksReviewer);
    barLayoutReviewer.addComponent(popupViewTasksReviewer);

    return badgeLayoutReviewer;

}

From source file:eu.fp7.eagle.portal.ui.dashboard.design.impl.BadgesDesignImpl.java

License:Apache License

/**
 * @return badgeLayoutNetworker/* w  w  w  .  ja v  a2 s  .  c o  m*/
 */
private HorizontalLayout buildBadgeLayoutNetworker() {

    badgeLayoutNetworker = new HorizontalLayout();
    badgeLayoutNetworker.setWidth("100%");
    badgeLayoutNetworker.setMargin(false);
    badgeLayoutNetworker.setSpacing(false);

    imageLayoutNetworker = new VerticalLayout();
    imageLayoutNetworker.setWidth("100%");
    imageLayoutNetworker.setMargin(false);
    imageLayoutNetworker.setSpacing(false);
    badgeLayoutNetworker.addComponent(imageLayoutNetworker);
    badgeLayoutNetworker.setExpandRatio(imageLayoutNetworker, 0.2f);

    labelBadgeNetworker = new Label("Networker");
    imageLayoutNetworker.addComponent(labelBadgeNetworker);

    imageBadgeNet.setId("NETWORKER");
    imageLayoutNetworker.addComponent(imageBadgeNet);

    tableAchNetworker = new Table();
    popupViewAchNetworker = new PopupView(null, tableAchNetworker);
    imageLayoutNetworker.addComponent(popupViewAchNetworker);

    barLayoutNetworker = new VerticalLayout();
    barLayoutNetworker.setId("BL_NETWORKER");
    barLayoutNetworker.setWidth("100%");
    badgeLayoutNetworker.addComponent(barLayoutNetworker);
    badgeLayoutNetworker.setExpandRatio(barLayoutNetworker, 0.8f);

    starLayoutNetworker = new HorizontalLayout();
    starLayoutNetworker.setWidth("100%");
    starLayoutNetworker.setSpacing(false);
    starLayoutNetworker.setMargin(false);
    barLayoutNetworker.addComponent(starLayoutNetworker);

    starLayoutNetworker.addComponent(imageBadgeStar1Net);

    starLayoutNetworker.addComponent(imageBadgeStar2Net);

    starLayoutNetworker.addComponent(imageBadgeStar3Net);

    starLayoutNetworker.addComponent(imageBadgeFlagNet);

    progressBarNetworker = new ProgressBar(0.0f);
    progressBarNetworker.setId("PB_NETWORKER");
    progressBarNetworker.setWidth("100%");
    progressBarNetworker.setHeight("100%");
    barLayoutNetworker.addComponent(progressBarNetworker);

    levelLayoutNetworker = new HorizontalLayout();
    levelLayoutNetworker.setWidth("100%");

    labelLevelNoviceNet = new Label("<div id= level><b>Novice</b></div>", ContentMode.HTML);
    levelLayoutNetworker.addComponent(labelLevelNoviceNet);

    labelLevelInterNet = new Label("<div id= level><b>Intermediate</b></div>", ContentMode.HTML);
    levelLayoutNetworker.addComponent(labelLevelInterNet);

    labelLevelAdvNet = new Label("<div id= level><b>Advanced</b></div>", ContentMode.HTML);
    levelLayoutNetworker.addComponent(labelLevelAdvNet);

    labelLevelExpNet = new Label("<div id= level><b>Expert</b></div>", ContentMode.HTML);
    ;
    levelLayoutNetworker.addComponent(labelLevelExpNet);

    barLayoutNetworker.addComponent(levelLayoutNetworker);

    tableTasksNetworker = new Table();
    popupViewTasksNetworker = new PopupView(null, tableTasksNetworker);
    barLayoutNetworker.addComponent(popupViewTasksNetworker);

    return badgeLayoutNetworker;

}