@Override public OptionDialogBuilder withWidth(String width) { window.setWidth(width); if (getWidth() < 0) { messageLabel.setWidthUndefined(); layout.setWidthUndefined(); } else { messageLabel.setWidth(100, Sizeable.Unit.PERCENTAGE); layout.setWidth(100, Sizeable.Unit.PERCENTAGE); } return this; }
@Override public MessageDialogBuilder withWidth(String width) { window.setWidth(width); if (getWidth() < 0) { messageLabel.setWidthUndefined(); layout.setWidthUndefined(); } else { messageLabel.setWidth(100, Sizeable.Unit.PERCENTAGE); layout.setWidth(100, Sizeable.Unit.PERCENTAGE); } return this; }
protected Component getComponentImplementation(com.haulmont.cuba.gui.components.Component columnComponent) { com.vaadin.ui.Component composition = columnComponent.unwrapComposition(com.vaadin.ui.Component.class); Component componentImpl = composition; if (composition instanceof com.vaadin.v7.ui.Field && ((com.vaadin.v7.ui.Field) composition).isRequired()) { VerticalLayout layout = new VerticalLayout(); // vaadin8 replace with CssLayout layout.setMargin(false); layout.setSpacing(false); layout.addComponent(composition); if (composition.getWidth() < 0) { layout.setWidthUndefined(); } componentImpl = layout; } return componentImpl; }
@Override public void showCustomPopupActions(List<Action> actions) { VerticalLayout customContextMenu = new VerticalLayout(); customContextMenu.setMargin(false); customContextMenu.setSpacing(false); customContextMenu.setWidthUndefined(); customContextMenu.setStyleName("c-cm-container"); for (Action action : actions) { CubaButton contextMenuButton = createContextMenuButton(); initContextMenuButton(contextMenuButton, action); customContextMenu.addComponent(contextMenuButton); } if (customContextMenu.getComponentCount() > 0) { component.showCustomPopup(customContextMenu); component.setCustomPopupAutoClose(true); } }
public CubaTokenList(WebTokenList<T> owner) { this.owner = owner; composition = new VerticalLayout(); composition.setWidthUndefined(); composition.setSpacing(false); composition.setMargin(false); tokenContainer = new CubaScrollBoxLayout(); tokenContainer.setStyleName(TOKENLIST_SCROLLBOX_STYLENAME); tokenContainer.setWidthUndefined(); tokenContainer.setMargin(new MarginInfo(true, false, false, false)); composition.addComponent(tokenContainer); setPrimaryStyleName(TOKENLIST_STYLENAME); // do not trigger overridden method super.setWidth(-1, Unit.PIXELS); }
@Override public void setWidth(float width, Unit unit) { super.setWidth(width, unit); // workaround for custom field call from constructor if (composition != null && tokenContainer != null) { if (width > 0) { composition.setWidth("100%"); editor.setWidth("100%"); if (!owner.isSimple()) { owner.lookupPickerField.setWidthFull(); editor.setExpandRatio(WebComponentsHelper.getComposition(owner.lookupPickerField), 1); } } else { composition.setWidthUndefined(); editor.setWidthUndefined(); if (!owner.isSimple()) { owner.lookupPickerField.setWidthAuto(); editor.setExpandRatio(WebComponentsHelper.getComposition(owner.lookupPickerField), 0); } } } }
layout.setMargin(false); layout.setSpacing(false); layout.setWidthUndefined(); layout.setStyleName("c-table-view-textcut");
protected void updateSizes() { if (getHeight() > 0) { composition.setHeight("100%"); composition.setExpandRatio(tokenContainer, 1); tokenContainer.setHeight("100%"); } else { composition.setHeightUndefined(); composition.setExpandRatio(tokenContainer, 0); tokenContainer.setHeightUndefined(); } if (getWidth() > 0) { composition.setWidth("100%"); editor.setWidth("100%"); if (!owner.isSimple()) { owner.lookupPickerField.setWidthFull(); editor.setExpandRatio(WebComponentsHelper.getComposition(owner.lookupPickerField), 1); } } else { composition.setWidthUndefined(); editor.setWidthUndefined(); if (!owner.isSimple()) { owner.lookupPickerField.setWidthAuto(); editor.setExpandRatio(WebComponentsHelper.getComposition(owner.lookupPickerField), 0); } } }
layout.setSpacing(true); layout.setMargin(true); layout.setWidthUndefined();
errorPanel.setWidthUndefined(); errorPanel.setMargin(false); errorPanel.setSpacing(true);
root.setWidthUndefined(); root.setSpacing(true); root.setMargin(false);
layout.setSpacing(true); layout.setMargin(false); layout.setWidthUndefined(); layout.setStyleName("c-nousersession-dialog-layout"); layout.setSpacing(true);
layout.setWidthUndefined(); layout.setSpacing(true); layout.setMargin(false);