List of usage examples for com.vaadin.ui BrowserFrame BrowserFrame
public BrowserFrame(String caption, Resource source)
From source file:org.geant.sat.ui.MainView.java
License:BSD License
/** {@inheritDocs}. */ @SuppressWarnings("rawtypes") @Override/*from w w w . ja v a2s. c o m*/ public void enter(ViewChangeEvent event) { if (MENU_ENTITIES.equals(event.getParameters())) { workPanel.setContent(new EntityListViewer((MainUI) getUI())); return; } if (MENU_SURVEYS.equals(event.getParameters())) { workPanel.setContent(new SurveyViewer((MainUI) getUI())); return; } if (MENU_USERS.equals(event.getParameters())) { workPanel.setContent(new UserListViewer((MainUI) getUI())); return; } if (MENU_PROFILE.equals(event.getParameters())) { workPanel.setContent(new ProfileViewer((MainUI) getUI(), ((MainUI) getUI()).getUser().getDetails())); return; } if (MENU_ABOUT.equals(event.getParameters())) { workPanel.setContent(new AboutViewer()); return; } if (MENU_LIMESURVEY.equals(event.getParameters())) { final String hostUrl = getBaseUrl(((MainUI) getUI()).getPage().getLocation()); log.debug("Using the following baseUrl: {}", hostUrl); final String limesurveyPath = ((MainUI) getUI()).getLimesurveyPath(); log.debug("The limesurvey path is {}", limesurveyPath); final BrowserFrame browserFrame = new BrowserFrame("Browser", new ExternalResource(hostUrl + limesurveyPath + "admin/")); browserFrame.setHeight("100%"); browserFrame.setWidth("100%"); workPanel.setContent(browserFrame); return; } workPanel.setContent(new AboutViewer()); return; }
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 a 2 s . co m 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();/*w w w. j a v a2s . 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.opencms.ui.dialogs.permissions.CmsPrincipalSelect.java
License:Open Source License
/** * Opens the principal select dialog window.<p> *///from ww w. j av a 2 s. c om void openPrincipalSelect() { String parameters = "?type=" + m_widgetType.name() + "&realonly=" + m_realOnly + "&flags=null&action=listindependentaction&useparent=true&listaction="; if ((m_widgetType.equals(WidgetType.principalwidget) && I_CmsPrincipal.PRINCIPAL_GROUP.equals(m_principalTypeSelect.getValue())) || m_widgetType.equals(WidgetType.groupwidget)) { parameters += "iag"; } else { parameters += "iau"; } BrowserFrame selectFrame = new BrowserFrame("Select principal", new ExternalResource(OpenCms.getLinkManager().substituteLinkForUnknownTarget(A_CmsUI.getCmsObject(), "/system/workplace/commons/principal_selection.jsp") + parameters)); selectFrame.setWidth("100%"); selectFrame.setHeight("500px"); CmsBasicDialog dialog = new CmsBasicDialog(); dialog.setContent(selectFrame); m_window = CmsBasicDialog.prepareWindow(); m_window.setCaption(CmsVaadinUtils.getMessageText( org.opencms.workplace.commons.Messages.GUI_PRINCIPALSELECTION_LIST_ACTION_SELECT_NAME_0)); m_window.setContent(dialog); A_CmsUI.get().addWindow(m_window); CmsPrincipalSelectExtension.getInstance().setCurrentSelect(this); }
From source file:org.opennms.features.pluginmgr.vaadin.config.karaf.SimpleIframeApplication.java
License:Apache License
@Override public void init(VaadinRequest request) { if (iframePageUrl == null) throw new RuntimeException("iframePageUrl must not be null"); m_request = request;//www.j a v a2s . c o m m_rootLayout = new VerticalLayout(); m_rootLayout = new VerticalLayout(); m_rootLayout.setSizeFull(); m_rootLayout.addStyleName("root-layout"); setContent(m_rootLayout); // add header if provided if (headerComponent != null) m_rootLayout.addComponent(headerComponent); //add additional header page links if provided if (headerLinks != null) { // defining 2 horizontal layouts to force links to stay together HorizontalLayout horizontalLayout1 = new HorizontalLayout(); horizontalLayout1.setWidth("100%"); horizontalLayout1.setDefaultComponentAlignment(Alignment.TOP_RIGHT); HorizontalLayout horizontalLayout2 = new HorizontalLayout(); horizontalLayout1.addComponent(horizontalLayout2); for (String name : headerLinks.keySet()) { String urlStr = headerLinks.get(name); ExternalResource urlResource = new ExternalResource(urlStr); Link link = new Link(name, urlResource); Label label = new Label(" ", ContentMode.HTML); // adds space between links horizontalLayout2.addComponent(link); horizontalLayout2.addComponent(label); } m_rootLayout.addComponent(horizontalLayout1); } ExternalResource iframPageResource = new ExternalResource(iframePageUrl); BrowserFrame browser = new BrowserFrame("", iframPageResource); browser.setWidth("100%"); browser.setHeight("100%"); m_rootLayout.addComponent(browser); // this forces the UI panel to use up all the available space below the header m_rootLayout.setExpandRatio(browser, 1.0f); }
From source file:org.opennms.features.pluginmgr.vaadin.config.opennms.SimpleIframeInVaadinApplication.java
License:Open Source License
@Override public void init(VaadinRequest request) { if (iframePageUrl == null) throw new RuntimeException("iframePageUrl must not be null"); m_rootLayout = new VerticalLayout(); m_rootLayout.setSizeFull();//w ww. ja va 2 s.c om m_rootLayout.addStyleName("root-layout"); setContent(m_rootLayout); addHeader(request); //add diagnostic page links if (headerLinks != null) { // defining 2 horizontal layouts to force links to stay together HorizontalLayout horizontalLayout1 = new HorizontalLayout(); horizontalLayout1.setWidth("100%"); horizontalLayout1.setDefaultComponentAlignment(Alignment.TOP_RIGHT); HorizontalLayout horizontalLayout2 = new HorizontalLayout(); horizontalLayout1.addComponent(horizontalLayout2); for (String name : headerLinks.keySet()) { String urlStr = headerLinks.get(name); ExternalResource urlResource = new ExternalResource(urlStr); Link link = new Link(name, urlResource); Label label = new Label(" ", ContentMode.HTML); // adds space between links horizontalLayout2.addComponent(link); horizontalLayout2.addComponent(label); } m_rootLayout.addComponent(horizontalLayout1); } ExternalResource iframPageResource = new ExternalResource(iframePageUrl); BrowserFrame browser = new BrowserFrame("", iframPageResource); browser.setWidth("100%"); browser.setHeight("100%"); m_rootLayout.addComponent(browser); // this forces the UI panel to use up all the available space below the header m_rootLayout.setExpandRatio(browser, 1.0f); }
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(); {//from w w w .j av a2 s.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.RtcDashlet.java
License:Open Source License
@Override public DashletComponent getWallboardComponent() { if (m_dashletComponent == null) { m_dashletComponent = new AbstractDashletComponent() { private VerticalLayout m_verticalLayout = new VerticalLayout(); {/*from w w w . j a va 2 s. c o m*/ m_verticalLayout.setCaption(getName()); m_verticalLayout.setSizeFull(); } @Override public void refresh() { m_verticalLayout.removeAllComponents(); m_browserFrame = new BrowserFrame(null, new ExternalResource("/opennms/rtc/fullscreen-categories-box.jsp")); m_browserFrame.setSizeFull(); m_verticalLayout.addComponent(m_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 w w w. j a v a 2s . c om 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 w w w .ja va 2 s. co 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; }