本文整理匯總了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();
}
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}