當前位置: 首頁>>代碼示例>>Java>>正文


Java CheckBox類代碼示例

本文整理匯總了Java中com.vaadin.ui.CheckBox的典型用法代碼示例。如果您正苦於以下問題:Java CheckBox類的具體用法?Java CheckBox怎麽用?Java CheckBox使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


CheckBox類屬於com.vaadin.ui包,在下文中一共展示了CheckBox類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: valueChange

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
@Override
public void valueChange(final ValueChangeEvent event) {

    if (!(event.getProperty() instanceof CheckBox)) {
        return;
    }

    notifyConfigurationChanged();

    final CheckBox checkBox = (CheckBox) event.getProperty();
    BooleanConfigurationItem configurationItem;

    if (actionAutocloseCheckBox.equals(checkBox)) {
        configurationItem = actionAutocloseConfigurationItem;
    } else {
        return;
    }

    if (checkBox.getValue()) {
        configurationItem.configEnable();
    } else {
        configurationItem.configDisable();
    }
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:25,代碼來源:RepositoryConfigurationView.java

示例2: createAttributeCheckBox

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
protected CheckBox createAttributeCheckBox(final AttributeSettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    checkBox.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;
        @Override
        public void valueChange(ValueChangeEvent event) {
            ComponentAttribSetting setting = component.getSingleAttributeSetting(settings.getAttributeId(), key);

            String oldValue = setting == null ? Boolean.FALSE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentAttribSetting(settings.getAttributeId(), component.getId(), key, Boolean.TRUE.toString());
                component.addAttributeSetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);
            }
        }
    });
    checkBox.setReadOnly(readOnly);
    return checkBox;
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:24,代碼來源:EditDeduperPanel.java

示例3: createCheckBox

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
private CheckBox createCheckBox(final AttributeSettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    checkBox.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            ComponentAttribSetting setting = component.getSingleAttributeSetting(settings.getAttributeId(), key);

            String oldValue = setting == null ? Boolean.FALSE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentAttribSetting(settings.getAttributeId(), component.getId(), key, Boolean.TRUE.toString());
                component.addAttributeSetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);
            }
        }
    });
    checkBox.setReadOnly(readOnly);
    return checkBox;

}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:25,代碼來源:EditMergerPanel.java

示例4: buildAndBind

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
public Field<?> buildAndBind(Object propertyId) throws BindException {
	// If property is a Property, try to render Field using UIContext
	if (propertyId != null && Property.class.isAssignableFrom(propertyId.getClass())) {
		Field<?> field = renderField((P) propertyId).map((f) -> {
			setupField((P) propertyId, f);
			if (f instanceof CheckBox)
				f.setCaption(null);
			bind(f, propertyId);
			return f;
		}).orElse(null);
		if (field != null) {
			return field;
		}
	}
	return super.buildAndBind(propertyId);
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:19,代碼來源:DefaultItemListing.java

示例5: setup

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@BeforeClass
public static void setup() {
	binder.buildAndBind("flightId");

	form.airline = (TextField) binder.getFieldForProperty("flightId.airline").get();
	form.flightNumber = (TextField) binder.getFieldForProperty("flightId.flightNumber").get();
	form.flightSuffix = (TextField) binder.getFieldForProperty("flightId.flightSuffix").get();
	form.date = (DateField) binder.getFieldForProperty("flightId.date").get();
	form.legType = (AbstractSingleSelect<LegType>) binder.getFieldForProperty("flightId.legType").get();
	form.sbt = (DateTimeField) binder.getFieldForProperty("sbt").get();
	form.ebt = (DateTimeField) binder.getFieldForProperty("ebt").get();
	form.abt = (DateTimeField) binder.getFieldForProperty("abt").get();
	form.gate = (TextField) binder.getFieldForProperty("gate").get();
	form.canceled = (CheckBox) binder.getFieldForProperty("canceled").get();
}
 
開發者ID:ljessendk,項目名稱:easybinder,代碼行數:17,代碼來源:BuildAndBindTest.java

示例6: createCheckBox

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
@SuppressWarnings("serial")
private CheckBox createCheckBox() {
    this.checkbox = new CheckBox(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_INCLUDE_DB));
    this.checkbox.setImmediate(true);
    this.checkbox.setValue(false);
    this.checkbox.addValueChangeListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (SummaryLayout.this.checkbox.getValue()) {
                SummaryLayout.this.download
                        .setCaption(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_BUNDLE));
            } else {
                SummaryLayout.this.download
                        .setCaption(VmidcMessages.getString(VmidcMessages_.SUMMARY_DOWNLOAD_LOG));
            }
        }
    });
    return this.checkbox;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:21,代碼來源:SummaryLayout.java

示例7: createSensorList

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
private Component createSensorList() {
  VerticalLayout listLayout = new VerticalLayout();
  //listLayout.setWidth(25, Unit.PERCENTAGE);

  deviceSetupService.getSensorDtosGroupedByType().forEach((groupName, sensorDTOS) -> {
    VerticalLayout sensorList = new VerticalLayout();

    sensorDTOS.forEach(sensorDTO -> {
      CheckBox c = new CheckBox(sensorDTO.getName());

      c.addValueChangeListener(event -> {
        updateChart(sensorDTO.getType() + sensorDTO.getDevId(),
            (Boolean) event.getProperty().getValue());
      });

      sensorList.addComponent(c);
    });

    Panel typePanel = new Panel(groupName.substring(0, 1).toUpperCase() + groupName.substring(1));
    typePanel.setContent(sensorList);
    listLayout.addComponent(typePanel);
  });

  return listLayout;
}
 
開發者ID:daergoth,項目名稱:HomeWire-Server,代碼行數:26,代碼來源:StatisticView.java

示例8: initView

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
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;
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:18,代碼來源:DistributionSetSelectWindow.java

示例9: addTargetTableforUpdate

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private void addTargetTableforUpdate(final SoftwareModuleType swModuleType, final boolean mandatory) {

    if (selectedTableContainer == null) {
        return;
    }
    final Item saveTblitem = selectedTableContainer.addItem(swModuleType.getId());
    sourceTable.removeItem(swModuleType.getId());
    saveTblitem.getItemProperty(DIST_TYPE_NAME).setValue(swModuleType.getName());
    final CheckBox mandatoryCheckbox = new CheckBox("", mandatory);
    mandatoryCheckbox.setId(swModuleType.getName());
    saveTblitem.getItemProperty(DIST_TYPE_MANDATORY).setValue(mandatoryCheckbox);

    final Item originalItem = originalSelectedTableContainer.addItem(swModuleType.getId());
    originalItem.getItemProperty(DIST_TYPE_NAME).setValue(swModuleType.getName());
    originalItem.getItemProperty(DIST_TYPE_MANDATORY).setValue(mandatoryCheckbox);

    window.updateAllComponents(mandatoryCheckbox);
}
 
開發者ID:eclipse,項目名稱:hawkbit,代碼行數:20,代碼來源:CreateUpdateDistSetTypeLayout.java

示例10: save

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
protected void save() {
    if (isNotBlank(nameField.getValue()) && isNotBlank(versionLabelField.getValue())) {
        releasePackage.setName(nameField.getValue());
        releasePackage.setVersionLabel(versionLabelField.getValue());
        releasePackage.setReleaseDate(releaseDateField.getValue());
        configurationService.save(releasePackage);

        configurationService.deleteReleasePackageProjectVersionsForReleasePackage(releasePackage.getId());
        for (CheckBox projectCheckbox : projectCheckboxes) {
            if (projectCheckbox.getValue() == true) {
                String projectId = (String) projectCheckbox.getData();
                OptionGroup optionGroup = projectVersionOptionGroups.get(projectId);
                String projectVersionId = (String) optionGroup.getValue();
                Rppv rppv = new Rppv(releasePackage.getId(), projectVersionId);
                configurationService.save(rppv);
            }
        }

        listener.updated(releasePackage);
        close();
    }
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:23,代碼來源:EditReleasePackageDialog.java

示例11: createEntityCheckBox

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
protected CheckBox createEntityCheckBox(final EntitySettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    checkBox.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            ComponentEntitySetting setting = component.getSingleEntitySetting(settings.getEntityId(), key);

            String oldValue = setting == null ? Boolean.TRUE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentEntitySetting(settings.getEntityId(), component.getId(), key, Boolean.TRUE.toString());
                component.addEntitySetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);
            }
        }
    });
    checkBox.setReadOnly(readOnly);
    return checkBox;
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:25,代碼來源:EditDataDiffPanel.java

示例12: createCheckBox

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
private CheckBox createCheckBox(final AttributeSettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    if (!readOnly) {
        checkBox.addValueChangeListener((event) -> {
            ComponentAttribSetting setting = component.getSingleAttributeSetting(settings.getAttributeId(), key);

            String oldValue = setting == null ? Boolean.TRUE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentAttribSetting(settings.getAttributeId(), component.getId(), key, Boolean.TRUE.toString());
                component.addAttributeSetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);
            }
        });
    }
    checkBox.setReadOnly(readOnly);
    return checkBox;
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:22,代碼來源:EditRdbmsWriterPanel.java

示例13: buildDialogLayout

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
@Override
protected void buildDialogLayout() {
    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);

    checkPerGraph = new CheckBox(ctx.tr("sparqlUpdate.dialog.perGraph"));
    checkPerGraph.setWidth("100%");
    mainLayout.addComponent(checkPerGraph);
    mainLayout.setExpandRatio(checkPerGraph, 0.0f);

    txtQuery = new TextArea(ctx.tr("sparqlUpdate.dialog.query"));
    txtQuery.setSizeFull();
    txtQuery.setRequired(true);
    txtQuery.addValidator(createSparqlUpdateQueryValidator());
    txtQuery.setImmediate(true);
    mainLayout.addComponent(txtQuery);
    mainLayout.setExpandRatio(txtQuery, 1.0f);

    setCompositionRoot(mainLayout);
}
 
開發者ID:UnifiedViews,項目名稱:Plugins,代碼行數:23,代碼來源:SparqlUpdateVaadinDialog.java

示例14: buildDialogLayout

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
@Override
protected void buildDialogLayout() {

    final VerticalLayout layout = new VerticalLayout();
    layout.setWidth("100%");
    layout.setHeight("-1px");
    layout.setSpacing(true);
    layout.setMargin(true);

    txtPattern = new TextField(ctx.tr("renamer.dialog.regExp"));
    txtPattern.setWidth("100%");
    layout.addComponent(txtPattern);

    txtValue = new TextField(ctx.tr("renamer.dialog.replaceWith"));
    txtValue.setWidth("100%");
    layout.addComponent(txtValue);

    checkUseAdvanced = new CheckBox(ctx.tr("renamer.dialog.advancedMode"));
    checkUseAdvanced.setWidth("100%");
    checkUseAdvanced.setDescription(ctx.tr("renamer.dialog.advancedMode.desc"));
    layout.addComponent(checkUseAdvanced);

    setCompositionRoot(layout);
}
 
開發者ID:UnifiedViews,項目名稱:Plugins,代碼行數:25,代碼來源:RenamerVaadinDialog.java

示例15: buildDialogLayout

import com.vaadin.ui.CheckBox; //導入依賴的package包/類
@Override
protected void buildDialogLayout() {
    setSizeFull();

    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setImmediate(false);
    mainLayout.setWidth("100%");
    mainLayout.setHeight("-1px");
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);

    txtObject = new TextField(ctx.tr("filesFilter.dialog.value"));
    txtObject.setWidth("100%");
    txtObject.setRequired(true);
    mainLayout.addComponent(txtObject);

    checkUseRegExp = new CheckBox(ctx.tr("filesFilter.dialog.regexp"));
    checkUseRegExp.setDescription(ctx.tr("filesFilter.dialog.regexp.desc"));
    mainLayout.addComponent(checkUseRegExp);

    setCompositionRoot(mainLayout);
}
 
開發者ID:UnifiedViews,項目名稱:Plugins,代碼行數:23,代碼來源:FilesFilterVaadinDialog.java


注:本文中的com.vaadin.ui.CheckBox類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。