List of usage examples for com.vaadin.ui AbstractOrderedLayout addComponent
@Override public void addComponent(Component c)
From source file:org.eclipse.emf.ecp.view.core.vaadin.AbstractContainerRendererVaadin.java
License:Open Source License
@Override protected Component render() { final T renderable = getVElement(); final AbstractOrderedLayout layout = getAbstractOrderedLayout(); for (final VContainedElement composite : renderable.getChildren()) { final Component renderResult = getRendererFactory().render(composite, getViewModelContext()); layout.addComponent(renderResult); }/*from w w w . jav a2 s . c o m*/ final Component renderComponent = getRenderComponent(layout); renderComponent.setWidth(100, Unit.PERCENTAGE); if (renderComponent instanceof AbstractOrderedLayout) { final AbstractOrderedLayout abstractOrderedLayout = (AbstractOrderedLayout) renderComponent; abstractOrderedLayout.setMargin(isMargin()); abstractOrderedLayout.setSpacing(isSpacing()); } return renderComponent; }
From source file:org.eclipse.emf.ecp.view.core.vaadin.dialog.EditDialog.java
License:Open Source License
private void createOkButton(AbstractOrderedLayout layout) { okButton = new Button(Messages.ok, new Button.ClickListener() { @Override//from www . j a v a 2s . c o m public void buttonClick(ClickEvent event) { close(); } }); layout.addComponent(okButton); layout.setComponentAlignment(okButton, Alignment.TOP_RIGHT); }
From source file:org.eclipse.emf.ecp.view.vaadin.ViewRendererVaadin.java
License:Open Source License
@Override public Component render() { final AbstractOrderedLayout layout = getLayout(); layout.setSpacing(true);//from www . j a v a 2 s .c om layout.setMargin(true); layout.setSizeFull(); for (final VContainedElement composite : getVElement().getChildren()) { final Component renderResult = getRendererFactory().render(composite, getViewModelContext()); layout.addComponent(renderResult); } final ECPVaadinViewComponent ecpVaadinViewComponent = new ECPVaadinViewComponent(); ecpVaadinViewComponent.addStyleName(BORDERLESS); ecpVaadinViewComponent.setContent(layout); return ecpVaadinViewComponent; }
From source file:org.jdal.vaadin.ui.Box.java
License:Apache License
/** * Try to imitate a HorizalGlue of Swing BoxLayout. * A invisible component that get all extra space. * @param layout layout to add glue/*from ww w .j a v a 2 s . c om*/ */ public static void addHorizontalGlue(AbstractOrderedLayout layout) { Label label = new Label(); label.setWidth("100%"); layout.addComponent(label); layout.setExpandRatio(label, 1.0f); }
From source file:org.jdal.vaadin.ui.Box.java
License:Apache License
/** * Try to imitate a VerticalGlue of Swing BoxLayout */// w w w .j a va2 s . c om public static void addVerticalGlue(AbstractOrderedLayout layout) { Label label = new Label(" "); label.setHeight("100%"); layout.addComponent(label); layout.setExpandRatio(label, 1.0f); }
From source file:org.jdal.vaadin.ui.Box.java
License:Apache License
/** * Try to imitate HorizontalStruct on Swing BoxLayout * @param layout Layout to add the struct * @param width struct withd/*from ww w. j a va2s. c o m*/ */ public static void addHorizontalStruct(AbstractOrderedLayout layout, int width) { Label label = new Label(); label.setWidth(width + "px"); layout.addComponent(label); layout.setExpandRatio(label, 0f); }
From source file:org.jdal.vaadin.ui.Box.java
License:Apache License
/** * Try to imitate VerticalStruct of Swing BoxLayout * @param layout layout to add struct/* w w w . java 2s . c o m*/ * @param height struct height */ public static void addVerticalStruct(AbstractOrderedLayout layout, int height) { Label label = new Label(); label.setHeight(height + "px"); layout.addComponent(label); layout.setExpandRatio(label, 0f); }
From source file:org.opennms.features.vaadin.dashboard.dashlets.AlarmDetailsDashlet.java
License:Open Source License
/** * Adds the alarms components to a {@link AbstractOrderedLayout} * * @param component the component to add alarms to * @param alarms the alarms list/* ww w .ja v a2s. c o m*/ */ private void addComponents(AbstractOrderedLayout component, List<OnmsAlarm> alarms) { if (alarms.size() == 0) { Label label = new Label("No alarms found!"); label.addStyleName("alert-details-noalarms-font"); component.addComponent(label); } else { StringBuilder sb = new StringBuilder(); sb.append("<table class='alert-details-dashlet onms-table'>"); sb.append("<thead>"); sb.append( "<th class='alert-details-dashlet onms-header-cell'>ID</th><th class='alert-details-dashlet onms-header-cell'>Severity</th><th class='alert-details-dashlet onms-header-cell'>Node</th><th class='alert-details-dashlet onms-header-cell'>Count</th><th class='alert-details-dashlet onms-header-cell'>Last Event Time</th><th class='alert-details-dashlet onms-header-cell'>Log Msg</th>"); sb.append("</thead>"); for (OnmsAlarm onmsAlarm : alarms) { OnmsNode onmsNode = null; if (onmsAlarm.getNodeId() != null) { CriteriaBuilder nodeCb = new CriteriaBuilder(OnmsNode.class); nodeCb.eq("id", onmsAlarm.getNodeId()); List<OnmsNode> nodes = m_nodeDao.findMatching(nodeCb.toCriteria()); if (nodes.size() == 1) { onmsNode = nodes.get(0); } } sb.append("<tr class='alert-details-dashlet " + onmsAlarm.getSeverity().getLabel() + "'>"); sb.append( "<td class='alert-details-dashlet onms-cell divider bright onms' valign='middle' rowspan='1'><nobr> " + onmsAlarm.getId() + "</nobr></td>"); sb.append( "<td class='alert-details-dashlet onms-cell divider onms' valign='middle' rowspan='1'><nobr>" + onmsAlarm.getSeverity().getLabel() + "</nobr></td>"); sb.append( "<td class='alert-details-dashlet onms-cell divider onms' valign='middle' rowspan='1'><nobr>" + (onmsNode != null ? onmsNode.getLabel() : "-") + "</nobr></td>"); sb.append( "<td class='alert-details-dashlet onms-cell divider onms' valign='middle' rowspan='1'><nobr>" + onmsAlarm.getCounter() + "</nobr></td>"); sb.append( "<td class='alert-details-dashlet onms-cell divider onms' valign='middle' rowspan='1'><nobr>" + onmsAlarm.getLastEventTime().toString() + "</nobr></td>"); sb.append("<td class='alert-details-dashlet onms-cell divider onms' valign='middle' rowspan='1'>" + onmsAlarm.getLogMsg().replaceAll("\\<.*?>", "") + "</td>"); sb.append("</td></tr>"); } sb.append("</table>"); Label label = new Label(sb.toString()); label.setSizeFull(); label.setContentMode(ContentMode.HTML); component.addComponent(label); } }
From source file:org.opennms.features.vaadin.dashboard.dashlets.AlarmsDashlet.java
License:Open Source License
/** * Adds the alarms components to a {@link com.vaadin.ui.AbstractOrderedLayout} * * @param component the component to add alarms to * @param alarms the alarms list/*from w w w . ja v a 2 s.co m*/ */ private void addComponents(AbstractOrderedLayout component, List<OnmsAlarm> alarms) { if (alarms.size() == 0) { Label label = new Label("No alarms found!"); label.addStyleName("alerts-noalarms-font"); component.addComponent(label); } else { for (OnmsAlarm onmsAlarm : alarms) { OnmsNode onmsNode = null; if (onmsAlarm.getNodeId() != null) { CriteriaBuilder nodeCb = new CriteriaBuilder(OnmsNode.class); nodeCb.eq("id", onmsAlarm.getNodeId()); List<OnmsNode> nodes = m_nodeDao.findMatching(nodeCb.toCriteria()); if (nodes.size() == 1) { onmsNode = nodes.get(0); } } component.addComponent(createAlarmComponent(onmsAlarm, onmsNode)); OnmsSeverity boostSeverity = OnmsSeverity .valueOf(getDashletSpec().getParameters().get("boostSeverity")); if (onmsAlarm.getSeverity().isGreaterThanOrEqual(boostSeverity)) { boosted = true; } } } }
From source file:org.semanticsoft.vaaclipse.presentation.renderers.AreaRenderer.java
License:Open Source License
@Override public void processContents(MElementContainer<MUIElement> container) { MArea area = (MArea) (MElementContainer<?>) container; AbstractOrderedLayout parentPane = (AbstractOrderedLayout) area.getWidget(); parentPane.removeAllComponents();/* w w w . j a v a2 s . c o m*/ for (MUIElement element : area.getChildren()) { if (element.isToBeRendered()) { if (element instanceof MPlaceholder) element = ((MPlaceholder) element).getRef(); parentPane.addComponent((Component) element.getWidget()); } } refreshTopRightState(area); }