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


Java ComboBox.setNullSelectionAllowed方法代碼示例

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


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

示例1: getPolicyComboBox

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private ComboBox getPolicyComboBox(List<PolicyDto> policyDtoList) {
	ComboBox policy = new ComboBox("Select Policy");
	policy.setTextInputAllowed(false);
	policy.setNullSelectionAllowed(false);
	policy.setImmediate(true);
	policy.setRequired(true);
	policy.setRequiredError("Policy cannot be empty");

	BeanItemContainer<PolicyDto> policyListContainer = new BeanItemContainer<>(PolicyDto.class,
			policyDtoList);
	policy.setContainerDataSource(policyListContainer);
	policy.setItemCaptionPropertyId("policyName");

	if (policyListContainer.size() > 0) {
		policy.select(policyListContainer.getIdByIndex(0));
	}

	policy.setEnabled(false);

	return policy;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:22,代碼來源:BindSecurityGroupWindow.java

示例2: createDomainComboBox

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private ComboBox createDomainComboBox(List<DomainDto> dl) {
    ComboBox domainComboBox = new ComboBox();
    BeanItemContainer<DomainDto> domainContainer = new BeanItemContainer<DomainDto>(DomainDto.class, dl);
    ApplianceManagerConnectorDto mc = (ApplianceManagerConnectorDto) this.managerConnector.getValue();

    domainComboBox.setContainerDataSource(domainContainer);
    domainComboBox.setTextInputAllowed(false);
    domainComboBox.setNullSelectionAllowed(false);
    domainComboBox.setItemCaptionPropertyId("name");
    domainComboBox.setEnabled(mc.isPolicyMappingSupported());

    if (domainComboBox.getItemIds().size() > 0) {
        domainComboBox.select(domainContainer.getIdByIndex(0));
    }
    return domainComboBox;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:17,代碼來源:BaseDAWindow.java

示例3: createEncapsulationTypeComboBox

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private ComboBox createEncapsulationTypeComboBox(VirtualizationType virtualizationType,
        List<TagEncapsulationType> types) {
    ComboBox encapsulationType = new ComboBox();
    encapsulationType.setTextInputAllowed(false);
    encapsulationType.setNullSelectionAllowed(true);

    BeanItemContainer<TagEncapsulationType> encapsulationTypeContainer = new BeanItemContainer<TagEncapsulationType>(
            TagEncapsulationType.class, types);
    encapsulationType.setContainerDataSource(encapsulationTypeContainer);
    ApplianceManagerConnectorDto currentMc = (ApplianceManagerConnectorDto) this.managerConnector.getValue();

    if (!virtualizationType.isOpenstack() || (currentMc != null && !currentMc.isPolicyMappingSupported())) {
        encapsulationType.setEnabled(false);
    }
    return encapsulationType;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:17,代碼來源:BaseDAWindow.java

示例4: WebSearchPickerField

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
public WebSearchPickerField() {
    final ComboBox selectComponent = component;
    WebPickerField.Picker picker = new WebPickerField.Picker(this, component) {
        @Override
        public void setRequired(boolean required) {
            super.setRequired(required);
            selectComponent.setNullSelectionAllowed(!required);
        }
    };
    pickerField = new WebPickerField(picker);

    Messages messages = AppBeans.get(Messages.class);
    setInputPrompt(messages.getMainMessage("searchPickerField.inputPrompt"));

    // Required for custom components in fieldgroup
    initValueSync(selectComponent, picker);
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:18,代碼來源:WebSearchPickerField.java

示例5: getLogLevelComponent

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
protected ComboBox getLogLevelComponent() {
    final ComboBox combo = new ComboBox("Log Level");
    combo.setNullSelectionAllowed(false);
    combo.setWidth(200, Unit.PIXELS);
    LogLevel[] levels = LogLevel.values();
    for (LogLevel logLevel : levels) {
        combo.addItem(logLevel.name());
    }
    combo.setValue(agentDeployment.getLogLevel());
    combo.addValueChangeListener(new ValueChangeListener() {
        public void valueChange(ValueChangeEvent event) {
            agentDeployment.setLogLevel((String) combo.getValue());
            saveAgentDeployment(agentDeployment);
        }
    });
    return combo;
}
 
開發者ID:JumpMind,項目名稱:metl,代碼行數:18,代碼來源:EditAgentDeploymentPanel.java

示例6: attach

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
@Override
public void attach() {
    setHeight(TAB_HEIGHT);
    setMargin(false, true, false, true);
    setSpacing(false);

    // サーバサイズ
    sizeSelect = new ComboBox(ViewProperties.getCaption("field.serverSize"));
    sizeSelect.setNullSelectionAllowed(false);
    form.getLayout().addComponent(sizeSelect);

    // キーペア
    keySelect = new ComboBox(ViewProperties.getCaption("field.keyPair"));
    keySelect.setNullSelectionAllowed(false);
    form.getLayout().addComponent(keySelect);

    addComponent(form);
}
 
開發者ID:primecloud-controller-org,項目名稱:primecloud-controller,代碼行數:19,代碼來源:WinServerEdit.java

示例7: attach

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
@Override
public void attach() {
    // サーバ名(Prefix)
    prefixField = new TextField(ViewProperties.getCaption("field.serverNamePrefix"));
    getLayout().addComponent(prefixField);

    // プラットフォーム
    cloudTable = new SelectCloudTable();
    getLayout().addComponent(cloudTable);

    // サーバ台數
    serverNumber = new ComboBox(ViewProperties.getCaption("field.serverNumber"));
    serverNumber.setWidth("110px");
    serverNumber.setMultiSelect(false);
    for (int i = 1; i <= MAX_ADD_SERVER; i++) {
        serverNumber.addItem(i);
    }
    serverNumber.setNullSelectionAllowed(false);
    serverNumber.setValue(1); // 初期値は1
    getLayout().addComponent(serverNumber);

    initValidation();
}
 
開發者ID:primecloud-controller-org,項目名稱:primecloud-controller,代碼行數:24,代碼來源:WinServerAddSimple.java

示例8: initComponents

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
/**
 * Setup UI.
 */
private void initComponents() {
	List<User> users = UserList.INSTANCE.getUsers();
	userSwitchBox = new ComboBox(Messages.getString("UserSwitchPanel.boxCaption")); //$NON-NLS-1$
	setUsers(users);
	User current = (User) VaadinSession.getCurrent().getAttribute(SessionStorageKey.USER.name());
	userSwitchBox.setValue(current);
	
	userSwitchBox.setDescription(
		Messages.getString("UserSwitchPanel.boxDescription")); //$NON-NLS-1$
	userSwitchBox.setNewItemsAllowed(false);
	userSwitchBox.setNullSelectionAllowed(false);
	
	addComponent(userSwitchBox);
	btReload = new Button(Messages.getString("UserSwitchPanel.reloadCaption")); //$NON-NLS-1$
	btReload.setStyleName(BaseTheme.BUTTON_LINK);
	btReload.addStyleName("plain-link"); //$NON-NLS-1$
	
	addComponent(btReload);
}
 
開發者ID:ADHO,項目名稱:dhconvalidator,代碼行數:23,代碼來源:UserSwitchPanel.java

示例9: DateSelectionField

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
public DateSelectionField() {
    cboMonth = new ComboBox();
    cboMonth.setNullSelectionAllowed(true);
    cboMonth.setPageLength(12);
    cboMonth.setImmediate(true);

    addMonthItems();
    cboMonth.setWidth("117px");

    cboDate = new ComboBox();
    cboDate.setNullSelectionAllowed(true);
    cboDate.setImmediate(true);

    addDayItems();
    cboDate.setWidth("80px");

    cboYear = new ComboBox();
    cboYear.setNullSelectionAllowed(true);
    cboYear.setImmediate(true);

    addYearItems();
    cboYear.setWidth("80px");
}
 
開發者ID:MyCollab,項目名稱:mycollab,代碼行數:24,代碼來源:DateSelectionField.java

示例10: createLanguageSelector

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private ComboBox createLanguageSelector() {
    ComboBox languageSelector = new ComboBox("com.vaadin.demo.dashboard.DashboardUI.Language");
    languageSelector.setImmediate(true);
    languageSelector.setNullSelectionAllowed(false);
    addLocale(Locale.ENGLISH, languageSelector);
    addLocale(Locale.FRENCH, languageSelector);
    addLocale(new Locale("es"), languageSelector);
    // languageSelector.setValue(I18NStaticService.getI18NServive().getLocale());
    /*-languageSelector.addValueChangeListener(new ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            Locale locale = (Locale) (event.getProperty().getValue());
            I18NStaticService.getI18NServive().setLocale(locale);
            getUI().requestRepaintAll();
        }
    });*/
    return languageSelector;
}
 
開發者ID:antoniomaria,項目名稱:gazpachoquest,代碼行數:22,代碼來源:OldLoginView.java

示例11: buildSelection

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private void buildSelection() {
	exportSelectionType = new ComboBox();
	exportSelectionType.setTextInputAllowed(false);
	exportSelectionType.setNullSelectionAllowed(false);
	exportSelectionType.setEnabled(false);

	exportSelectionType.addItem(Messages.getString("Caption.Item.Selected"));
	exportSelectionType.addItem(Messages.getString("Caption.Item.All"));
	exportSelectionType.select(Messages.getString("Caption.Item.Selected"));

	exportSelectionType.addValueChangeListener(new Property.ValueChangeListener() {
		public void valueChange(ValueChangeEvent event) {
			allTestsSelected = exportSelectionType.getValue().equals(Messages.getString("Caption.Item.All"));
			mainEvent.fire(new MainUIEvent.PackSelectionChangedEvent());
		}
	});
}
 
開發者ID:tilioteo,項目名稱:hypothesis,代碼行數:18,代碼來源:ExportScorePresenterImpl.java

示例12: buildSelection

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
@Override
protected ComboBox buildSelection() {
	final ComboBox selectionType = new ComboBox();
	selectionType.setTextInputAllowed(false);
	selectionType.setNullSelectionAllowed(false);

	selectionType.addItem(Messages.getString("Caption.Item.Selected"));
	selectionType.addItem(Messages.getString("Caption.Item.All"));
	selectionType.select(Messages.getString("Caption.Item.Selected"));

	selectionType.addValueChangeListener(e -> {
		allSelected = selectionType.getValue().equals(Messages.getString("Caption.Item.All"));
		mainEvent.fire(new MainUIEvent.UserSelectionChangedEvent());
	});

	return selectionType;
}
 
開發者ID:tilioteo,項目名稱:hypothesis,代碼行數:18,代碼來源:UserManagementPresenterImpl.java

示例13: bindEnumField

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
public ComboBox bindEnumField(ComboBox comboBox, AbstractLayout form, ValidatingFieldGroup<E> group,
		String fieldLabel, String fieldName, Class<?> clazz)
{
	ComboBox field = comboBox;
	field.setCaption(fieldLabel);
	field.setContainerDataSource(createContainerFromEnumClass(fieldName, clazz));
	field.setItemCaptionPropertyId(fieldName);
	// field.setCaption(fieldLabel);
	field.setNewItemsAllowed(false);
	field.setNullSelectionAllowed(false);
	field.setTextInputAllowed(true);
	field.setWidth(STANDARD_COMBO_WIDTH);
	field.setPopupWidth("100%");

	field.setImmediate(true);
	field.setId(fieldLabel.replace(" ", ""));
	addValueChangeListeners(field);
	doBinding(group, fieldName, field);

	form.addComponent(field);
	return field;
}
 
開發者ID:rlsutton1,項目名稱:VaadinUtils,代碼行數:23,代碼來源:FormHelper.java

示例14: getFailurePolicyComboBox

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
private ComboBox getFailurePolicyComboBox() {
	ComboBox failurePolicy = new ComboBox("Select Failure Policy");
	failurePolicy.setTextInputAllowed(false);
	failurePolicy.setNullSelectionAllowed(false);
	failurePolicy.setImmediate(true);
	failurePolicy.setRequired(true);
	failurePolicy.setRequiredError("Failure Policy cannot be empty");

	failurePolicy.addItems(FailurePolicyType.FAIL_OPEN, FailurePolicyType.FAIL_CLOSE);
	failurePolicy.select(FailurePolicyType.FAIL_OPEN);
	failurePolicy.setEnabled(false);

	return failurePolicy;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:15,代碼來源:BindSecurityGroupWindow.java

示例15: createComponent

import com.vaadin.ui.ComboBox; //導入方法依賴的package包/類
@Override
protected void createComponent() {
    super.createComponent();

    // delegate error indication
    this.componentErrorHandler = message -> {
        if (message instanceof UserError) {
            return false;
        }

        pickerField.component.setComponentError(message);
        return true;
    };

    component.setCustomValueEquals(InstanceUtils::propertyValueEquals);

    final ComboBox selectComponent = component;
    final WebPickerField.Picker picker = new WebPickerField.Picker(this, component) {
        @Override
        public void setRequired(boolean required) {
            super.setRequired(required);
            selectComponent.setNullSelectionAllowed(!required);
        }
    };
    pickerField = new WebPickerField(picker);

    // Required for custom components in fieldgroup
    initValueSync(selectComponent, picker);
}
 
開發者ID:cuba-platform,項目名稱:cuba,代碼行數:30,代碼來源:WebLookupPickerField.java


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