Example usage for com.vaadin.ui BrowserFrame setSizeFull

List of usage examples for com.vaadin.ui BrowserFrame setSizeFull

Introduction

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

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

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

public static Window get(Path pdfFile) {
    Window window = new Window();
    window.setModal(true);/*from w w  w  .  j  ava 2 s  .  com*/
    window.setResizable(false);
    window.setWidth("90%");
    window.setHeight("90%");
    window.addCloseShortcut(ShortcutAction.KeyCode.ENTER, null);
    BrowserFrame e = new BrowserFrame(pdfFile.getFileName().toString(), new FileResource(pdfFile.toFile()));
    e.setSizeFull();
    window.setContent(e);
    return window;
}

From source file:info.magnolia.ui.framework.app.embedded.EmbeddedPageViewImpl.java

License:Open Source License

@Override
public void setUrl(String url) {
    final BrowserFrame page = new BrowserFrame(null, new ExternalResource(url));
    page.setSizeFull();
    layout.removeAllComponents();/*w  ww .ja va  2 s.  c om*/
    layout.addComponent(page);
}

From source file:org.generationcp.breeding.manager.listimport.EmbeddedGermplasmListDetailComponent.java

License:Open Source License

@Override
public void afterPropertiesSet() throws Exception {
    setMargin(false);/*from  w  w  w .  j  av  a2  s .c om*/
    setSpacing(true);
    setWidth("800px");

    Tool tool = null;
    try {
        tool = workbenchDataManager.getToolWithName(ToolName.germplasm_list_browser.toString());
    } catch (MiddlewareQueryException qe) {
        LOG.error("QueryException", qe);
    }

    ExternalResource listBrowserLink = null;
    if (tool == null) {
        listBrowserLink = new ExternalResource(
                "http://localhost:18080/GermplasmStudyBrowser/main/germplasmlist-" + listId);
    } else {
        listBrowserLink = new ExternalResource(
                tool.getPath().replace("germplasmlist/", "germplasmlist-") + listId);
    }

    VerticalLayout layoutForList = new VerticalLayout();
    layoutForList.setMargin(false);
    layoutForList.setSpacing(false);

    BrowserFrame listInfoPage = new BrowserFrame("", listBrowserLink);
    listInfoPage.setSizeFull();
    layoutForList.setHeight("550px");
    layoutForList.addComponent(listInfoPage);

    GermplasmImportButtonClickListener listener = new GermplasmImportButtonClickListener(this);
    /*
    exportButton = new Button();
    exportButton.setData(EXPORT_BUTTON_ID);
    exportButton.addListener(listener);
    */
    makeImportButton = new Button();
    makeImportButton.setData(NEW_IMPORT_BUTTON_ID);
    makeImportButton.addListener(listener);

    HorizontalLayout buttonArea = new HorizontalLayout();
    buttonArea.setMargin(true);
    buttonArea.setSpacing(true);
    buttonArea.addComponent(makeImportButton);

    addComponent(layoutForList);
    addComponent(buttonArea);
    setComponentAlignment(buttonArea, Alignment.BOTTOM_RIGHT);
}

From source file:org.jumpmind.metl.ui.views.admin.ApiPanel.java

License:Open Source License

public ApiPanel(ApplicationContext context, TabbedPanel tabbedPanel) {
    setSizeFull();//from www. java  2  s.  c  o m
    String url = Page.getCurrent().getLocation().getPath();
    BrowserFrame e = new BrowserFrame(null,
            new ExternalResource(url.substring(0, url.lastIndexOf("/")) + "/api.html"));
    e.setSizeFull();
    addComponent(e);
}

From source file:org.opennms.features.vaadin.dashboard.dashlets.MapDashlet.java

License:Open Source License

@Override
public DashletComponent getWallboardComponent() {
    if (m_dashletComponent == null) {
        m_dashletComponent = new AbstractDashletComponent() {
            private VerticalLayout m_verticalLayout = new VerticalLayout();

            {//w ww .  j  av  a  2s  .c  o m
                m_verticalLayout.setCaption(getName());
                m_verticalLayout.setSizeFull();
            }

            @Override
            public void refresh() {
                m_verticalLayout.removeAllComponents();
                String searchString = "";

                if (getDashletSpec().getParameters().containsKey("search")) {
                    searchString = getDashletSpec().getParameters().get("search");
                }

                BrowserFrame browserFrame = new BrowserFrame(null,
                        new ExternalResource("/opennms/node-maps#search/" + searchString));
                browserFrame.setSizeFull();
                m_verticalLayout.addComponent(browserFrame);
            }

            @Override
            public Component getComponent() {
                return m_verticalLayout;
            }
        };
    }

    return m_dashletComponent;
}

From source file:org.opennms.features.vaadin.dashboard.dashlets.SurveillanceDashlet.java

License:Open Source License

@Override
public DashletComponent getWallboardComponent() {
    if (m_dashletComponent == null) {
        m_dashletComponent = new AbstractDashletComponent() {
            private VerticalLayout m_verticalLayout = new VerticalLayout();

            {//from   ww  w.  java2s .  co m
                m_verticalLayout.setCaption(getName());
                m_verticalLayout.setSizeFull();
            }

            @Override
            public void refresh() {
                m_verticalLayout.removeAllComponents();

                String viewName = "default";

                if (getDashletSpec().getParameters().containsKey("viewName")) {
                    viewName = getDashletSpec().getParameters().get("viewName");
                }

                /**
                 * creating browser frame to display node-maps
                 */
                BrowserFrame browserFrame = new BrowserFrame(null, new ExternalResource(
                        "/opennms/osgi/vaadin-surveillance-views?dashboard=false&viewName=" + viewName));
                browserFrame.setSizeFull();

                m_verticalLayout.addComponent(browserFrame);
            }

            @Override
            public Component getComponent() {
                return m_verticalLayout;
            }
        };
    }

    return m_dashletComponent;
}

From source file:org.opennms.features.vaadin.dashboard.dashlets.TopologyDashlet.java

License:Open Source License

@Override
public DashletComponent getWallboardComponent() {
    if (m_dashletComponent == null) {
        m_dashletComponent = new AbstractDashletComponent() {
            private VerticalLayout m_verticalLayout = new VerticalLayout();

            {//from   ww w .j  a  va  2 s .  c o  m
                m_verticalLayout.setCaption(getName());
                m_verticalLayout.setSizeFull();
            }

            @Override
            public void refresh() {
                m_verticalLayout.removeAllComponents();

                String focusNodes = "";
                String szl = "";
                String provider = "";

                if (getDashletSpec().getParameters().containsKey("focusNodes")) {
                    focusNodes = getDashletSpec().getParameters().get("focusNodes");
                }

                if (getDashletSpec().getParameters().containsKey("szl")) {
                    szl = getDashletSpec().getParameters().get("szl");
                }

                if (getDashletSpec().getParameters().containsKey("provider")) {
                    provider = getDashletSpec().getParameters().get("provider");
                }

                String query = "";

                if (!"".equals(focusNodes)) {
                    query += "focusNodes=" + focusNodes + "&";
                }

                if (!"".equals(szl)) {
                    query += "szl=" + szl + "&";
                }

                if (!"".equals(provider)) {
                    query += "provider=" + provider + "&";
                }
                /**
                 * creating browser frame to display the topology
                 */
                BrowserFrame browserFrame = new BrowserFrame(null,
                        new ExternalResource("/opennms/topology?" + query));
                browserFrame.setSizeFull();
                m_verticalLayout.addComponent(browserFrame);
            }

            @Override
            public Component getComponent() {
                return m_verticalLayout;
            }
        };
    }

    return m_dashletComponent;
}

From source file:org.opennms.features.vaadin.dashboard.dashlets.UrlDashlet.java

License:Open Source License

@Override
public DashletComponent getWallboardComponent() {
    if (m_dashletComponent == null) {
        m_dashletComponent = new AbstractDashletComponent() {
            private VerticalLayout m_verticalLayout = new VerticalLayout();

            {/* ww w. ja va 2  s. c  om*/
                m_verticalLayout.setCaption(getName());
                m_verticalLayout.setSizeFull();
            }

            @Override
            public void refresh() {
                m_verticalLayout.removeAllComponents();

                String url = "";
                String username = "";
                String password = "";

                if (getDashletSpec().getParameters().containsKey("url")) {
                    url = getDashletSpec().getParameters().get("url");
                }

                if (getDashletSpec().getParameters().containsKey("username")) {
                    username = getDashletSpec().getParameters().get("username");
                }

                if (getDashletSpec().getParameters().containsKey("password")) {
                    password = getDashletSpec().getParameters().get("password");
                }

                String usernamePassword = "";

                if (!"".equals(username) && !"".equals(password)) {
                    usernamePassword = username + ":" + password;

                }

                if (!"".equals(url)) {
                    /**
                     * Try to parse the given URL...
                     */
                    URL parsedUrl = null;

                    try {
                        parsedUrl = new URL(url);
                    } catch (MalformedURLException e) {
                        m_verticalLayout.addComponent(new Label("MalformedURLException: " + e.getMessage()));
                        return;
                    }

                    /**
                     * If successful, construct a wellformed URL including the basic auth credentials
                     */
                    URL urlWithAuth = null;

                    try {
                        urlWithAuth = new URI(parsedUrl.getProtocol(), usernamePassword, parsedUrl.getHost(),
                                parsedUrl.getPort() == -1 ? parsedUrl.getDefaultPort() : parsedUrl.getPort(),
                                parsedUrl.getPath(), parsedUrl.getQuery(), parsedUrl.getRef()).toURL();
                    } catch (MalformedURLException e) {
                        m_verticalLayout.addComponent(new Label("MalformedURLException: " + e.getMessage()));
                        return;
                    } catch (URISyntaxException e) {
                        m_verticalLayout.addComponent(new Label("URISyntaxException: " + e.getMessage()));
                        return;
                    }

                    /**
                     * creating browser frame to display the URL
                     */
                    BrowserFrame browserFrame = new BrowserFrame(null, new ExternalResource(urlWithAuth));
                    browserFrame.setSizeFull();
                    m_verticalLayout.addComponent(browserFrame);
                } else {
                    m_verticalLayout.addComponent(new Label("No URL specified!"));
                }
            }

            @Override
            public Component getComponent() {
                return m_verticalLayout;
            }
        };
    }

    return m_dashletComponent;
}

From source file:org.opennms.features.vaadin.pmatrix.dashlet.PmatrixDashlet.java

License:Open Source License

@Override
public DashletComponent getWallboardComponent() {
    if (m_dashletComponent == null) {
        m_dashletComponent = new AbstractDashletComponent() {
            private VerticalLayout m_verticalLayout = new VerticalLayout();

            {//from   ww  w  .ja  v a  2 s . c  om
                m_verticalLayout.setCaption(getName());
                m_verticalLayout.setSizeFull();
            }

            @Override
            public void refresh() {
                m_verticalLayout.removeAllComponents();
                String searchString = "";

                if (getDashletSpec().getParameters().containsKey("uiComponent")) {
                    searchString = getDashletSpec().getParameters().get("uiComponent");
                }

                BrowserFrame browserFrame = new BrowserFrame(null,
                        new ExternalResource("/opennms/vaadin-pmatrix/?uiComponent=" + searchString));
                browserFrame.setSizeFull();
                m_verticalLayout.addComponent(browserFrame);
            }

            @Override
            public Component getComponent() {
                return m_verticalLayout;
            }
        };
    }

    return m_dashletComponent;
}

From source file:ui.tabsheet.DocumentsTabSheet.java

License:Apache License

private Component getView(final Certificate c) {
    BrowserFrame pdf = new BrowserFrame("", new StreamResource(new StreamResource.StreamSource() {

        @Override/*from   w  w  w .j a v  a2 s. c  om*/
        public InputStream getStream() {
            return new ByteArrayInputStream(c.getImage());
        }
    }, "cert" + "_" + c.getAchievementId() + ".pdf"));

    pdf.setSizeFull();

    VerticalLayout layout = new VerticalLayout(pdf);
    layout.setSizeFull();

    Panel p = new Panel(layout);
    return pdf;
}