当前位置: 首页>>代码示例>>Java>>正文


Java OptionGroup类代码示例

本文整理汇总了Java中com.vaadin.ui.OptionGroup的典型用法代码示例。如果您正苦于以下问题:Java OptionGroup类的具体用法?Java OptionGroup怎么用?Java OptionGroup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OptionGroup类属于com.vaadin.ui包,在下文中一共展示了OptionGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getUserOptions

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
@SuppressWarnings("serial")
protected OptionGroup getUserOptions() {
    this.userOption = new OptionGroup("Selection Criterion:");
    this.userOption.addItem(NONE);
    this.userOption.addItem(AVAILABILITY_ZONES);
    this.userOption.addItem(HOST_AGGREGATES);
    this.userOption.addItem(HOSTS);
    this.userOption.select(NONE);
    this.userOption.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            populateOptionTable();
        }
    });

    return this.userOption;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:18,代码来源:BaseDeploymentSpecWindow.java

示例2: createFrequencyOptionGroup

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
private OptionGroup createFrequencyOptionGroup() {

        this.freqOpt = new OptionGroup();
        this.freqOpt.addItem(this.ID_FREQ_OPT_WEEKLY);
        this.freqOpt.setItemCaption(this.ID_FREQ_OPT_WEEKLY, this.TEXT_FREQ_OPT_WEEKLY);
        this.freqOpt.addItem(this.ID_FREQ_OPT_MONTHLY);
        this.freqOpt.setItemCaption(this.ID_FREQ_OPT_MONTHLY, this.TEXT_FREQ_OPT_MONTHLY);
        this.freqOpt.addStyleName(this.ARCHIVE_STYLE);
        this.freqOpt.setImmediate(true);

        if (this.dto == null) {
            this.freqOpt.select(this.ID_FREQ_OPT_MONTHLY);
        } else {
            this.freqOpt.select(this.dto.getFrequency());
        }

        return this.freqOpt;
    }
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:19,代码来源:JobsArchiverPanel.java

示例3: createThresholdOptionGroup

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
private OptionGroup createThresholdOptionGroup() {

        this.thresOpt = new OptionGroup();
        this.thresOpt.addItem(this.ID_THRES_OPT_MONTHS);
        this.thresOpt.setItemCaption(this.ID_THRES_OPT_MONTHS, this.TEXT_THRES_OPT_MONTHS);
        this.thresOpt.addItem(this.ID_THRES_OPT_YEARS);
        this.thresOpt.setItemCaption(this.ID_THRES_OPT_YEARS, this.TEXT_THRES_OPT_YEARS);

        this.thresOpt.addStyleName(this.ARCHIVE_STYLE);
        this.thresOpt.setImmediate(true);

        if (this.dto == null) {
            this.thresOpt.select(this.ID_THRES_OPT_MONTHS);
        } else {
            this.thresOpt.select(this.dto.getThresholdUnit());
        }

        return this.thresOpt;
    }
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:20,代码来源:JobsArchiverPanel.java

示例4: createOptionGroup

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
@SuppressWarnings("serial")
private OptionGroup createOptionGroup() {
    this.mode = new OptionGroup();
    this.mode.addItem("DHCP");
    this.mode.addItem("Static");
    this.mode.addStyleName("network-options");
    this.mode.setImmediate(true);
    this.mode.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            if (NetworkLayout.this.mode.getValue().equals("DHCP")) {
                NetworkLayout.this.editIPSettings.setEnabled(false);
                populateNetworkTable();
                NetworkLayout.this.mode.setEnabled(true);
            }
            if (NetworkLayout.this.mode.getValue().equals("Static")) {
                NetworkLayout.this.editIPSettings.setEnabled(true);
                NetworkLayout.this.mode.setEnabled(false);
            }

        }
    });
    return this.mode;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:25,代码来源:NetworkLayout.java

示例5: getType

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
@SuppressWarnings("serial")
private Component getType() {
    this.protectionTypeOption = new OptionGroup("Selection Type:");
    this.protectionTypeOption.addItem(TYPE_ALL);
    this.protectionTypeOption.addItem(TYPE_SELECTION);
    this.protectionTypeOption.select(TYPE_ALL);
    this.protectionTypeOption.addValueChangeListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            if (BaseSecurityGroupWindow.this.protectionTypeOption.getValue() == TYPE_ALL) {
                enableSelection(false);
            } else if (BaseSecurityGroupWindow.this.protectionTypeOption.getValue() == TYPE_SELECTION) {
                enableSelection(true);
            }
            // Populate to list first and then the from list since we use the 'to' list items to exclude them from
            // the 'from' list
            populateToList();
            populateFromList();
        }
    });

    return this.protectionTypeOption;
}
 
开发者ID:opensecuritycontroller,项目名称:osc-core,代码行数:24,代码来源:BaseSecurityGroupWindow.java

示例6: createProtocolGroup

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
private void createProtocolGroup() {

        this.protocolGroup = new OptionGroup("Simulated Device Protocol");
        protocolGroup.addItem(Protocol.DMF_AMQP);
        protocolGroup.addItem(Protocol.DDI_HTTP);
        protocolGroup.select(Protocol.DMF_AMQP);
        protocolGroup.setItemCaption(Protocol.DMF_AMQP, "Device Management Federation API (AMQP push)");
        protocolGroup.setItemCaption(Protocol.DDI_HTTP, "Direct Device Interface (HTTP poll)");
        protocolGroup.setNullSelectionAllowed(false);
        protocolGroup.addValueChangeListener(event -> {
            final boolean directDeviceOptionSelected = event.getProperty().getValue().equals(Protocol.DDI_HTTP);
            pollUrlTextField.setVisible(directDeviceOptionSelected);
            gatewayTokenTextField.setVisible(directDeviceOptionSelected);
        });
        protocolGroup.setItemEnabled(Protocol.DMF_AMQP, dmfEnabled);
        if (!dmfEnabled) {
            protocolGroup.select(Protocol.DDI_HTTP);
        }
    }
 
开发者ID:eclipse,项目名称:hawkbit-examples,代码行数:20,代码来源:GenerateDialog.java

示例7: buildHorizontalLayout_1

import com.vaadin.ui.OptionGroup; //导入依赖的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);
	
	// optionGroupAttribute
	optionGroupAttribute = new OptionGroup();
	optionGroupAttribute.setCaption("Attribute Source");
	optionGroupAttribute.setImmediate(false);
	optionGroupAttribute.setWidth("-1px");
	optionGroupAttribute.setHeight("-1px");
	optionGroupAttribute.setInvalidAllowed(false);
	horizontalLayout_1.addComponent(optionGroupAttribute);
	
	// verticalLayout_2
	verticalLayout_2 = buildVerticalLayout_2();
	horizontalLayout_1.addComponent(verticalLayout_2);
	
	return horizontalLayout_1;
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:25,代码来源:AttributeSelectionWindow.java

示例8: createOptionGroup

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
/**
 * create option group with Create tag/Update tag based on permissions.
 */
protected void createOptionGroup(final boolean hasCreatePermission, final boolean hasUpdatePermission) {

    optiongroup = new OptionGroup("Select Action");
    optiongroup.setId(UIComponentIdProvider.OPTION_GROUP);
    optiongroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    optiongroup.addStyleName("custom-option-group");
    optiongroup.setNullSelectionAllowed(false);

    if (hasCreatePermission) {
        optiongroup.addItem(createTagStr);
    }
    if (hasUpdatePermission) {
        optiongroup.addItem(updateTagStr);
    }

    setOptionGroupDefaultValue(hasCreatePermission, hasUpdatePermission);
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:21,代码来源:AbstractCreateUpdateTagLayout.java

示例9: save

import com.vaadin.ui.OptionGroup; //导入依赖的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

示例10: buildPossibleTargetVersions

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected Panel buildPossibleTargetVersions(ProjectVersion targetProjectVersion) {

    Panel possibleTargetVersionsPanel = new Panel("Available Target Versions");        
    possibleTargetVersionsPanel.addStyleName(ValoTheme.PANEL_SCROLL_INDICATOR);
    possibleTargetVersionsPanel.setSizeFull();

    IndexedContainer container = new IndexedContainer();
    optionGroup = new OptionGroup("Project Version", container);
    optionGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
    optionGroup.setItemCaptionMode(ItemCaptionMode.PROPERTY);
    optionGroup.setItemCaptionPropertyId("versionLabel");
    optionGroup.addStyleName("indent");

    List<ProjectVersion> projectVersions = configService.findProjectVersionsByProject(targetProjectVersion.getProject());        
    container.addContainerProperty("versionLabel", String.class, null); 
    for (ProjectVersion version : projectVersions) {
        Item item = container.addItem(version.getId());
        item.getItemProperty("versionLabel").setValue(version.getVersionLabel()); 
        if (targetProjectVersion.getId().equalsIgnoreCase(version.getId())) {
            optionGroup.setItemEnabled(version.getId(), false);
        }
    }
    possibleTargetVersionsPanel.setContent(optionGroup);
    return possibleTargetVersionsPanel;
}
 
开发者ID:JumpMind,项目名称:metl,代码行数:27,代码来源:ChangeDependencyVersionDialog.java

示例11: buildDialogLayout

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
@Override
protected void buildDialogLayout() {
    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);

    optMessageType = new OptionGroup(ctx.tr("rdfvalidation.dialog.optMessageType.caption"));
    optMessageType.addItem(DPUContext.MessageType.ERROR);
    optMessageType.addItem(DPUContext.MessageType.WARNING);
    optMessageType.setValue(optMessageType.getItem(0));
    mainLayout.addComponent(optMessageType);

    txtAskQuery = new TextArea(ctx.tr("rdfvalidation.dialog.txtAskQuery.caption"));
    txtAskQuery.setSizeFull();
    txtAskQuery.setNullRepresentation("");
    txtAskQuery.setNullSettingAllowed(true);
    mainLayout.addComponent(txtAskQuery);
    mainLayout.setExpandRatio(txtAskQuery, 1.0f);

    setCompositionRoot(mainLayout);
}
 
开发者ID:UnifiedViews,项目名称:Plugins,代码行数:23,代码来源:SparqlAskVaadinDialog.java

示例12: SystemDefChoiceField

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
/**
 * Instantiates a new system definition choice field.
 */
public SystemDefChoiceField() {
    oidType = new OptionGroup("OID Type", OPTIONS);
    oidType.setNullSelectionAllowed(false);
    oidType.select("Single");

    oidValue = new TextField("OID Value");
    oidValue.setWidth("100%");
    oidValue.setNullSettingAllowed(false);
    oidValue.setRequired(true);
    oidValue.setImmediate(true);
    oidValue.addValidator(new RegexpValidator("^\\.[.\\d]+$", "Invalid OID {0}"));

    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);
    layout.setWidth("100%");
    layout.addComponent(oidType);
    layout.addComponent(oidValue);
    layout.setExpandRatio(oidValue, 1);

    setWriteThrough(false);
    setCompositionRoot(layout);
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:26,代码来源:SystemDefChoiceField.java

示例13: buildMainLayout

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// optionGroupExpression
	optionGroupExpression = new OptionGroup();
	optionGroupExpression
			.setCaption("Select One Of The Following Types of Expressions");
	optionGroupExpression.setImmediate(false);
	optionGroupExpression.setWidth("-1px");
	optionGroupExpression.setHeight("-1px");
	mainLayout.addComponent(optionGroupExpression);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Select");
	buttonSave.setImmediate(false);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(24));
	
	return mainLayout;
}
 
开发者ID:apache,项目名称:incubator-openaz,代码行数:35,代码来源:ExpressionSelectionWindow.java

示例14: createErrorThresholdOptionGroup

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
private OptionGroup createErrorThresholdOptionGroup() {
    final OptionGroup errorThresoldOptions = new OptionGroup();
    for (final ERRORTHRESOLDOPTIONS option : ERRORTHRESOLDOPTIONS.values()) {
        errorThresoldOptions.addItem(option.getValue());
    }
    errorThresoldOptions.setId(UIComponentIdProvider.ROLLOUT_ERROR_THRESOLD_OPTION_ID);
    errorThresoldOptions.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    errorThresoldOptions.addStyleName(SPUIStyleDefinitions.ROLLOUT_OPTION_GROUP);
    errorThresoldOptions.setSizeUndefined();
    errorThresoldOptions.addValueChangeListener(this::listenerOnErrorThresoldOptionChange);
    return errorThresoldOptions;
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:13,代码来源:AddUpdateRolloutWindowLayout.java

示例15: assignOptionGroupByValues

import com.vaadin.ui.OptionGroup; //导入依赖的package包/类
private void assignOptionGroupByValues(final List<String> tagOptions) {
    assignOptiongroup = new OptionGroup("", tagOptions);
    assignOptiongroup.setStyleName(ValoTheme.OPTIONGROUP_SMALL);
    assignOptiongroup.addStyleName("custom-option-group");
    assignOptiongroup.setNullSelectionAllowed(false);
    assignOptiongroup.setId(SPUIDefinitions.ASSIGN_OPTION_GROUP_SOFTWARE_MODULE_TYPE_ID);
    assignOptiongroup.select(tagOptions.get(0));
}
 
开发者ID:eclipse,项目名称:hawkbit,代码行数:9,代码来源:CreateUpdateSoftwareTypeLayout.java


注:本文中的com.vaadin.ui.OptionGroup类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。