List of usage examples for com.vaadin.ui AbstractComponent setHeight
@Override public void setHeight(String height)
From source file:com.oodrive.nuage.webui.VvrManagerUi.java
License:Apache License
/** * Add a VVR user interface./*from w w w . j a v a 2s.c o m*/ * * @param vvrUuid * the vvr unique identifier * */ public final void addVvr(final UUID vvrUuid) { // Create a vvr model final VvrModel vvrModel = jmxHandler.createVvrModel(vvrUuid); vvrModels.put(vvrUuid, vvrModel); // Layout for the first component final VerticalLayout vvrLayout = new VerticalLayout(); vvrLayout.setWidth("100%"); vvrsTabsheet.addTab(vvrLayout, vvrModel.getVvrName(), null, vvrsTabsheet.getComponentCount() - 1); vvrLayouts.put(vvrUuid, vvrLayout); // Create component for vvr operations final VvrOperationComponent op = new VvrOperationComponent(vvrManagerModel); final AbstractComponent opComponent = op.createComponent(vvrModel, jmxHandler); opComponent.setHeight(opLayoutHeight); vvrLayout.addComponent(opComponent); final Label label = new Label(" ", ContentMode.HTML); label.setHeight(labelLayoutHeight); vvrLayout.addComponent(label); vvrLayout.addComponent(new Label("<hr />", ContentMode.HTML)); // Create Tool tip for attributes final VvrAttributesComponent attr = new VvrAttributesComponent(vvrUuid); vvrsTabsheet.getTab(vvrLayout).setDescription(attr.createComponent(vvrModel)); // If there was only the + sheet, select the new vvr sheet if (vvrsTabsheet.getComponentCount() == 2) { vvrsTabsheet.setSelectedTab(0); } // Create its panel final HorizontalSplitPanel panel = new HorizontalSplitPanel(); vvrLayout.addComponent(panel); panel.setWidth("100%"); panel.setHeight(panelLayoutHeight); panel.setSplitPosition(35); // Component to display snapshot/device atributes final VerticalLayout vvrTreeLayout = new VerticalLayout(); final VvrTreeComponent vvrTreeComponent = new VvrTreeComponent(vvrTreeLayout); panel.setFirstComponent(vvrTreeComponent.createComponent(vvrModel, jmxHandler)); panel.setSecondComponent(vvrTreeLayout); vvrTreeComponents.put(vvrUuid, vvrTreeComponent); }
From source file:de.mhus.lib.vaadin.layouter.LayUtil.java
License:Apache License
public static void configure(AbstractComponent layout, ResourceNode config) throws MException { if (config.getBoolean(LayoutBuilder.FULL_SIZE, false)) layout.setSizeFull();/*www. j a va 2 s . c om*/ else { String width = config.getString(LayoutBuilder.WIDTH, null); if (width != null) layout.setWidth(width); String height = config.getString(LayoutBuilder.HEIGHT, null); if (height != null) layout.setHeight(height); } // margin //TODO if (layout instanceof Layout && config.isProperty(LayoutBuilder.MARGIN)) // ((Layout)layout).setMargin(config.getBoolean(LayoutBuilder.MARGIN, false)); // spacing if (layout instanceof Layout.SpacingHandler && config.isProperty(LayoutBuilder.SPACING)) ((Layout.SpacingHandler) layout).setSpacing(config.getBoolean(LayoutBuilder.SPACING, false)); // styles if (config.isProperty(LayoutBuilder.STYLE)) { layout.setStyleName(config.getExtracted(LayoutBuilder.STYLE)); } // hidden if (config.getBoolean(LayoutBuilder.HIDDEN, false)) layout.setVisible(false); // split if (layout instanceof AbstractSplitPanel) { String a = config.getString(LayoutBuilder.SPLIT_MIN, null); if (a != null) { float[] s = parseStringSize(a); if (s[0] >= 0) ((AbstractSplitPanel) layout).setMinSplitPosition(s[0], Unit.values()[(int) s[1]]); } a = config.getString(LayoutBuilder.SPLIT_MAX, null); if (a != null) { float[] s = parseStringSize(a); if (s[0] >= 0) ((AbstractSplitPanel) layout).setMaxSplitPosition(s[0], Unit.values()[(int) s[1]]); } a = config.getString(LayoutBuilder.SPLIT_POS, null); if (a != null) { float[] s = parseStringSize(a); if (s[0] >= 0) ((AbstractSplitPanel) layout).setSplitPosition(s[0], Unit.values()[(int) s[1]]); } } }
From source file:eu.lod2.LOD2Demo.java
License:Apache License
private void resetSizeFull(AbstractComponentContainer comp) { Iterator<Component> it = comp.getComponentIterator(); while (it.hasNext()) { Component c = it.next();/*w w w. j a va2 s . co m*/ if (c instanceof AbstractComponent) { AbstractComponent ac = (AbstractComponent) c; ac.setSizeFull(); if (ac.getHeight() < 0) { ac.setHeight("100%"); } ; } ; if (c instanceof AbstractComponentContainer) { AbstractComponentContainer acc = (AbstractComponentContainer) c; resetSizeFull(acc); } ; } ; }