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:module.pandabox.presentation.PandaBox.java

License:Open Source License

Layout getPopupViewPreviews() {
    Layout grid = getPreviewLayout("Popup views");

    Label content = new Label("Simple popup content");
    content.setSizeUndefined();// w  w  w .j  a va2s  . c  om
    PopupView pv = new PopupView("Default popup", content);
    grid.addComponent(pv);

    return grid;
}

From source file:org.balisunrise.vaadin.components.header.Configuration.java

private void init() {
    setStyleName("b-configuration");
    popup = new PopupView(FontAwesome.COG.getHtml(), new VerticalLayout(new Label("Configuration")));

    setCompositionRoot(popup);//from   ww w.ja  v a  2 s .  c o m
}

From source file:org.escidoc.browser.ui.GroupRolesView.java

License:Open Source License

private VerticalLayout addRoleExcludeInformation() {
    VerticalLayout rlexclude = new VerticalLayout();
    final Label content = new Label("<ul><li>The following Roles have been excluded from this view: <br />"
            + ViewConstants.roleExcludeList.toString() + "</li></ul>", Label.CONTENT_RAW);
    content.setWidth("300px");

    final PopupView popup = new PopupView("?", content);
    popup.setHideOnMouseOut(true);/*  www.  ja  v  a  2 s .co m*/
    popup.addListener(new PopupVisibilityListener() {
        @Override
        public void popupVisibilityChange(PopupVisibilityEvent event) {
        }
    });

    popup.addStyleName("paddingright10");
    rlexclude.addComponent(popup);
    rlexclude.setComponentAlignment(popup, Alignment.MIDDLE_RIGHT);
    rlexclude.setMargin(true);
    return rlexclude;
}

From source file:org.escidoc.browser.ui.mainpage.HeaderContainer.java

License:Open Source License

private void createSearchForm() {
    final Form form = new Form();
    searchField.setImmediate(true);//from   w w w .  j  ava  2  s  .  c o  m
    form.getLayout().addComponent(searchField);
    form.addStyleName("paddingright10");
    hl.addComponent(form);
    hl.setComponentAlignment(form, Alignment.MIDDLE_RIGHT);

    final Button btnSearch = new Button("Go", this, "onClickSearch");

    // btnSearch.setClickShortcut(KeyCode.ENTER);
    btnSearch.addStyleName("primary");
    btnSearch.removeStyleName("v-button");

    btnSearch.addStyleName("paddingright10");
    hl.addComponent(btnSearch);
    hl.setComponentAlignment(btnSearch, Alignment.MIDDLE_RIGHT);

    // Create the content for the popup
    final Label content = new Label(
            "<ul><li>&raquo; The default search operator is AND</li><li>&raquo; To search for a phrase place the text in double quotes</li></ul>",
            Label.CONTENT_RAW);
    // The PopupView popup will be as large as needed by the content
    content.setWidth("300px");

    // Construct the PopupView with simple HTML text representing the
    // minimized view
    final PopupView popup = new PopupView("?", content);
    popup.setHideOnMouseOut(true);
    popup.addListener(this);

    popup.addStyleName("paddingright10");
    hl.addComponent(popup);
    hl.setComponentAlignment(popup, Alignment.MIDDLE_RIGHT);
}

From source file:org.escidoc.browser.ui.tools.BulkTasksView.java

License:Open Source License

private static PopupView createHelpView() {
    final Label popUpContent = new Label(ViewConstants.FILTER_EXAMPLE_TOOLTIP_TEXT, Label.CONTENT_XHTML);
    popUpContent.setWidth(400, UNITS_PIXELS);
    return new PopupView(ViewConstants.TIP, popUpContent);
}

From source file:org.generationcp.breeding.manager.crosses.NurseryTemplateMain.java

License:Open Source License

public void setTitleContent(String guideMessage) {
    titleLayout.removeAllComponents();/*from ww w.  j av  a 2 s . co m*/

    String title = "<h1>Crossing Manager:</h1> <h1>Nursery Template File</h1> <h2>" + VERSION + "</h2>";
    nurseryTemplateTitle = new Label();
    nurseryTemplateTitle.setStyleName("gcp-window-title");
    nurseryTemplateTitle.setContentMode(Label.CONTENT_XHTML);
    nurseryTemplateTitle.setValue(title);
    titleLayout.addComponent(nurseryTemplateTitle);

    Label descLbl = new Label(guideMessage);
    descLbl.setWidth("300px");

    PopupView popup = new PopupView("?", descLbl);
    popup.setStyleName("gcp-popup-view");
    titleLayout.addComponent(popup);

    titleLayout.setComponentAlignment(popup, Alignment.MIDDLE_LEFT);
}

From source file:org.ikasan.dashboard.ui.dashboard.panel.DashboardPanel.java

License:BSD License

@Subscribe
public void receiveAlertEvent(final AlertEvent event) {
    UI.getCurrent().access(new Runnable() {
        @Override//from ww w  .j  a  va 2  s.  com
        public void run() {
            VaadinSession.getCurrent().getLockInstance().lock();
            try {
                Item item = container.addItemAt(0, event.getAlert() + this);

                Property<String> alertProperty = item.getItemProperty("Alert");

                alertProperty.setValue(event.getAlert());

                final Property<String> moduleProperty = item.getItemProperty("Module");

                moduleProperty.setValue(event.getModule());

                TextArea notesField = new TextArea("Notes");
                notesField.setWidth("500px");
                notesField.setRequired(false);
                notesField.setHeight("150px");
                notesField.setImmediate(true);
                notesField.setStyleName("coursedetailtext");
                // popup notes view
                final PopupView notesPopupView = new PopupView("Details", notesField);
                notesPopupView.setCaption("Details");
                notesPopupView.setHideOnMouseOut(false);
                notesPopupView.setData(event.getAlert() + this);

                final Property<PopupView> detailsProperty = item.getItemProperty("Details");

                detailsProperty.setValue(notesPopupView);

                System.out.println("container = " + container);
                System.out.println("Item = " + item);
            } finally {
                VaadinSession.getCurrent().getLockInstance().unlock();
            }

            //               UI.getCurrent().push();   
        }
    });
}

From source file:org.lunifera.christmastree.control.DesktopControlComponent.java

License:Creative Commons License

protected AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);/*  w  w w  . ja  v a2 s .  c  o m*/
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");

    // top-level component properties
    setWidth("100.0%");
    setHeight("100.0%");

    // title area
    ThemeResource resource = new ThemeResource("images/Title.png");
    Image title = new Image(" ", resource);
    title.setHeight("108px");
    title.setWidth("827px");
    mainLayout.addComponent(title, "top:22.0px;left:120.0px");

    VerticalLayout vl = new VerticalLayout();
    vl.setHeight("500px");
    vl.setWidth("400px");
    vl.setSpacing(true);
    mainLayout.addComponent(vl, "top:140.0px;left:100.0px;");

    contentLayout = buildContent();
    vl.addComponent(contentLayout);
    vl.setExpandRatio(contentLayout, 1.0f);

    // licenses
    PopupView licenseLink = new PopupView("Attributions",
            new Label("<div><i>Monitor/tablet/smartphone</i> and <i>tree</i> icons </br> made by "
                    + "<a href=\"http://www.freepik.com\" title=\"Freepik\">Freepik</a> "
                    + "from <a href=\"http://www.flaticon.com\" title=\"Flaticon\">www.flaticon.com</a> </br>"
                    + "is licensed under <a href=\"http://creativecommons.org/licenses/by/3.0/\" "
                    + "title=\"Creative Commons BY 3.0\">CC BY 3.0</a></div>", ContentMode.HTML));
    licenseLink.setPrimaryStyleName("attributions");
    vl.addComponent(licenseLink);

    Label image = new Label();
    image.setHeight("400px");
    image.setWidth("100%");
    // image.setValue("<div style=\"overflow:hidden; width: 400px;
    // margin-left: -60px;\">"
    // + "<img src=\"http://77.119.240.22:8081\"/>" + "</div>");
    image.setValue("<div style=\"overflow:hidden; width: 370px; margin-left: -60px;\">"
            + "<img src=\"http://192.168.0.108:8081\"/>" + "</div>");
    image.setContentMode(ContentMode.HTML);
    mainLayout.addComponent(image, "top:140.0px;left:600.0px;");

    return mainLayout;
}

From source file:org.lunifera.christmastree.control.MobileControlComponent.java

License:Creative Commons License

protected AbsoluteLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new AbsoluteLayout();
    mainLayout.setImmediate(false);//from  w w w  . j  a  v  a 2 s . co m
    mainLayout.setWidth("1280px");
    mainLayout.setHeight("720px");

    // top-level component properties
    setWidth("100.0%");
    setHeight("100.0%");

    // title area
    ThemeResource resource = new ThemeResource("images/Title.png");
    Image title = new Image(" ", resource);
    title.setHeight("54px");
    title.setWidth("413px");
    mainLayout.addComponent(title, "top:11.0px;left:60.0px");

    Label image = new Label();
    image.setHeight("340px");
    image.setWidth("600px");
    image.setValue("<div style=\"overflow:hidden; width: 320px; height: 600px; margin-left: -60px;\">"
            + "<img src=\"http://192.168.0.108:8081\"/>" + "</div>");
    image.setContentMode(ContentMode.HTML);
    mainLayout.addComponent(image, "top:70.0px;left:125px;");

    // Image image = new Image();
    // image.setHeight("240px");
    // image.setWidth("320px");
    // image.setSource(new
    // ExternalResource("http://192.168.0.108:8081/stream",
    // "video/x-motion-jpeg"));
    // mainLayout.addComponent(image, "top:70.0px;left:50.0px;");

    VerticalLayout vl = new VerticalLayout();
    //      vl.setHeight("250px");
    vl.setWidth("200px");
    vl.setSpacing(true);

    mainLayout.addComponent(vl, "top:180.0px;left:535.0px;");
    contentLayout = buildContent();
    vl.addComponent(contentLayout);
    vl.setExpandRatio(contentLayout, 1.0f);

    // licenses
    PopupView licenseLink = new PopupView("Attributions",
            new Label("<div><i>Monitor/tablet/smartphone</i> and <i>tree</i> icons </br> made by "
                    + "<a href=\"http://www.freepik.com\" title=\"Freepik\">Freepik</a> "
                    + "from <a href=\"http://www.flaticon.com\" title=\"Flaticon\">www.flaticon.com</a> </br>"
                    + "is licensed under <a href=\"http://creativecommons.org/licenses/by/3.0/\" "
                    + "title=\"Creative Commons BY 3.0\">CC BY 3.0</a></div>", ContentMode.HTML));
    licenseLink.setPrimaryStyleName("attributions");
    vl.addComponent(licenseLink);

    return mainLayout;
}

From source file:org.opencms.ui.components.CmsToolBar.java

License:Open Source License

/**
 * Constructor.<p>//w  ww.  j  a  v  a2  s  .co m
 */
public CmsToolBar() {
    m_quickLaunchDropDown = createQuickLaunchDropDown();
    m_userDropDown = createUserInfoDropDown();
    m_leftButtons = new VerticalLayout();
    m_rightButtons = new VerticalLayout();
    VerticalLayout layout = new VerticalLayout();
    layout.addComponent(m_leftButtons);
    layout.addComponent(m_rightButtons);
    m_foldedButtonsMenu = new PopupView(getDropDownButtonHtml(FontOpenCms.CONTEXT_MENU_DOTS), layout);
    m_foldedButtonsMenu.addStyleName(OpenCmsTheme.NAVIGATOR_DROPDOWN);
    m_foldedButtonsMenu.setHideOnMouseOut(false);
    Design.read("CmsToolBar.html", this);
}