@Override public void setWidth(float width, Unit unit) { getRootOrThrow().setWidth(width, unit); }
@Override public void setWidth(float width, Unit unit) { super.setWidth(width, unit); if (getContent() != null) { if (width < 0) { getContent().setWidthUndefined(); } else { getContent().setWidth(100, Unit.PERCENTAGE); } } }
@Override public void setWidth(String width) { getRootOrThrow().setWidth(width); }
/** * Adds the given components to this layout and sets them as expanded. The * width of all added child components are set to 100% so that the expansion * will be effective. The width of this layout is also set to 100% if it is * currently undefined. * <p> * The components are added in the provided order to the end of this layout. * Any components that are already children of this layout will be moved to * new positions. * * @param components * the components to set, not <code>null</code> * @since 8.0 */ public void addComponentsAndExpand(Component... components) { addComponents(components); if (getWidth() < 0) { setWidth(100, Unit.PERCENTAGE); } for (Component child : components) { child.setWidth(100, Unit.PERCENTAGE); setExpandRatio(child, 1); } }
public static <T extends Component> T width(T c, String width) { c.setWidth(width); return c; }
private void verifySaneFieldWidth(Component component) { if ((component instanceof Field) && component.getWidth() < 0) { component.setWidth("100%"); } }
@Override public void setWidth(String width) { // do not try to parse string if constant passed if (Component.AUTO_SIZE.equals(width)) { getComposition().setWidth(-1, Sizeable.Unit.PIXELS); } else if (Component.FULL_SIZE.equals(width)) { getComposition().setWidth(100, Sizeable.Unit.PERCENTAGE); } else { getComposition().setWidth(width); } }
/** * Setup content component, adjusting width and height according to parent component * @param content Content component */ private void setupContent(C content) { if (content != null) { if (getWidth() > -1) { content.setWidth(100, Unit.PERCENTAGE); } } }
public static void expand(AbstractOrderedLayout layout, Component component, String height, String width) { if (!isHorizontalLayout(layout) && (StringUtils.isEmpty(height) || AUTO_SIZE.equals(height) || height.endsWith("%"))) { component.setHeight(100, Sizeable.Unit.PERCENTAGE); } if (!isVerticalLayout(layout) && (StringUtils.isEmpty(width) || AUTO_SIZE.equals(width) || width.endsWith("%"))) { component.setWidth(100, Sizeable.Unit.PERCENTAGE); } layout.setExpandRatio(component, 1); }
public static Layout FORM(final Component...components) { VerticalLayout layout = new VerticalLayout(); //layout.addStyleName(Style.Rating.FIELDS); for (Component component : components) { if (component != null) { component.setWidth(100.0f, Unit.PERCENTAGE); layout.addComponent(component); } } return layout; }
public void layoutWidget( Component component, String elementName, Map<String, String> attributes, ComponentContainer container, VaadinMetawidget metawidget ) { // Do not render empty stubs if ( component instanceof Stub && !( (Stub) component ).getComponentIterator().hasNext() ) { return; } // Add it com.vaadin.ui.VerticalLayout layout = (com.vaadin.ui.VerticalLayout) container.getComponentIterator().next(); component.setWidth( "100%" ); layout.addComponent( component ); }
@Override public void setWidth(float width, Unit unit) { super.setWidth(width, unit); if (width > -1 && getCompositionRoot() != null) { getCompositionRoot().setWidth(100, Unit.PERCENTAGE); } }
@Override public void setWidth(float width, Unit unit) { super.setWidth(width, unit); if (width > -1 && getCompositionRoot() != null) { getCompositionRoot().setWidth(100, Unit.PERCENTAGE); } }
public static VerticalLayout VERTICAL(final boolean margin, final Component...components) { VerticalLayout layout = new VerticalLayout(); layout.setSpacing(margin); layout.setWidth(100.0f, Unit.PERCENTAGE); for (Component component : components) { if (component != null) { component.setWidth(100.0f, Unit.PERCENTAGE); layout.addComponent(component); } } return layout; }
@Override protected Component initContent() { final Component content = getInternalField(); if (getWidth() > -1) { content.setWidth(100, Unit.PERCENTAGE); } if (getHeight() > -1) { content.setHeight(100, Unit.PERCENTAGE); } return content; }
/** * Initializes the label for the file path display {@link #m_filePathLabel}. */ private void initFilePathLabel() { m_filePathLabel = new TextField(); m_filePathLabel.setWidth("100%"); m_filePathLabel.setEnabled(true); m_filePathLabel.setReadOnly(true); m_filePathLabel = new Label(m_messages.key(Messages.GUI_FILENAME_LABEL_0)); }
protected void setupSearchFoldersPane(Component searchFoldersPane) { searchFoldersPane.setHeight(100, Unit.PERCENTAGE); searchFoldersPane.setWidth(100, Unit.PERCENTAGE); if (isNeedFoldersTitle()) { searchFoldersLabel = new Label(messages.getMainMessage("folders.searchFoldersRoot")); searchFoldersLabel.setStyleName("c-folders-pane-caption"); } else { searchFoldersLabel = null; } }
protected void setupAppFoldersPane(Component appFoldersPane) { appFoldersPane.setHeight("100%"); appFoldersPane.setWidth("100%"); if (isNeedFoldersTitle()) { appFoldersLabel = new Label(messages.getMainMessage("folders.appFoldersRoot")); appFoldersLabel.setStyleName("c-folders-pane-caption"); } else { appFoldersLabel = null; } }