/** Set component width to {@link #AUTO_SIZE} */ default void setWidthAuto() { setWidth(AUTO_SIZE); }
@Override public void setWidth(String width) { if (component != null) { component.setWidth(width); } else { targetWidth = width; } }
/** Set component width to 100% */ default void setWidthFull() { setWidth(FULL_SIZE); }
@Override protected void loadWidth(Component component, Element element) { final String width = element.attributeValue("width"); if ("auto".equalsIgnoreCase(width)) { component.setWidth("640px"); } else if (!StringUtils.isBlank(width)) { component.setWidth(width); } else { component.setWidth("640px"); } }
protected void loadWidth(Component component, Element element, @Nullable String defaultValue) { final String width = element.attributeValue("width"); if ("auto".equalsIgnoreCase(width)) { component.setWidth(Component.AUTO_SIZE); } else if (!StringUtils.isBlank(width)) { component.setWidth(loadThemeString(width)); } else if (!StringUtils.isBlank(defaultValue)) { component.setWidth(defaultValue); } }
/** Set component width and height to 100% */ default void setSizeFull() { setWidth(FULL_SIZE); setHeight(FULL_SIZE); }
/** Set component width and height to {@link #AUTO_SIZE} */ default void setSizeAuto() { setWidth(AUTO_SIZE); setHeight(AUTO_SIZE); }
protected void createDefaultValueComponent() { defaultValueLayout = (BoxLayout) getComponent("defaultValueLayout"); if (defaultValueLayout != null) { if (defaultValueComponent != null) { defaultValueLayout.remove(defaultValueComponent); } if (condition.getParam() != null) { defaultValueComponent = condition.getParam().createEditComponent(Param.ValueProperty.DEFAULT_VALUE); defaultValueLayout.add(defaultValueComponent); defaultValueComponent.setAlignment(Alignment.MIDDLE_LEFT); if (defaultValueComponent instanceof TextField) { defaultValueComponent.setWidth(theme.get("cuba.gui.conditionFrame.textField.width")); } } } }
if (Strings.isNullOrEmpty(componentWidth) && columnWidth != null) { component.setWidth(columnWidth);