List of usage examples for com.vaadin.ui HorizontalLayout setStyleName
@Override public void setStyleName(String style)
From source file:org.hip.vif.skin.dflt.Skin.java
License:Open Source License
@Override public Component getHeader(final String inAppName) { final HorizontalLayout outLayout = new HorizontalLayout(); outLayout.setStyleName("vif-head"); outLayout.setMargin(false);//from w ww. j a v a 2 s.c om outLayout.setWidth("100%"); outLayout.setHeight(80, Unit.PIXELS); final Embedded lImage = new Embedded(); lImage.setSource(new ThemeResource("images/vifLogo.gif")); outLayout.addComponent(lImage); outLayout.setComponentAlignment(lImage, Alignment.TOP_LEFT); outLayout.setExpandRatio(lImage, 0.42f); final Label lTitle = LabelHelper.createLabel("VIF Forum", "vif-head-title"); lTitle.setSizeUndefined(); outLayout.addComponent(lTitle); outLayout.setComponentAlignment(lTitle, Alignment.MIDDLE_LEFT); outLayout.setExpandRatio(lTitle, 0.58f); return outLayout; }
From source file:org.hip.vif.skin.green.Skin.java
License:Open Source License
@Override public Component getHeader(final String inAppName) { final HorizontalLayout outLayout = new HorizontalLayout(); outLayout.setWidth("100%"); outLayout.setHeight(115, Unit.PIXELS); outLayout.setStyleName("vif-green-head"); final Embedded lImage = new Embedded(); lImage.setSource(new ThemeResource("images/head.jpg")); outLayout.addComponent(lImage);//w w w . j av a 2s .c o m outLayout.setComponentAlignment(lImage, Alignment.TOP_LEFT); final Label lTitle = new Label("VIF - Virtual Discussion Forum"); lTitle.setStyleName("vif-head-title"); lTitle.setWidth(700, Unit.PIXELS); outLayout.addComponent(lTitle); return outLayout; }
From source file:org.hip.vif.web.layout.VIFFooter.java
License:Open Source License
private HorizontalLayout createLayout() { final HorizontalLayout out = new HorizontalLayout(); out.setStyleName("vif-footer-layout"); //$NON-NLS-1$ out.setWidth("100%"); //$NON-NLS-1$ return out;/* www . j av a2 s.com*/ }
From source file:org.jumpmind.vaadin.ui.common.ConfirmDialog.java
License:Open Source License
public ConfirmDialog(String caption, String text, final IConfirmListener confirmListener) { setCaption(caption);/* w w w .j a v a 2s .c om*/ setModal(true); setResizable(true); setWidth(300, Unit.PIXELS); setHeight(200, Unit.PIXELS); setClosable(false); VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); layout.setSpacing(true); layout.setMargin(true); setContent(layout); if (isNotBlank(text)) { Label textLabel = new Label(text); layout.addComponent(textLabel); layout.setExpandRatio(textLabel, 1); } HorizontalLayout buttonLayout = new HorizontalLayout(); buttonLayout.setStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR); buttonLayout.setSpacing(true); buttonLayout.setWidth(100, Unit.PERCENTAGE); Label spacer = new Label(" "); buttonLayout.addComponent(spacer); buttonLayout.setExpandRatio(spacer, 1); Button cancelButton = new Button("Cancel"); cancelButton.setClickShortcut(KeyCode.ESCAPE); cancelButton.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { UI.getCurrent().removeWindow(ConfirmDialog.this); } }); buttonLayout.addComponent(cancelButton); Button okButton = new Button("Ok"); okButton.setStyleName(ValoTheme.BUTTON_PRIMARY); okButton.setClickShortcut(KeyCode.ENTER); okButton.addClickListener(new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { if (confirmListener.onOk()) { UI.getCurrent().removeWindow(ConfirmDialog.this); } } }); buttonLayout.addComponent(okButton); layout.addComponent(buttonLayout); okButton.focus(); }
From source file:org.lunifera.example.vaadin.osgi.bootstrap.ds.SimpleDSUI.java
License:Apache License
@Override protected void init(VaadinRequest request) { HorizontalLayout layout = new HorizontalLayout(); setContent(layout);//w ww . ja v a 2 s . c om layout.setStyleName(Reindeer.LAYOUT_BLUE); layout.setSizeFull(); Label label = new Label(); label.setValue("<h1>Vaadin wired to Servlet by OSGi-DS component</h1>"); label.setContentMode(ContentMode.HTML); layout.addComponent(label); layout.setComponentAlignment(label, Alignment.TOP_CENTER); }
From source file:org.lunifera.example.vaadin.osgi.bootstrap.push.SimplePushUI.java
License:Apache License
@Override protected void init(VaadinRequest request) { HorizontalLayout layout = new HorizontalLayout(); setContent(layout);//from w w w. ja v a2 s.c o m layout.setStyleName(Reindeer.LAYOUT_BLUE); layout.setSizeFull(); label = new Label(); label.setContentMode(ContentMode.HTML); layout.addComponent(label); layout.setComponentAlignment(label, Alignment.TOP_CENTER); new Thread(new Runnable() { int counter = 0; @Override public void run() { while (true) { try { Thread.sleep(1000); } catch (InterruptedException e) { } counter++; label.getUI().access(new Runnable() { @Override public void run() { label.setValue( String.format("<h1>Running for %s seconds</h1>", Integer.toString(counter))); } }); } } }).start(); }
From source file:org.lunifera.example.vaadin.osgi.bootstrap.simple.SimpleUI.java
License:Apache License
@Override protected void init(VaadinRequest request) { HorizontalLayout layout = new HorizontalLayout(); setContent(layout);/*from www. j av a2 s .c o m*/ layout.setStyleName(Reindeer.LAYOUT_BLUE); layout.setSizeFull(); Label label = new Label(); label.setValue("<h1>Simple OSGi integration</h1>"); label.setContentMode(ContentMode.HTML); layout.addComponent(label); layout.setComponentAlignment(label, Alignment.TOP_CENTER); }
From source file:org.lunifera.examples.ecview.vaadinui.web.PersonUI.java
License:Apache License
@Override protected void init(VaadinRequest request) { currentPerson = persons.get(0);//w w w . ja v a 2s . co m registerButtonCallbacks(); HorizontalLayout layout = new HorizontalLayout(); setContent(layout); layout.setStyleName(Reindeer.LAYOUT_BLUE); layout.setSizeFull(); YView yView = findViewModel("org.lunifera.examples.ecview.uimodels.PersonView"); if (yView == null) { Notification.show("PersonView could not be found!", Type.ERROR_MESSAGE); return; } // render the Vaadin UI VaadinRenderer renderer = new VaadinRenderer(); try { viewContext = renderer.render(layout, yView, null); viewContext.setBean("countryService", countryService); viewContext.setBean("ds", currentPerson); viewContext.setBean("buttonCallback", buttonCallback); } catch (ContextException e) { e.printStackTrace(); } }
From source file:org.lunifera.sharky.m2m.webclient.SimplePushUI.java
License:Apache License
@Override protected void init(VaadinRequest request) { HorizontalLayout layout = new HorizontalLayout(); setContent(layout);/*from w w w.j a v a 2s . co m*/ layout.setStyleName(Reindeer.LAYOUT_BLUE); layout.setSizeFull(); label = new Label(); label.setContentMode(ContentMode.HTML); layout.addComponent(label); layout.setComponentAlignment(label, Alignment.TOP_CENTER); new Thread(new Runnable() { int counter = 0; @Override public void run() { while (true) { try { Thread.sleep(1000); } catch (InterruptedException e) { } counter++; label.getUI().access(new Runnable() { @Override public void run() { label.setValue( String.format("<h1>Running for %s seconds</h1>", Integer.toString(counter))); } }); } } }).start(); }
From source file:org.openeos.usertask.ui.internal.vaadin.TasksWindow.java
License:Apache License
private Component createToolbar() { HorizontalLayout hLayout = new HorizontalLayout(); hLayout.setMargin(false);//from w w w .j a v a 2 s . com hLayout.setWidth("100%"); hLayout.setSpacing(false); hLayout.setStyleName(Reindeer.LAYOUT_BLACK); addToolbarButtons(hLayout); return hLayout; }