public AbstractField<?> getBooleanField(MaduraPropertyWrapper property) { return new CheckBox(); } public AbstractField<?> getSelectField(MaduraPropertyWrapper property) {
public static CheckBox checkBox(String caption) { CheckBox cb = new CheckBox(); if (caption != null) { cb.setCaption(caption); } cb.setValue(false); cb.setImmediate(true); cb.setWidth(100, Sizeable.UNITS_PERCENTAGE); return cb; }
@Override public void writeDesign(Element design, DesignContext designContext) { super.writeDesign(design, designContext); CheckBox def = designContext.getDefaultInstance(this); Attributes attr = design.attributes(); DesignAttributeHandler.writeAttribute("checked", attr, getValue(), def.getValue(), Boolean.class, designContext); }
/** * Creates a new checkbox. */ public CheckBox() { registerRpc(rpc); registerRpc(new FocusAndBlurServerRpcDecorator(this, this::fireEvent)); setValue(Boolean.FALSE); }
private CheckBox createViewCheckbox(String caption, final String viewName) { final CheckBox checkBox = new CheckBox(caption, true); checkBox.addValueChangeListener(new HasValue.ValueChangeListener<Boolean>() { @Override public void valueChange(HasValue.ValueChangeEvent<Boolean> valueChangeEvent) { if (checkBox.getValue()) { allowedViews.add(viewName); } else { allowedViews.remove(viewName); } } }); return checkBox; }
public OptionalDateField(I18NSource messageSource) { HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setWidth("100%"); maxRangeCheckBox = new CheckBox(messageSource.getMessage("date.field.max.range")); maxRangeCheckBox.setValue(false); maxRangeCheckBox.setImmediate(true); maxRangeCheckBox.setWidth("100%"); maxRangeCheckBox.addListener(new ValueChangeListener() { public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) { toggleDateField(maxRangeCheckBox.booleanValue() ? null : new Date()); } }); dateField = new PopupDateField(); dateField.setImmediate(true); dateField.setDateFormat(VaadinUtility.SIMPLE_DATE_FORMAT_STRING); dateField.setWidth("100px"); dateField.setResolution(DateField.RESOLUTION_DAY); layout.addComponent(dateField); layout.addComponent(maxRangeCheckBox); layout.setExpandRatio(maxRangeCheckBox, 1.0F); setCompositionRoot(layout); }
private CheckBox enableMaintenanceWindowControl() { final CheckBox enableMaintenanceWindow = new CheckBox( getI18n().getMessage("caption.maintenancewindow.enabled")); enableMaintenanceWindow.setId(UIComponentIdProvider.MAINTENANCE_WINDOW_ENABLED_ID); enableMaintenanceWindow.addStyleName(ValoTheme.CHECKBOX_SMALL); enableMaintenanceWindow.addStyleName("dist-window-maintenance-window-enable"); enableMaintenanceWindow.addValueChangeListener(event -> { final Boolean isMaintenanceWindowEnabled = enableMaintenanceWindow.getValue(); maintenanceWindowLayout.setVisible(isMaintenanceWindowEnabled); maintenanceWindowLayout.setEnabled(isMaintenanceWindowEnabled); enableSaveButton(!isMaintenanceWindowEnabled); maintenanceWindowLayout.clearAllControls(); }); return enableMaintenanceWindow; }
public Object generateCell(Table source, final Object itemId, Object columnId) { CheckBox checkBox = new CheckBox(); checkBox.setImmediate(true); checkBox.setDescription("Make this Surveillance View configuration the default"); final View view = m_beanItemContainer.getItem(itemId).getBean(); checkBox.setValue(SurveillanceViewProvider.getInstance().getSurveillanceViewConfiguration().getDefaultView().equals(view.getName())); checkBox.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent valueChangeEvent) { boolean newValue = ((Boolean) valueChangeEvent.getProperty().getValue()); if (newValue) { SurveillanceViewProvider.getInstance().getSurveillanceViewConfiguration().setDefaultView(view.getName()); } m_table.refreshRowCache(); SurveillanceViewProvider.getInstance().save(); ((SurveillanceViewsConfigUI) getUI()).notifyMessage("Data saved", "Default surveillance view"); } }); return checkBox; } }
private CheckBox createTargetVisibleField() { final CheckBox checkBox = new CheckBox(); checkBox.setId(UIComponentIdProvider.METADATA_TARGET_VISIBLE_ID); checkBox.setCaption(i18n.getMessage("metadata.targetvisible")); checkBox.addValueChangeListener(this::onCheckBoxChange); return checkBox; }
if(solrEnabled != null && solrEnabled.equals("true") && ReplayTab.this.useDbCheckbox.getValue() == false) item.getItemProperty("Timestamp").setValue(timestamp); CheckBox cb = new CheckBox(); cb.setImmediate(true); cb.setDescription("Select in order to add to bulk download.");
private VerticalLayout initView() { final Label label = new Label(i18n.getMessage("label.auto.assign.description")); checkBox = new CheckBox(i18n.getMessage("label.auto.assign.enable")); checkBox.setId(UIComponentIdProvider.DIST_SET_SELECT_ENABLE_ID); checkBox.setImmediate(true); checkBox.addValueChangeListener(this); setTableEnabled(false); final VerticalLayout verticalLayout = new VerticalLayout(); verticalLayout.addComponent(label); verticalLayout.addComponent(checkBox); verticalLayout.addComponent(dsTable); return verticalLayout; }
/** * Creates a new checkbox with a caption and a set initial state. * * @param caption * the caption of the checkbox * @param initialState * the initial state of the checkbox */ public CheckBox(String caption, boolean initialState) { this(caption); setValue(initialState); }
CheckBox cb = new CheckBox(); cb.setImmediate(true); cb.setDescription("Select in order to bulk replay.");
actionAutocloseCheckBox.setId(UIComponentIdProvider.REPOSITORY_ACTIONS_AUTOCLOSE_CHECKBOX); actionAutocloseCheckBox.setValue(actionAutocloseConfigurationItem.isConfigEnabled()); actionAutocloseCheckBox.addValueChangeListener(this); actionAutocloseConfigurationItem.addChangeListener(this); gridLayout.addComponent(actionAutocloseCheckBox, 0, 0); actionAutocleanupCheckBox.setId(UIComponentIdProvider.REPOSITORY_ACTIONS_AUTOCLEANUP_CHECKBOX); actionAutocleanupCheckBox.setValue(actionAutocleanupConfigurationItem.isConfigEnabled()); actionAutocleanupCheckBox.addValueChangeListener(this); actionAutocleanupConfigurationItem.addChangeListener(this); gridLayout.addComponent(actionAutocleanupCheckBox, 0, 1);
private void initComponent() { roleNameLabel = new Label(queueRolePermission.getRoleName()); browsingAllowedCheckbox = new CheckBox(); browsingAllowedCheckbox.setCaption("browsing allowed"); browsingAllowedCheckbox.addListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { if (Boolean.TRUE.equals(queueRolePermission.isBrowsingAllowed())) { queueRolePermission.setBrowsingAllowed(false); } else { queueRolePermission.setBrowsingAllowed(true); // we handle null as well here } } }); if (Boolean.TRUE.equals(queueRolePermission.isBrowsingAllowed())) { browsingAllowedCheckbox.setValue(true); } deleteButton = new Button(); deleteButton.setCaption(" X "); deleteButton.setStyleName(BaseTheme.BUTTON_LINK); deleteButton.addListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { handler.removeQueueRolePermissionBox(QueueRolePermissionBox.this); } }); }
final CheckBox button = new CheckBox(); button.setData(property.getValue()); button.setValue(isSelected((Integer) property.getValue())); button.addValueChangeListener(new ValueChangeListener() {
m_maximizeWidth = new CheckBox(); m_maximizeWidth.setCaption("Maximize width"); m_maximizeWidth.setDescription("Maximize width"); m_maximizeHeight = new CheckBox(); m_maximizeHeight.setCaption("Maximize height"); m_maximizeHeight.setDescription("Maximize height"); boolean maximizeWidth = ("true".equals(maximizeWidthString) || "yes".equals(maximizeWidthString) || "1".equals(maximizeWidthString)); m_maximizeWidth.setValue(maximizeWidth); m_maximizeHeight.setValue(maximizeHeight);
@Override public Field getPropertyField(FormProperty formProperty) { CheckBox checkBox = new CheckBox(getPropertyLabel(formProperty)); checkBox.setRequired(formProperty.isRequired()); checkBox.setEnabled(formProperty.isWritable()); if (formProperty.getValue() != null) { Boolean value = new Boolean(Boolean.parseBoolean(formProperty.getValue())); checkBox.setValue(value); } return checkBox; }
root.addComponent(nameField); autoSaveField = new CheckBox(); autoSaveField.setCaption(messages.getMainMessage("PresentationsEditor.autoSave")); autoSaveField.setValue(BooleanUtils.isTrue(presentation.getAutoSave())); root.addComponent(autoSaveField); defaultField = new CheckBox(); defaultField.setCaption(messages.getMainMessage("PresentationsEditor.default")); defaultField.setValue(presentation.getId().equals(component.getDefaultPresentationId())); root.addComponent(defaultField); globalField = new CheckBox(); globalField.setCaption(messages.getMainMessage("PresentationsEditor.global")); globalField.setValue(!isNew && presentation.getUser() == null); root.addComponent(globalField);
private CheckBox initializeCheckbox(String messageKey, String debugId, String dataSourceProp, VerticalLayout parentC) { CheckBox cb = new CheckBox(I18N.getMessage(messageKey)); cb.setDebugId(createDebugId(debugId)); cb.setImmediate(true); //model.setSuunnitellut(true); cb.setPropertyDataSource(new NestedMethodProperty(model, dataSourceProp)); cb.addListener(new Property.ValueChangeListener() { @Override public void valueChange(ValueChangeEvent event) { //DEBUGSAWAY:log.debug("checkbox was clicked!!!"); tree.reloadWithSearchData(model); } }); parentC.addComponent(cb); return cb; }