List of usage examples for com.vaadin.ui Embedded Embedded
public Embedded()
From source file:eu.lod2.VirtuosoISPARQL.java
License:Apache License
public VirtuosoISPARQL(LOD2DemoState st) { // The internal state and state = st;/* w ww. ja va 2s .c om*/ Embedded browser = new Embedded(); try { URL url; if (state.getHostName().equals("http://localhost:8080")) { url = new URL("http://localhost:8890/isparql"); } else { url = new URL(state.getHostName() + "/virtuoso/isparql"); } ; browser = new Embedded("", new ExternalResource(url)); browser.setType(Embedded.TYPE_BROWSER); browser.setSizeFull(); } catch (MalformedURLException e) { e.printStackTrace(); } ; // The composition root MUST be set setCompositionRoot(browser); }
From source file:eu.lod2.VirtuosoSPARQL.java
License:Apache License
public VirtuosoSPARQL(LOD2DemoState st) { // The internal state and state = st;/*from w w w . ja va2 s . co m*/ final String query = "SELECT * where {?s ?p ?o.} LIMIT 20"; String encodedQuery = ""; String encodedGraphName = ""; try { encodedQuery = URLEncoder.encode(query, "UTF-8"); encodedGraphName = URLEncoder.encode(state.getCurrentGraph(), "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } ; Embedded browser = new Embedded(); try { URL url; if (state.getHostName().equals("http://localhost:8080")) { url = new URL("http://localhost:8890/sparql"); } else { url = new URL(state.getHostName() + "/virtuoso/sparql"); } ; browser = new Embedded("", new ExternalResource(url)); browser.setType(Embedded.TYPE_BROWSER); browser.setSizeFull(); } catch (MalformedURLException e) { e.printStackTrace(); } ; // The composition root MUST be set setCompositionRoot(browser); }
From source file:fi.hip.sicx.vaadin.GUIComponent.java
License:Open Source License
@AutoGenerated private HorizontalLayout buildButtonsonlyL() { // common part: create layout buttonsonlyL = new HorizontalLayout(); buttonsonlyL.setImmediate(false);/*from www . jav a2s . c o m*/ buttonsonlyL.setWidth("-1px"); buttonsonlyL.setHeight("-1px"); buttonsonlyL.setMargin(false); // reloadL reloadL = new Embedded(); reloadL.setImmediate(false); reloadL.setWidth("-1px"); reloadL.setHeight("-1px"); reloadL.setSource( new ExternalResource("http://demo.vaadin.com/sampler/VAADIN/themes/runo/icons/32/reload.png")); reloadL.setType(1); reloadL.setMimeType("image/png"); buttonsonlyL.addComponent(reloadL); // newfolderL newfolderL = new Embedded(); newfolderL.setImmediate(false); newfolderL.setWidth("-1px"); newfolderL.setHeight("-1px"); newfolderL.setSource( new ExternalResource("http://demo.vaadin.com/sampler/VAADIN/themes/runo/icons/32/folder-add.png")); newfolderL.setType(1); newfolderL.setMimeType("image/png"); buttonsonlyL.addComponent(newfolderL); // deleteL deleteL = new Embedded(); deleteL.setImmediate(false); deleteL.setWidth("-1px"); deleteL.setHeight("-1px"); deleteL.setSource( new ExternalResource("http://demo.vaadin.com/sampler/VAADIN/themes/runo/icons/32/trash.png")); deleteL.setType(1); deleteL.setMimeType("image/png"); buttonsonlyL.addComponent(deleteL); // helpL helpL = new Embedded(); helpL.setImmediate(false); helpL.setWidth("-1px"); helpL.setHeight("-1px"); helpL.setSource( new ExternalResource("http://demo.vaadin.com/sampler/VAADIN/themes/runo/icons/32/help.png")); helpL.setType(1); helpL.setMimeType("image/png"); buttonsonlyL.addComponent(helpL); return buttonsonlyL; }
From source file:fi.hip.sicx.vaadin.GUIComponent.java
License:Open Source License
@AutoGenerated private HorizontalLayout buildHorizontalLayout_1() { // common part: create layout horizontalLayout_1 = new HorizontalLayout(); horizontalLayout_1.setImmediate(false); horizontalLayout_1.setWidth("-1px"); horizontalLayout_1.setHeight("-1px"); horizontalLayout_1.setMargin(false); // reloadR//from ww w . j av a 2 s . co m reloadR = new Embedded(); reloadR.setImmediate(false); reloadR.setWidth("-1px"); reloadR.setHeight("-1px"); reloadR.setSource( new ExternalResource("http://demo.vaadin.com/sampler/VAADIN/themes/runo/icons/32/reload.png")); reloadR.setType(1); reloadR.setMimeType("image/png"); horizontalLayout_1.addComponent(reloadR); // newfolderU newfolderU = new Embedded(); newfolderU.setImmediate(false); newfolderU.setWidth("-1px"); newfolderU.setHeight("-1px"); newfolderU.setSource( new ExternalResource("http://demo.vaadin.com/sampler/VAADIN/themes/runo/icons/32/folder-add.png")); newfolderU.setType(1); newfolderU.setMimeType("image/png"); horizontalLayout_1.addComponent(newfolderU); // deleteU deleteU = new Embedded(); deleteU.setImmediate(false); deleteU.setWidth("-1px"); deleteU.setHeight("-1px"); deleteU.setSource( new ExternalResource("http://demo.vaadin.com/sampler/VAADIN/themes/runo/icons/32/trash.png")); deleteU.setType(1); deleteU.setMimeType("image/png"); horizontalLayout_1.addComponent(deleteU); // helpU helpU = new Embedded(); helpU.setImmediate(false); helpU.setWidth("-1px"); helpU.setHeight("-1px"); helpU.setSource( new ExternalResource("http://demo.vaadin.com/sampler/VAADIN/themes/runo/icons/32/help.png")); helpU.setType(1); helpU.setMimeType("image/png"); horizontalLayout_1.addComponent(helpU); // SLAselector SLAselector = new ComboBox(); SLAselector.setImmediate(false); SLAselector.setWidth("100px"); SLAselector.setHeight("-1px"); horizontalLayout_1.addComponent(SLAselector); return horizontalLayout_1; }
From source file:gov.va.ds4p.ds4pmobileportal.ui.eHealthExchange.java
License:Open Source License
private Popover getPopoverPDF(String val, String title) { Popover popover = new Popover(); popover.setModal(true);/* w ww . j a v a2 s . co m*/ popover.setClosable(true); popover.setWidth("700px"); popover.setHeight("100%"); CssLayout popLayout = new CssLayout(); popLayout.setSizeFull(); popLayout.setMargin(true); NavigationView navView = new NavigationView(popLayout); navView.setCaption(title); CssLayout layout2 = new CssLayout(); Embedded pdf = new Embedded(); pdf.setType(Embedded.TYPE_BROWSER); pdf.setMimeType("application/pdf"); pdf.setSizeFull(); pdf.setWidth("100%"); pdf.setHeight("700px"); pdf.setSource(createPdf(val)); layout2.addComponent(pdf); popLayout.addComponent(layout2); Button close = new Button(null, new ClickListener() { public void buttonClick(ClickEvent event) { event.getButton().getWindow().getParent().removeWindow(event.getButton().getWindow()); } }); close.setIcon(new ThemeResource("../runo/icons/64/cancel.png")); navView.setRightComponent(close); popover.setContent(navView); return popover; }
From source file:net.gvcc.jgoffice.components.CommandBar.java
License:Open Source License
private HorizontalLayout buildHorizontalLayout_2() { // common part: create layout horizontalLayout_2 = new HorizontalLayout(); horizontalLayout_2.setImmediate(false); horizontalLayout_2.setWidth("100.0%"); horizontalLayout_2.setHeight("-1px"); horizontalLayout_2.setMargin(false); horizontalLayout_2.setSpacing(true); // logoPicture logoPicture = new Embedded(); logoPicture.setImmediate(false);//from w w w.j a va2s . com logoPicture.setWidth("-1px"); logoPicture.setHeight("-1px"); logoPicture.setSource(new ThemeResource("img/LogoSgvV1.png")); logoPicture.setType(1); logoPicture.setMimeType("image/png"); horizontalLayout_2.addComponent(logoPicture); // lblApplicationTitle lblApplicationTitle = new Label(); lblApplicationTitle.setStyleName("g-applicationtitle"); lblApplicationTitle.setImmediate(false); lblApplicationTitle.setWidth("-1px"); lblApplicationTitle.setHeight("-1px"); lblApplicationTitle.setValue("Label"); horizontalLayout_2.addComponent(lblApplicationTitle); horizontalLayout_2.setComponentAlignment(lblApplicationTitle, new Alignment(33)); // programList programList = new HorizontalLayout(); programList.setImmediate(false); programList.setWidth("-1px"); programList.setHeight("-1px"); programList.setMargin(false); programList.setSpacing(true); horizontalLayout_2.addComponent(programList); horizontalLayout_2.setExpandRatio(programList, 1.0f); horizontalLayout_2.setComponentAlignment(programList, new Alignment(34)); // btnLogout btnLogout = new Button(); btnLogout.setCaption("Logout"); btnLogout.setImmediate(true); btnLogout.setWidth("-1px"); btnLogout.setHeight("-1px"); horizontalLayout_2.addComponent(btnLogout); horizontalLayout_2.setComponentAlignment(btnLogout, new Alignment(34)); return horizontalLayout_2; }
From source file:nl.amc.biolab.nsg.display.component.ProcessingStatusForm.java
License:Open Source License
private void showHTML(final String htmlContent, final Application app) throws IllegalArgumentException, NullPointerException { app.getMainWindow().addWindow(new Window() { private static final long serialVersionUID = -2307854110750435145L; {//w w w . j av a2 s. c o m center(); setWidth("75%"); setHeight("600px"); StreamResource.StreamSource source = new StreamResource.StreamSource() { private static final long serialVersionUID = -3745013501121916404L; public InputStream getStream() { return new ByteArrayInputStream(htmlContent.getBytes()); } }; StreamResource resource = new StreamResource(source, "TestReport.html", app); Embedded e = new Embedded(); e.setMimeType("text/html"); e.setType(Embedded.TYPE_BROWSER); e.setWidth("100%"); e.setHeight("590px"); e.setSource(resource); addComponent(e); } }); }
From source file:org.apache.openaz.xacml.admin.XacmlAdminConsole.java
License:Apache License
@AutoGenerated private HorizontalLayout buildHorizontalLayout_1() { // common part: create layout horizontalLayout_1 = new HorizontalLayout(); horizontalLayout_1.setImmediate(false); horizontalLayout_1.setWidth("100.0%"); horizontalLayout_1.setHeight("40px"); horizontalLayout_1.setMargin(false); // embedded_1 embedded_1 = new Embedded(); embedded_1.setImmediate(false);//from w w w. j ava 2 s .com embedded_1.setWidth("30px"); embedded_1.setHeight("30px"); embedded_1.setSource(new ThemeResource("img/att.png")); embedded_1.setType(1); embedded_1.setMimeType("image/png"); horizontalLayout_1.addComponent(embedded_1); horizontalLayout_1.setComponentAlignment(embedded_1, new Alignment(33)); // caption caption = new Label(); caption.setImmediate(false); caption.setWidth("-1px"); caption.setHeight("-1px"); caption.setValue("Apache OpenAZ Admin Console"); horizontalLayout_1.addComponent(caption); horizontalLayout_1.setExpandRatio(caption, 1.0f); horizontalLayout_1.setComponentAlignment(caption, new Alignment(33)); // labelWelcome labelWelcome = new Label(); labelWelcome.setImmediate(false); labelWelcome.setWidth("-1px"); labelWelcome.setHeight("40px"); labelWelcome.setValue("Label"); horizontalLayout_1.addComponent(labelWelcome); horizontalLayout_1.setComponentAlignment(labelWelcome, new Alignment(34)); return horizontalLayout_1; }
From source file:org.eclipse.hawkbit.ui.decorators.SPUIEmbedDecorator.java
License:Open Source License
/** * Decorate./*from w ww . j ava 2 s .c o m*/ * * @param spUIEmbdValue * as DTO * @return Embedded as UI */ public static Embedded decorate(final SPUIEmbedValue spUIEmbdValue) { final Embedded spUIEmbd = new Embedded(); spUIEmbd.setImmediate(spUIEmbdValue.isImmediate()); spUIEmbd.setType(spUIEmbdValue.getType()); if (null != spUIEmbdValue.getId()) { spUIEmbd.setId(spUIEmbdValue.getId()); } if (null != spUIEmbdValue.getData()) { spUIEmbd.setData(spUIEmbdValue.getData()); } if (null != spUIEmbdValue.getStyleName()) { spUIEmbd.setStyleName(spUIEmbdValue.getStyleName()); } if (null != spUIEmbdValue.getSource()) { spUIEmbd.setSource(new ThemeResource(spUIEmbdValue.getSource())); } if (null != spUIEmbdValue.getMimeType()) { spUIEmbd.setMimeType(spUIEmbdValue.getMimeType()); } if (null != spUIEmbdValue.getDescription()) { spUIEmbd.setDescription(spUIEmbdValue.getDescription()); } return spUIEmbd; }
From source file:org.eclipse.skalli.view.internal.window.ProjectEditPanelEntry.java
License:Open Source License
@SuppressWarnings("serial") private ComponentContainer createTray() { CssLayout layout = new CssLayout(); layout.setStyleName(STYLE_TRAY);/*from ww w .j av a 2 s .co m*/ layout.setMargin(true); HorizontalLayout header = new HorizontalLayout(); header.setSpacing(true); header.setStyleName(STYLE_TRAY_HEADER); header.setWidth("100%"); //$NON-NLS-1$ trayIcon = new Embedded(); trayIcon.setStyleName(STYLE_TRAY_HEADER_ICON); final String icon = formService.getIconPath(); if (StringUtils.isNotBlank(icon)) { trayIcon.setSource(new StreamResource(new ExtensionStreamSource(formService.getClass(), icon), FilenameUtils.getName(icon), application)); } header.addComponent(trayIcon); header.setComponentAlignment(trayIcon, Alignment.MIDDLE_LEFT); header.setExpandRatio(trayIcon, 0); Label captionLabel = new Label(getCaptionWithAnchor(), Label.CONTENT_XHTML); captionLabel.setStyleName(STYLE_TRAY_HEADER_LABEL); header.addComponent(captionLabel); header.setExpandRatio(captionLabel, 1); header.setComponentAlignment(captionLabel, Alignment.MIDDLE_LEFT); editButton = new Button(); layoutLinkButton(editButton, header, new ClickListener() { @Override public void buttonClick(ClickEvent event) { switch (state) { case DISABLED: setState(TrayState.EDITABLE_VISIBLE); break; case INHERITED_VISIBLE: setState(TrayState.EDITABLE_VISIBLE); break; case INHERITED_INVISIBLE: setState(TrayState.EDITABLE_VISIBLE); break; } } }); inheritButton = new Button(); layoutLinkButton(inheritButton, header, new ClickListener() { @Override public void buttonClick(ClickEvent event) { form.commit(); switch (state) { case DISABLED: setState(TrayState.INHERITED_VISIBLE); break; case EDITABLE_VISIBLE: setState(TrayState.INHERITED_VISIBLE); break; case EDITABLE_INVISIBLE: setState(TrayState.INHERITED_VISIBLE); break; } } }); disableButton = new Button(); layoutLinkButton(disableButton, header, new ClickListener() { @Override public void buttonClick(ClickEvent event) { form.commit(); switch (state) { case EDITABLE_INVISIBLE: setState(TrayState.DISABLED); break; case EDITABLE_VISIBLE: setState(TrayState.DISABLED); break; case INHERITED_INVISIBLE: setState(TrayState.DISABLED); break; case INHERITED_VISIBLE: setState(TrayState.DISABLED); break; } } }); visibleButton = new NativeButton(); layoutIconButton(visibleButton, header, new ClickListener() { @Override public void buttonClick(ClickEvent event) { switch (state) { case EDITABLE_INVISIBLE: setState(TrayState.EDITABLE_VISIBLE); break; case EDITABLE_VISIBLE: setState(TrayState.EDITABLE_INVISIBLE); break; case INHERITED_INVISIBLE: setState(TrayState.INHERITED_VISIBLE); break; case INHERITED_VISIBLE: setState(TrayState.INHERITED_INVISIBLE); break; } } }); layout.addComponent(header); CssLayout content = new CssLayout(); Label descriptionLabel = new Label(extensionService.getDescription(), Label.CONTENT_XHTML); descriptionLabel.setStyleName(STYLE_TRAY_DESCRIPTION); content.addComponent(descriptionLabel); layout.addComponent(content); return layout; }