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


Java CheckBox.setImmediate方法代碼示例

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


在下文中一共展示了CheckBox.setImmediate方法的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: 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

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

示例6: stopAllButtonClick

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
private void stopAllButtonClick(ClickEvent event) {
    // ダイアログの表示オプション
    HorizontalLayout optionLayout = new HorizontalLayout();
    final CheckBox checkBox = new CheckBox(ViewMessages.getMessage("IUI-000033"), false);
    checkBox.setImmediate(true);
    optionLayout.addComponent(checkBox);

    // 確認ダイアログを表示
    String message = ViewMessages.getMessage("IUI-000010");
    DialogConfirm dialog = new DialogConfirm(ViewProperties.getCaption("dialog.confirm"), message,
            Buttons.OKCancelConfirm, optionLayout);
    dialog.setCallback(new DialogConfirm.Callback() {
        @Override
        public void onDialogResult(Result result) {
            if (result != Result.OK) {
                return;
            }

            boolean stopInstance = (Boolean) checkBox.getValue();
            stopAll(stopInstance);
        }
    });
    getApplication().getMainWindow().addWindow(dialog);
}
 
開發者ID:primecloud-controller-org,項目名稱:primecloud-controller,代碼行數:25,代碼來源:ServiceButtonsTop.java

示例7: generateCell

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@Override
public Object generateCell(Table source, Object itemId, Object columnId) {

	CheckBox assignmentColumn = new CheckBox();
	assignmentColumn.setImmediate(true);
	
	final Application applicationItem = (Application) itemId;
	
	assignmentColumn.setValue(containsApp(applicationItem));

	assignmentColumn.addListener(new ValueChangeListener() {
		@Override
		public void valueChange(Property.ValueChangeEvent event) {
			boolean assignmentValue = (Boolean) event.getProperty().getValue();

			if (assignmentValue)
				user.getApplications().add(applicationItem);
			else 
				user.getApplications().remove(getApp(applicationItem));

		}

	});

	return assignmentColumn;
}
 
開發者ID:thingtrack,項目名稱:konekti,代碼行數:27,代碼來源:UserApplicationCollectionField.java

示例8: buildVerticalLayout_2

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private VerticalLayout buildVerticalLayout_2() {
	// common part: create layout
	verticalLayout_2 = new VerticalLayout();
	verticalLayout_2.setImmediate(false);
	verticalLayout_2.setWidth("-1px");
	verticalLayout_2.setHeight("-1px");
	verticalLayout_2.setMargin(true);
	verticalLayout_2.setSpacing(true);
	
	// textFieldIssuer
	textFieldIssuer = new TextField();
	textFieldIssuer.setCaption("Issuer");
	textFieldIssuer.setImmediate(false);
	textFieldIssuer.setWidth("-1px");
	textFieldIssuer.setHeight("-1px");
	verticalLayout_2.addComponent(textFieldIssuer);
	
	// checkBoxMustBePresent
	checkBoxMustBePresent = new CheckBox();
	checkBoxMustBePresent.setCaption("Attribute Must Be Present");
	checkBoxMustBePresent.setImmediate(false);
	checkBoxMustBePresent.setWidth("-1px");
	checkBoxMustBePresent.setHeight("-1px");
	verticalLayout_2.addComponent(checkBoxMustBePresent);
	
	return verticalLayout_2;
}
 
開發者ID:apache,項目名稱:incubator-openaz,代碼行數:29,代碼來源:AttributeSelectionWindow.java

示例9: getCheckBox

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
/**
 * @param caption
 * @param propertyID
 * @return
 */
private Component getCheckBox(String caption, String propertyID) {
	CheckBox checkBox = new CheckBox(caption);
	checkBox.setImmediate(true);
	fieldGroup.bind(checkBox, propertyID);
	checkBox.setValidationVisible(false);
	return checkBox;
}
 
開發者ID:KrishnaPhani,項目名稱:KrishnasSpace,代碼行數:13,代碼來源:BasicFormImpl.java

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

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

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

示例13: addShowPopulatedFilter

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
protected void addShowPopulatedFilter(String propertyId, HeaderRow filterRow) {
    HeaderCell cell = filterRow.getCell(propertyId);
    CheckBox group = new CheckBox("Show Set Only");
    group.setImmediate(true);
    group.addValueChangeListener(l->{
        container.removeContainerFilters(propertyId);
        if (group.getValue()) {
            container.addContainerFilter(new And(new Not(new Compare.Equal(propertyId,"")), new Not(new IsNull(propertyId))));
        }
    });
    group.addStyleName(ValoTheme.CHECKBOX_SMALL);
    cell.setComponent(group);
    
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:15,代碼來源:EditExcelReaderPanel.java

示例14: buildHorizontalLayout_1

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
    // common part: create layout
    horizontalLayout_1 = new HorizontalLayout();
    horizontalLayout_1.setImmediate(false);
    horizontalLayout_1.setWidth("-1px");
    horizontalLayout_1.setHeight("-1px");
    horizontalLayout_1.setMargin(false);
    horizontalLayout_1.setSpacing(true);

    // followCheckbox
    followCheckbox = new CheckBox();
    followCheckbox.setCaption("Follow");
    followCheckbox.setImmediate(false);
    followCheckbox.setWidth("-1px");
    followCheckbox.setHeight("-1px");
    horizontalLayout_1.addComponent(followCheckbox);

    // startFromLastCheckbox
    startFromLastCheckbox = new CheckBox();
    startFromLastCheckbox.setCaption("Start from last transaction");
    startFromLastCheckbox.setImmediate(false);
    startFromLastCheckbox.setWidth("-1px");
    startFromLastCheckbox.setHeight("-1px");
    horizontalLayout_1.addComponent(startFromLastCheckbox);

    return horizontalLayout_1;
}
 
開發者ID:alenca,項目名稱:zklogtool,代碼行數:29,代碼來源:OpenTransactionLogFileDialog.java

示例15: buildHorizontalLayout_1

import com.vaadin.ui.CheckBox; //導入方法依賴的package包/類
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("100.0%");
	horizontalLayout_1.setHeight("-1px");
	horizontalLayout_1.setMargin(false);
	
	// logoField
	logoField = new Embedded();
	logoField.setCaption("Logo");
	logoField.setImmediate(false);
	logoField.setWidth("70px");
	logoField.setHeight("60px");
	logoField
			.setSource(new ThemeResource("img/component/embedded_icon.png"));
	logoField.setType(1);
	logoField.setMimeType("image/png");
	horizontalLayout_1.addComponent(logoField);
	
	// activeField
	activeField = new CheckBox();
	activeField.setCaption("Activo");
	activeField.setImmediate(false);
	activeField.setWidth("-1px");
	activeField.setHeight("-1px");
	activeField.setRequired(true);
	horizontalLayout_1.addComponent(activeField);
	horizontalLayout_1
			.setComponentAlignment(activeField, new Alignment(34));
	
	return horizontalLayout_1;
}
 
開發者ID:thingtrack,項目名稱:konekti,代碼行數:35,代碼來源:CalendarViewForm.java


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