@Override public void setWidthUndefined() { setWidth(-1, Unit.PIXELS); }
@Override public void setWidth(float width, Unit unit) { super.setWidth(width, unit); if (container != null) { if (width < 0) { container.setWidthUndefined(); field.setWidthUndefined(); if (inputWrapper != null) { inputWrapper.setWidthUndefined(); } } else { container.setWidth(100, Unit.PERCENTAGE); field.setWidth(100, Unit.PERCENTAGE); if (inputWrapper != null) { inputWrapper.setWidth(100, Unit.PERCENTAGE); } } } }
@Override public void setSizeFull() { setWidth(100, Unit.PERCENTAGE); setHeight(100, Unit.PERCENTAGE); }
/** * Reads the size of this component from the given design attributes. If the * attributes do not contain relevant size information, defaults is * consulted. * * @param attributes * the design attributes */ private void readSize(Attributes attributes) { // read width if (attributes.hasKey("width-auto") || attributes.hasKey("size-auto")) { this.setWidth(null); } else if (attributes.hasKey("width-full") || attributes.hasKey("size-full")) { this.setWidth("100%"); } else if (attributes.hasKey("width")) { this.setWidth(attributes.get("width")); } // read height if (attributes.hasKey("height-auto") || attributes.hasKey("size-auto")) { this.setHeight(null); } else if (attributes.hasKey("height-full") || attributes.hasKey("size-full")) { this.setHeight("100%"); } else if (attributes.hasKey("height")) { this.setHeight(attributes.get("height")); } }
@Override public void setWidth(float width, Unit unit) { /* * child tree repaints may be needed, due to our fall back support for * invalid relative sizes */ boolean dirtyChild = false; boolean childrenMayBecomeUndefined = false; if (getWidth() == SIZE_UNDEFINED && width != SIZE_UNDEFINED) { // children currently in invalid state may need repaint dirtyChild = getInvalidSizedChild(false); } else if ((width == SIZE_UNDEFINED && getWidth() != SIZE_UNDEFINED) || (unit == Unit.PERCENTAGE && getWidthUnits() != Unit.PERCENTAGE && !ComponentSizeValidator .parentCanDefineWidth(this))) { /* * relative width children may get to invalid state if width becomes * invalid. Width may also become invalid if units become percentage * due to the fallback support */ childrenMayBecomeUndefined = true; dirtyChild = getInvalidSizedChild(false); } super.setWidth(width, unit); repaintChangedChildTree(dirtyChild, childrenMayBecomeUndefined, false); }
@Override public void setWidth(float width, Unit unit) { /* * child tree repaints may be needed, due to our fall back support for * invalid relative sizes */ Collection<Component> dirtyChildren = null; boolean childrenMayBecomeUndefined = false; if (getWidth() == SIZE_UNDEFINED && width != SIZE_UNDEFINED) { // children currently in invalid state may need repaint dirtyChildren = getInvalidSizedChildren(false); } else if ((width == SIZE_UNDEFINED && getWidth() != SIZE_UNDEFINED) || (unit == Unit.PERCENTAGE && getWidthUnits() != Unit.PERCENTAGE && !ComponentSizeValidator .parentCanDefineWidth(this))) { /* * relative width children may get to invalid state if width becomes * invalid. Width may also become invalid if units become percentage * due to the fallback support */ childrenMayBecomeUndefined = true; dirtyChildren = getInvalidSizedChildren(false); } super.setWidth(width, unit); repaintChangedChildTrees(dirtyChildren, childrenMayBecomeUndefined, false); }
@Override public B width(float width, Unit unit) { getInstance().setWidth(width, unit); return builder(); }
@Override public B width(String width) { getInstance().setWidth(width); return builder(); }
@Override public B width(String width) { getInstance().setWidth(width); return builder(); }
@Override public B fullWidth() { getInstance().setWidth(100, Unit.PERCENTAGE); return builder(); }
@Override public B width(float width, Unit unit) { getInstance().setWidth(width, unit); return builder(); }
@Override public B fullWidth() { getInstance().setWidth(100, Unit.PERCENTAGE); return builder(); }
@Override protected void initComponent() { super.initComponent(); if(!tableCreated) { createSimCardsTable(); tableCreated = true; } mainWindow = this.getWindow(); Panel basePanel = new Panel(""); basePanel.addComponent(inventoryFilterPanel); AbstractComponent separatorLine = Cf.horizontalLine(); //Of no signficance separatorLine.addStyleName("m2m-horizontal-line-list-separator"); separatorLine.setWidth("99%"); basePanel.addComponent(separatorLine); basePanel.addComponent(simCardTable); basePanel.setSizeFull(); basePanel.getContent().setSizeUndefined(); // <-- This is the important part addComponent(basePanel); setExpandRatio(basePanel, 1); }
protected AbstractComponent getLabel() { if (label == null) { if (getElement().getConfig().isProperty("wizzard")) { label = new Button(((LayoutDataElement)getElement()).getTitle()); ((Button)label).setStyleName(BaseTheme.BUTTON_LINK); ((Button)label).addListener(new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(ClickEvent event) { getElement().getFormControl().wizzard(getElement()); } }); } else label = new Label(((LayoutDataElement)getElement()).getTitle()); label.setWidth("100%"); } return label; }
protected void initLayout() { container = new CubaCssActionsLayout(); container.setPrimaryStyleName(LAYOUT_STYLENAME); container.setWidth(100, Unit.PERCENTAGE); field.setWidth(100, Unit.PERCENTAGE); Page current = Page.getCurrent(); if (current != null) { WebBrowser browser = current.getWebBrowser(); if (browser != null && browser.isSafari()) { inputWrapper = new CssLayout(); inputWrapper.setWidth(100, Unit.PERCENTAGE); inputWrapper.setPrimaryStyleName("safari-input-wrap"); inputWrapper.addComponent(field); container.addComponent(inputWrapper); } else { container.addComponent(field); } } else { container.addComponent(field); } setFocusDelegate((Focusable) field); }
if (tileSize > 3) tileSize = 3; tile.addStyleName("thumbnail" + tileSize); tile.setWidth(( tileWidth * tileSize + (tileSize - 1) * tileHorizontalGap ) + "px"); tile.setHeight( tileHeight + "px"); overView.addComponent(tile);
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);
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);