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


Java CheckBox.addValueChangeListener方法代碼示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: ProjectOverdueTicketsWidget

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
public ProjectOverdueTicketsWidget() {
    super(String.format("%s (0)", UserUIContext.getMessage(TicketI18nEnum.VAL_OVERDUE_TICKETS)), new CssLayout());
    this.setWidth("100%");

    final CheckBox myItemsSelection = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
    myItemsSelection.addValueChangeListener(valueChangeEvent -> {
        boolean isMyItemsOption = myItemsSelection.getValue();
        if (isMyItemsOption) {
            searchCriteria.setAssignUser(StringSearchField.and(UserUIContext.getUsername()));
        } else {
            searchCriteria.setAssignUser(null);
        }
        updateSearchResult();
    });

    ticketList = new DefaultBeanPagedList(AppContextUtil.getSpringBean(ProjectTicketService.class),
            new TicketRowDisplayHandler(false), 10) {
        @Override
        protected String stringWhenEmptyList() {
            return UserUIContext.getMessage(ProjectI18nEnum.OPT_NO_OVERDUE_TICKET);
        }
    };
    this.addHeaderElement(myItemsSelection);
    bodyContent.addComponent(ticketList);
}
 
開發者ID:MyCollab,項目名稱:mycollab,代碼行數:26,代碼來源:ProjectOverdueTicketsWidget.java

示例5: 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

示例6: 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

示例7: ProjectUnresolvedTicketsWidget

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
public ProjectUnresolvedTicketsWidget() {
    super("", new CssLayout());
    this.setWidth("100%");
    final CheckBox myItemsSelection = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
    myItemsSelection.addValueChangeListener(valueChangeEvent -> {
        boolean isMyItemsOption = myItemsSelection.getValue();
        if (isMyItemsOption) {
            searchCriteria.setAssignUser(StringSearchField.and(UserUIContext.getUsername()));
        } else {
            searchCriteria.setAssignUser(null);
        }
        updateSearchResult();
    });
    taskList = new DefaultBeanPagedList(AppContextUtil.getSpringBean(ProjectTicketService.class),
            new TicketRowDisplayHandler(false), 10) {
        @Override
        protected String stringWhenEmptyList() {
            return UserUIContext.getMessage(ProjectI18nEnum.OPT_NO_TICKET);
        }
    };
    addHeaderElement(myItemsSelection);
    bodyContent.addComponent(taskList);
}
 
開發者ID:MyCollab,項目名稱:mycollab,代碼行數:24,代碼來源:ProjectUnresolvedTicketsWidget.java

示例8: UserUnresolvedTicketWidget

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
public UserUnresolvedTicketWidget() {
    super("", new CssLayout());
    this.setWidth("100%");
    final CheckBox myItemsSelection = new CheckBox(UserUIContext.getMessage(GenericI18Enum.OPT_MY_ITEMS));
    myItemsSelection.addValueChangeListener(valueChangeEvent -> {
        boolean isMyItemsOption = myItemsSelection.getValue();
        if (searchCriteria != null) {
            if (isMyItemsOption) {
                searchCriteria.setAssignUser(StringSearchField.and(UserUIContext.getUsername()));
            } else {
                searchCriteria.setAssignUser(null);
            }
            updateSearchResult();
        }
    });
    ticketList = new DefaultBeanPagedList<ProjectTicketService, ProjectTicketSearchCriteria, ProjectTicket>
            (AppContextUtil.getSpringBean(ProjectTicketService.class), new TicketRowDisplayHandler(true), 10) {
        @Override
        protected String stringWhenEmptyList() {
            return UserUIContext.getMessage(ProjectI18nEnum.OPT_NO_TICKET);
        }
    };
    this.addHeaderElement(myItemsSelection);
    this.bodyContent.addComponent(ticketList);
}
 
開發者ID:MyCollab,項目名稱:mycollab,代碼行數:26,代碼來源:UserUnresolvedTicketWidget.java

示例9: getPopupComponent

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@Override
public Component getPopupComponent() {
    final VerticalLayout layout = new VerticalLayout();
    layout.setSizeUndefined();
    layout.setMargin(true);

    final boolean isLegalEntity = getValue() != null && getValue() instanceof LegalEntity;
    final CheckBox isLegalEntityField = new CheckBox("Клиент Юр.лицо", isLegalEntity);
    isLegalEntityField.setDescription("Отметте флаг, если клиент является юр.лицом");
    isLegalEntityField.addValueChangeListener(event -> {
        final Boolean isLE = isLegalEntityField.getValue();
        if (getValue() != null)
            if (!isLE && getValue() instanceof LegalEntity
                    || isLE && getValue() instanceof Person)
                setValue(null);
        makePopup(layout, isLE);
    });
    layout.addComponent(isLegalEntityField);

    makePopup(layout, isLegalEntity);

    return layout;
}
 
開發者ID:ExtaSoft,項目名稱:extacrm,代碼行數:24,代碼來源:ClientField.java

示例10: generateCell

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@Override
public Object generateCell(Table source, final Object itemId, Object columnId) {
	Property<?> prop = source.getItem(itemId).getItemProperty(columnId);
	CheckBox checkBox = new CheckBox(null, prop);
	checkBox.addValueChangeListener(new ValueChangeListener() {

		@Override
		public void valueChange(ValueChangeEvent event) {
			serviceTableClicked((long) itemId);
		}
	});
	return checkBox;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:14,代碼來源:BindSecurityGroupWindow.java

示例11: createLinearStepperBox

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
private CheckBox createLinearStepperBox() {
  CheckBox checkBox = new CheckBox("Linear Stepper *");
  checkBox.setWidth(100, Unit.PERCENTAGE);
  checkBox.addValueChangeListener(event -> {
    createStepper();
    fireEvent(new StepperCreateEvent(StepperPropertiesLayout.this, stepper));
  });
  return checkBox;
}
 
開發者ID:Juchar,項目名稱:md-stepper,代碼行數:10,代碼來源:StepperPropertiesLayout.java

示例12: createTargetVisibleField

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

示例13: initSelectionMode

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
/**
 * Init selection mode
 */
private void initSelectionMode() {
	final CheckBox checkBox = new CheckBox("Multi Select");
	addComponent(checkBox);
	checkBox.setImmediate(true);
	checkBox.setValue(false);
	checkBox.addValueChangeListener(new ValueChangeListener() {

		/**
		 * 
		 */
		private static final long serialVersionUID = -1261311232228188664L;

		@Override
		public void valueChange(ValueChangeEvent event) {
			if (checkBox.getValue()) {
				grid.setSelectionMode(SelectionMode.MULTI);
				grid.recalculateColumnWidths();
				// Seems to be some bug in Vaadin Grid when expand ration is
				// not given the column shrinks and this is visible when
				// selection mode is single
				for (Column column : grid.getColumns()) {
					column.setExpandRatio(1);
				}
			} else {
				grid.setSelectionMode(SelectionMode.SINGLE);
			}
		}
	});
}
 
開發者ID:KrishnaPhani,項目名稱:KrishnasSpace,代碼行數:33,代碼來源:BasicGridView.java

示例14: createAttributeCheckBox

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
protected CheckBox createAttributeCheckBox(final AttributeSettings settings, final String key) {
    final CheckBox checkBox = new CheckBox();
    checkBox.setImmediate(true);
    if (settings.isPrimaryKey()) {
        checkBox.setEnabled(false);
    }
    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.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,代碼行數:28,代碼來源:EditDataDiffPanel.java

示例15: createAttributeCheckBox

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
protected CheckBox createAttributeCheckBox(final RecordFormat record, 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(record.getAttributeId(), key);

            String oldValue = setting == null ? Boolean.FALSE.toString() : setting.getValue();
            if (setting == null) {
                setting = new ComponentAttribSetting(record.getAttributeId(), component.getId(), key, Boolean.FALSE.toString());
                component.addAttributeSetting(setting);
            }
            setting.setValue(checkBox.getValue().toString());
            if (!oldValue.equals(setting.getValue())) {
                context.getConfigurationService().save(setting);   
                Set<RecordFormat> attributes = new HashSet<>();
                attributes.add(record);
                
                if (oldValue.equals(Boolean.FALSE.toString())) { 
                 moveItemsTo(attributes, getLastSortItemIndex(record.getEntityId(), record.getAttributeId(), true) + 1);
                } else {
                	moveItemsTo(attributes, getLastSortItemIndex(record.getEntityId(), record.getAttributeId(), false));
                }
            }

            calculatePositions();
            saveOrdinalSettings();
            saveSortSettings();
        }
    });
    return checkBox;
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:35,代碼來源:EditSorterPanel.java


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