com.vaadin.ui.CheckBox类的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(10.4k)|赞(0)|评价(0)|浏览(109)

本文整理了Java中com.vaadin.ui.CheckBox类的一些代码示例,展示了CheckBox类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CheckBox类的具体详情如下:
包路径:com.vaadin.ui.CheckBox
类名称:CheckBox

CheckBox介绍

暂无

代码示例

代码示例来源:origin: nz.co.senanque/madura-vaadin

public AbstractField<?> getBooleanField(MaduraPropertyWrapper property) {
  return new CheckBox();
}
public AbstractField<?> getSelectField(MaduraPropertyWrapper property) {

代码示例来源:origin: org.aperteworkflow/gui-commons

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;
}

代码示例来源:origin: com.vaadin/vaadin-server

@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);
}

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * Creates a new checkbox.
 */
public CheckBox() {
  registerRpc(rpc);
  registerRpc(new FocusAndBlurServerRpcDecorator(this, this::fireEvent));
  setValue(Boolean.FALSE);
}

代码示例来源:origin: peholmst/vaadin4spring

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;
}

代码示例来源:origin: org.aperteworkflow/gui-commons

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);
}

代码示例来源:origin: eclipse/hawkbit

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;
}

代码示例来源:origin: org.opennms.features/vaadin-surveillance-views

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;
  }
}

代码示例来源:origin: eclipse/hawkbit

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;
}

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

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.");

代码示例来源:origin: eclipse/hawkbit

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;
}

代码示例来源:origin: com.vaadin/vaadin-server

/**
 * 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);
}

代码示例来源:origin: org.ikasan/ikasan-dashboard-jar

CheckBox cb = new CheckBox();
cb.setImmediate(true);
cb.setDescription("Select in order to bulk replay.");

代码示例来源:origin: org.eclipse.hawkbit/hawkbit-ui

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);

代码示例来源:origin: org.aperteworkflow/editor

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);
    }
  });
}

代码示例来源:origin: org.opennms.features.topology.plugins/org.opennms.features.topology.plugins.browsers

final CheckBox button = new CheckBox();
button.setData(property.getValue());
button.setValue(isSelected((Integer) property.getValue()));
button.addValueChangeListener(new ValueChangeListener() {

代码示例来源:origin: org.opennms.features.vaadin-dashlets/dashlet-charts

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);

代码示例来源:origin: org.activiti/activiti-explorer

@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;
}

代码示例来源:origin: com.haulmont.cuba/cuba-web

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);

代码示例来源:origin: fi.vm.sade.organisaatio/organisaatio-ui-widgets

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;
}

相关文章