@Override public DefaultHasSizeConfigurator width(String width) { component.setWidth(width); return this; }
/** * Sets the width of the component to "100%". * <p> * This is just a convenience method which delegates its call to the * {@link #setWidth(String)} with * {@literal "100%"} as the argument value */ default void setWidthFull() { setWidth("100%"); }
/** * Removes the width and the height of the component. * <p> * This is just a convenience method which delegates its call to the * {@link #setWidth(String)} and {@link #setHeight(String)} methods with * {@literal null} as the argument value */ default void setSizeUndefined() { setWidth(null); setHeight(null); } }
/** * Sets the width and the height of the component to "100%". * <p> * This is just a convenience method which delegates its call to the * {@link #setWidth(String)} and {@link #setHeight(String)} methods with * {@literal "100%"} as the argument value */ default void setSizeFull() { setWidth("100%"); setHeight("100%"); }
/** * Set the time input width. * @param timeInputWidth the time input width to set */ public void setTimeInputWidth(String timeInputWidth) { this.timeInputWidth = timeInputWidth; this.time.hasSize().ifPresent(s -> s.setWidth(timeInputWidth)); }
private void configureField(HasValue field, String property, String fieldCaption, boolean readOnly, CrudFormConfiguration configuration) { if (fieldCaption == null) { fieldCaption = SharedUtil.propertyIdToHumanFriendly(property); } try { Method setLabelMethod = field.getClass().getMethod("setLabel", String.class); setLabelMethod.invoke(field, fieldCaption); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException ignore) { } if (field != null && field instanceof HasSize) { ((HasSize) field).setWidth("100%"); } field.setReadOnly(readOnly); if (!configuration.getDisabledProperties().isEmpty() && field instanceof HasEnabled) { ((HasEnabled) field).setEnabled(!configuration.getDisabledProperties().contains(property)); } }
/** * Replace the current time input with the given one. * @param time the time input to set (not null) */ public void setTimeInput(Input<LocalTime> time) { ObjectUtils.argumentNotNull(time, "LocalTime input must be not null"); Input<LocalTime> previous = this.time; this.time = time; this.time.setRequired(previous.isRequired()); this.time.setReadOnly(previous.isReadOnly()); if (this.timeInputWidth != null) { this.time.hasSize().ifPresent(s -> s.setWidth(timeInputWidth)); } this.valueChangeListeners.forEach(listener -> { this.time.addValueChangeListener(e -> { if (e.isUserOriginated()) { listener.valueChanged(new ComponentValueChangeEvent<>(DateTimeField.this, DateTimeField.this, getDateValue().map(date -> LocalDateTime.of(date, e.getOldValue())).orElse(null), e.isUserOriginated())); } }); }); }