Java 类com.vaadin.ui.OptionGroup 实例源码

项目:osc-core    文件:BaseDeploymentSpecWindow.java   
@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;
}
项目:osc-core    文件:JobsArchiverPanel.java   
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;
    }
项目:osc-core    文件:JobsArchiverPanel.java   
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;
    }
项目:osc-core    文件:NetworkLayout.java   
@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;
}
项目:osc-core    文件:BaseSecurityGroupWindow.java   
@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;
}
项目:hawkbit-examples    文件:GenerateDialog.java   
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);
        }
    }
项目:incubator-openaz    文件:AttributeSelectionWindow.java   
@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;
}
项目:hawkbit    文件:AbstractCreateUpdateTagLayout.java   
/**
 * 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);
}
项目:metl    文件:EditReleasePackageDialog.java   
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();
    }
}
项目:metl    文件:ChangeDependencyVersionDialog.java   
@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;
}
项目:Plugins    文件:SparqlAskVaadinDialog.java   
@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);
}
项目:XACML    文件:AttributeSelectionWindow.java   
@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;
}
项目:opennmszh    文件:SystemDefChoiceField.java   
/**
 * 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);
}
项目:incubator-openaz    文件:ExpressionSelectionWindow.java   
@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;
}
项目:hawkbit    文件:AddUpdateRolloutWindowLayout.java   
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;
}
项目:hawkbit    文件:CreateUpdateSoftwareTypeLayout.java   
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));
}
项目:metl    文件:EditReleasePackageDialog.java   
protected void projectSelectionListener(ValueChangeEvent event) {
    CheckBox checkbox = (CheckBox) event.getProperty();
    String projectId = (String) checkbox.getData();
    OptionGroup optionGroup = projectVersionOptionGroups.get(projectId);
    if (checkbox.getValue() == false) {
        optionGroup.clear();
        optionGroup.setEnabled(false);
    } else {
        @SuppressWarnings("unchecked")
        Collection<String> projectVersionIds = (Collection<String>) optionGroup.getItemIds();
        Iterator<String> itr = projectVersionIds.iterator();
        optionGroup.select(itr.next());
        optionGroup.setEnabled(true);
    }
}
项目:metl    文件:PropertySheet.java   
protected OptionGroup buildOptionGroup(String caption, String name, List<Component> components) {
    OptionGroup optionGroup = new OptionGroup(caption);
    optionGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    optionGroup.setImmediate(true);
    optionGroup.addItem("ON");
    optionGroup.addItem("OFF");
    optionGroup.addValueChangeListener((event) -> saveSetting(name, optionGroup, components));
    return optionGroup;
}
项目:XACML    文件:ExpressionSelectionWindow.java   
@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;
}
项目:extacrm    文件:CancelReasonSelect.java   
public CancelReasonSelect() {
    super("Причина отмены продажи");
    withSelectType(OptionGroup.class);
    setWidthUndefined();
    setCaptionGenerator(ComponentUtil.getEnumCaptionGenerator(Sale.CancelReason.class));
    setOptions(Sale.CancelReason.values());
}
项目:vfs2-file-explorer    文件:ConfigView.java   
private void setVisibleFields(final OptionGroup group, final TextField tfKeyFile, final TextField tfProxyHost, final TextField tfProxyPort,
        final TextField tfUser, final PasswordField tfPw) {
    if (group.getValue() == null)
        group.setValue("FILE");
    String strGroup = group.getValue().toString();
    if (strGroup == "FTP") {
        tfKeyFile.setVisible(false);
        tfProxyHost.setVisible(false);
        tfProxyPort.setVisible(false);
        tfUser.setVisible(true);
        tfPw.setVisible(true);
    } else if (strGroup == "SFTP") {
        tfKeyFile.setVisible(true);
        tfProxyHost.setVisible(true);
        tfProxyPort.setVisible(true);
        tfUser.setVisible(true);
        tfPw.setVisible(true);
    } else {
        // File
        tfKeyFile.setVisible(false);
        tfProxyHost.setVisible(false);
        tfProxyPort.setVisible(false);
        tfUser.setVisible(false);
        tfPw.setVisible(false);

    }
}
项目:scoutmaster    文件:ImportSelectType.java   
public ImportSelectType(final ImportWizardView importView)
{
    this.importTypes.add(new ImportType("Contacts", Contact.class));

    this.layout = new VerticalLayout();
    this.layout
            .addComponent(new Label("Select the type of information you are looking to import. The click 'Next'"));
    final FormLayout formLayout = new FormLayout();
    this.optionGroup = new OptionGroup("Type", this.importTypes);
    formLayout.addComponent(this.optionGroup);
    this.layout.addComponent(formLayout);
    this.layout.setMargin(true);
}
项目:scoutmaster    文件:AllocationMethodStep.java   
@Override
public Component getContent()
{
    if (this.layout == null)
    {
        this.layout = new VerticalLayout();
        this.layout.setMargin(true);

        final Label label = new Label("<h1>Select the Allocation method.</h1>");
        label.setContentMode(ContentMode.HTML);
        this.layout.addComponent(label);

        this.options = new OptionGroup();
        this.options.addItem(AllocationMethod.BulkAllocation);
        this.options.addItem(AllocationMethod.SingleAllocation);
        this.options.addItem(AllocationMethod.ManualAllocation);
        this.options.setValue(AllocationMethod.BulkAllocation);
        this.options.setImmediate(true);
        this.options.addValueChangeListener(this);

        this.layout.addComponent(this.options);

        final StringBuilder sb = new StringBuilder();
        sb.append("<ul><li>Bulk Allocation allows you to automatically allocate a number of books to a list of selected Contacts.</li>");
        sb.append("<li>Single Allocation allows you to automatically allocate a number of books to a single Contact.</li>");
        sb.append("<li>Manual Allocation allows you select individual books to allocate to a single Contact.</li></ul>");

        this.layout.addComponent(new Label(sb.toString(), ContentMode.HTML));

    }

    return this.layout;
}
项目:incubator-openaz    文件:ObligationEditorWindow.java   
@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");

    // textFieldObligationID
    textFieldObligationID = new TextField();
    textFieldObligationID.setCaption("Obligation ID");
    textFieldObligationID.setImmediate(false);
    textFieldObligationID.setWidth("-1px");
    textFieldObligationID.setHeight("-1px");
    textFieldObligationID.setInvalidAllowed(false);
    textFieldObligationID.setRequired(true);
    textFieldObligationID.setInputPrompt("Eg. urn:com:foo:obligation:sample");
    mainLayout.addComponent(textFieldObligationID);

    // optionGroupFullfillOn
    optionGroupFullfillOn = new OptionGroup();
    optionGroupFullfillOn.setCaption("Fulfill On");
    optionGroupFullfillOn.setImmediate(false);
    optionGroupFullfillOn.setWidth("-1px");
    optionGroupFullfillOn.setHeight("-1px");
    optionGroupFullfillOn.setInvalidAllowed(false);
    optionGroupFullfillOn.setRequired(true);
    mainLayout.addComponent(optionGroupFullfillOn);

    // buttonSave
    buttonSave = new Button();
    buttonSave.setCaption("Save");
    buttonSave.setImmediate(true);
    buttonSave.setWidth("-1px");
    buttonSave.setHeight("-1px");
    mainLayout.addComponent(buttonSave);
    mainLayout.setComponentAlignment(buttonSave, new Alignment(48));

    return mainLayout;
}
项目:incubator-openaz    文件:AdviceEditorWindow.java   
@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");

    // textFieldAdviceID
    textFieldAdviceID = new TextField();
    textFieldAdviceID.setCaption("Advice ID");
    textFieldAdviceID.setImmediate(false);
    textFieldAdviceID.setWidth("-1px");
    textFieldAdviceID.setHeight("-1px");
    textFieldAdviceID.setInvalidAllowed(false);
    textFieldAdviceID.setRequired(true);
    textFieldAdviceID.setInputPrompt("Eg. urn:com:foo:advice:sample");
    mainLayout.addComponent(textFieldAdviceID);

    // optionGroupEffect
    optionGroupEffect = new OptionGroup();
    optionGroupEffect.setCaption("Applies To");
    optionGroupEffect.setImmediate(false);
    optionGroupEffect.setWidth("-1px");
    optionGroupEffect.setHeight("-1px");
    optionGroupEffect.setInvalidAllowed(false);
    optionGroupEffect.setRequired(true);
    mainLayout.addComponent(optionGroupEffect);

    // buttonSave
    buttonSave = new Button();
    buttonSave.setCaption("Save");
    buttonSave.setImmediate(true);
    buttonSave.setWidth("-1px");
    buttonSave.setHeight("-1px");
    mainLayout.addComponent(buttonSave);
    mainLayout.setComponentAlignment(buttonSave, new Alignment(48));

    return mainLayout;
}
项目:incubator-openaz    文件:RuleEditorWindow.java   
@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");

    // labelRuleID
    labelRuleID = new Label();
    labelRuleID.setCaption("Rule ID");
    labelRuleID.setImmediate(false);
    labelRuleID.setWidth("100.0%");
    labelRuleID.setHeight("-1px");
    labelRuleID.setValue("Label");
    mainLayout.addComponent(labelRuleID);
    mainLayout.setExpandRatio(labelRuleID, 1.0f);

    // optionGroupEffect
    optionGroupEffect = new OptionGroup();
    optionGroupEffect.setCaption("Choose the effect.");
    optionGroupEffect.setImmediate(false);
    optionGroupEffect.setWidth("-1px");
    optionGroupEffect.setHeight("-1px");
    optionGroupEffect.setInvalidAllowed(false);
    optionGroupEffect.setRequired(true);
    mainLayout.addComponent(optionGroupEffect);

    // textAreaDescription
    textAreaDescription = new TextArea();
    textAreaDescription.setCaption("Enter a description for the Rule.");
    textAreaDescription.setImmediate(false);
    textAreaDescription.setWidth("100.0%");
    textAreaDescription.setHeight("-1px");
    textAreaDescription.setNullSettingAllowed(true);
    textAreaDescription.setNullRepresentation("");
    mainLayout.addComponent(textAreaDescription);
    mainLayout.setExpandRatio(textAreaDescription, 1.0f);

    // buttonSave
    buttonSave = new Button();
    buttonSave.setCaption("Save");
    buttonSave.setImmediate(true);
    buttonSave.setWidth("-1px");
    buttonSave.setHeight("-1px");
    mainLayout.addComponent(buttonSave);
    mainLayout.setComponentAlignment(buttonSave, new Alignment(48));

    return mainLayout;
}
项目:incubator-openaz    文件:PolicyNameEditorWindow.java   
@AutoGenerated
private FormLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new FormLayout();
    mainLayout.setImmediate(false);

    // textFieldPolicyName
    textFieldPolicyName = new TextField();
    textFieldPolicyName.setCaption("Policy File Name");
    textFieldPolicyName.setImmediate(true);
    textFieldPolicyName.setWidth("-1px");
    textFieldPolicyName.setHeight("-1px");
    textFieldPolicyName.setInputPrompt("Enter filename eg. foobar.xml");
    textFieldPolicyName.setRequired(true);
    mainLayout.addComponent(textFieldPolicyName);

    // textAreaDescription
    textAreaDescription = new TextArea();
    textAreaDescription.setCaption("Description");
    textAreaDescription.setImmediate(false);
    textAreaDescription.setWidth("100%");
    textAreaDescription.setHeight("-1px");
    textAreaDescription
            .setInputPrompt("Enter a description for the Policy/PolicySet.");
    textAreaDescription.setNullSettingAllowed(true);
    mainLayout.addComponent(textAreaDescription);

    // optionPolicySet
    optionPolicySet = new OptionGroup();
    optionPolicySet.setCaption("Policy or PolicySet?");
    optionPolicySet.setImmediate(true);
    optionPolicySet
            .setDescription("Is the root level a Policy or Policy Set.");
    optionPolicySet.setWidth("-1px");
    optionPolicySet.setHeight("-1px");
    optionPolicySet.setRequired(true);
    mainLayout.addComponent(optionPolicySet);

    // comboAlgorithms
    comboAlgorithms = new ComboBox();
    comboAlgorithms.setCaption("Combining Algorithm");
    comboAlgorithms.setImmediate(false);
    comboAlgorithms.setDescription("Select the combining algorithm.");
    comboAlgorithms.setWidth("-1px");
    comboAlgorithms.setHeight("-1px");
    comboAlgorithms.setRequired(true);
    mainLayout.addComponent(comboAlgorithms);

    // buttonSave
    buttonSave = new Button();
    buttonSave.setCaption("Save");
    buttonSave.setImmediate(true);
    buttonSave.setWidth("-1px");
    buttonSave.setHeight("-1px");
    mainLayout.addComponent(buttonSave);
    mainLayout.setComponentAlignment(buttonSave, new Alignment(48));

    return mainLayout;
}
项目:hybridbpm    文件:TaskConfigureCustomComponent.java   
protected void setOptionGroupProperties(OptionGroup optionGroup) {
    optionGroup.setNullSelectionAllowed(false);
    optionGroup.setHtmlContentAllowed(true);
    optionGroup.setImmediate(true);
}
项目:metl    文件:EditReleasePackageDialog.java   
protected Panel buildProjectsAndVersions(String releasePackageId) {
    Panel projectsAndVersionsPanel = new Panel("Projects and Branches");
    projectsAndVersionsPanel.addStyleName(ValoTheme.PANEL_SCROLL_INDICATOR);
    projectsAndVersionsPanel.setSizeFull();

    VerticalLayout projectLayout = new VerticalLayout();
    projectLayout.setMargin(true);
    projectCheckboxes.clear();
    projectVersionOptionGroups.clear();
    List<Project> projects = configurationService.findProjects();
    for (Project project : projects) {
        //first allow the user to select or unselect a project
        CheckBox checkBox = new CheckBox(project.getName());
        checkBox.setData(project.getId());
        if (releasePackage.isReleased()) {
            checkBox.setEnabled(false);
        }
        projectLayout.addComponent(checkBox);
        //now put the project version options for each project            
        OptionGroup optionGroup = new OptionGroup();   
        optionGroup.addStyleName("indent");
        List<Rppv> rppvs = configurationService.findReleasePackageProjectVersions(releasePackageId);
        Set<String> projectVersionsInReleasePackage = getListOfProjectVersionsInReleasePackages(rppvs);
        for (ProjectVersion projectVersion : project.getProjectVersions()) {
            optionGroup.addStyleName(ValoTheme.OPTIONGROUP_SMALL);
            optionGroup.addItem(projectVersion.getId());
            optionGroup.setEnabled(false);
            optionGroup.setItemCaption(projectVersion.getId(),projectVersion.getName());
            if (projectVersionsInReleasePackage.contains(projectVersion.getId())) {
                checkBox.setValue(true);
                optionGroup.select(projectVersion.getId());
                if (!releasePackage.isReleased()) {
                    optionGroup.setEnabled(true);
                }
            }
            projectVersionOptionGroups.put(project.getId(), optionGroup);
            projectLayout.addComponent(optionGroup);
        }
        projectCheckboxes.add(checkBox);
        checkBox.addValueChangeListener(e -> projectSelectionListener(e));
    }

    projectsAndVersionsPanel.setContent(projectLayout);
    return projectsAndVersionsPanel;
}
项目:metl    文件:DeployDialog.java   
public DeployDialog(ApplicationContext context, EditAgentPanel parentPanel) {
    super("Deploy");
    this.context = context;
    this.configurationService = context.getConfigurationService();
    this.operationsService = context.getOperationsSerivce();
    this.parentPanel = parentPanel;
    this.context = context;

    final float DESIRED_WIDTH = 1000;
    float width = DESIRED_WIDTH;
    float maxWidth = (float) (Page.getCurrent().getBrowserWindowWidth() * .8);
    if (maxWidth < DESIRED_WIDTH) {
        width = maxWidth;
    }
    setWidth(width, Unit.PIXELS);
    setHeight(600.0f, Unit.PIXELS);

    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSizeFull();
    addComponent(layout, 1);

    deployByOptionGroup = new OptionGroup("Deployment Type:");
    deployByOptionGroup.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    deployByOptionGroup.addItem(DEPLOY_BY_PACKAGE);
    deployByOptionGroup.addItem(DEPLOY_BY_FLOW);
    layout.addComponent(deployByOptionGroup);

    selectDeploymentLayout = new VerticalLayout();
    selectDeploymentLayout.setSizeFull();
    selectDeploymentLayout.setMargin(new MarginInfo(true, false));
    layout.addComponent(selectDeploymentLayout);
    layout.setExpandRatio(selectDeploymentLayout, 1);

    backButton = new Button("Cancel", e -> back());
    actionButton = new Button("Deploy", e -> takeAction());
    actionButton.addStyleName(ValoTheme.BUTTON_PRIMARY);
    actionButton.setClickShortcut(KeyCode.ENTER);
    addComponent(buildButtonFooter(backButton, actionButton));

    deployByOptionGroup.addValueChangeListener(e -> deployByChanged());
    deployByOptionGroup.setValue(DEPLOY_BY_PACKAGE);

}
项目:metl    文件:ImportXmlTemplateWindow.java   
public ImportXmlTemplateWindow(ImportXmlListener listener, Component component, ApplicationContext context) {
    this.listener = listener;
    this.component = component;
    this.context = context;
    setCaption("Import XML Template");
    setWidth(600.0f, Unit.PIXELS);
    setHeight(500.0f, Unit.PIXELS);

    VerticalLayout layout = new VerticalLayout();
    layout.setSizeFull();
    layout.setSpacing(true);
    layout.setMargin(true);
    layout.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
    layout.addComponent(new Label("Import XML from either an XSD or WSDL source."));

    optionGroup = new OptionGroup("Select the location of the XSD or WSDL.");
    optionGroup.addItem(OPTION_TEXT);
    optionGroup.addItem(OPTION_FILE);
    optionGroup.addItem(OPTION_URL);
    optionGroup.addItem(OPTION_RESOURCE);
    optionGroup.setNullSelectionAllowed(false);
    optionGroup.setImmediate(true);
    optionGroup.select(OPTION_TEXT);
    optionGroup.addValueChangeListener(this);
    layout.addComponent(optionGroup);

    optionLayout = new VerticalLayout();
    optionLayout.setSizeFull();

    editor = new AceEditor();
    editor.setCaption("Enter the XML text:");
    editor.setMode(AceMode.xml);
    editor.setSizeFull();
    editor.setHighlightActiveLine(true);
    editor.setShowPrintMargin(false);

    Button importButton = new Button("Import");
    importButton.addClickListener(this);

    upload = new Upload(null, this);
    upload.addSucceededListener(this);
    upload.setButtonCaption(null);
    urlTextField = new TextField("Enter the URL:");
    urlTextField.setWidth(100.0f, Unit.PERCENTAGE);

    resourceComboBox = createResourceCB();

    layout.addComponent(optionLayout);
    layout.setExpandRatio(optionLayout, 1.0f);
    rebuildOptionLayout();

    addComponent(layout, 1);
    addComponent(buildButtonFooter(importButton, buildCloseButton()));

}
项目:root    文件:UserWardView.java   
public UserWardView() {

    setClosable(true);
    setModal(true);

    setCaption(MessageResources.getString("changeWard"));
    final Employee user = getEnvironment().getCurrentEmployee(); 

    VerticalLayout layout = new VerticalLayout();

    final OptionGroup wardGroup = new OptionGroup();

    List<Ward> wards = wardProvider.getAllItems();
    for (Ward ward : wards) {
        wardGroup.addItem(ward.getId());
        wardGroup.setItemCaption(ward.getId(), ward.getCharacterisation());
    }

    wardGroup.addItem(-1);
    wardGroup.setItemCaption(-1, MessageResources.getString("allPatients"));

    wardGroup.select(user.getCurrentWard().getId());

    Button changeWardButton = new Button(MessageResources.getString("changeWard"));
    changeWardButton.addClickListener(new ClickListener(){

        @Override
        public void buttonClick(ClickEvent event) {
            Ward newWard;

            if ((int)wardGroup.getValue() == -1)
                newWard = null;
            else
                newWard = wardProvider.getByID(wardGroup.getValue());

            if (newWard != null) {
                user.setCurrentWard(newWard);
                employeeProvider.update(user);

                fireWardChangeEvent(newWard);
            }
            else
                fireWardChangeEvent();

            UserWardView.this.close();
        }

    });

    layout.addComponent(wardGroup);
    layout.addComponent(changeWardButton);

    setContent(layout);

}
项目:primecloud-controller    文件:WinServerEdit.java   
@Override
public void attach() {
    setHeight(TAB_HEIGHT);
    setMargin(false, true, false, true);
    setSpacing(false);

    // IPアドレス設定
    ipOptionGroup = new OptionGroup(ViewProperties.getCaption("field.optionIp"));
    ipOptionGroup.setNullSelectionAllowed(false);
    ipOptionGroup.setImmediate(true);
    ipOptionGroup.addContainerProperty(IP_OPTION_CAPTION_ID, String.class, null);
    ipOptionGroup.setItemCaptionPropertyId(IP_OPTION_CAPTION_ID);
    ipOptionGroup.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY);

    Item ipOptionItem = ipOptionGroup.addItem(IP_OPTION_DHCP);
    ipOptionItem.getItemProperty(IP_OPTION_CAPTION_ID).setValue(ViewProperties.getCaption("field.dhcpIp"));
    Item ipOptionItem2 = ipOptionGroup.addItem(IP_OPTION_STATIC);
    ipOptionItem2.getItemProperty(IP_OPTION_CAPTION_ID).setValue(ViewProperties.getCaption("field.staticIp"));

    ipOptionGroup.addListener(new ValueChangeListener() {
        @Override
        public void valueChange(ValueChangeEvent event) {
            String value = (String) event.getProperty().getValue();
            if (IP_OPTION_DHCP.equals(value)) {
                ipAddressField.setEnabled(false);
                subnetMaskField.setEnabled(false);
                defaultGatewayField.setEnabled(false);
            } else {
                ipAddressField.setEnabled(true);
                subnetMaskField.setEnabled(true);
                defaultGatewayField.setEnabled(true);
            }
        }
    });
    form.getLayout().addComponent(ipOptionGroup);

    // IPアドレス
    ipAddressField = new TextField(ViewProperties.getCaption("field.ipAddress"));
    ipAddressField.setWidth("100%");
    form.getLayout().addComponent(ipAddressField);

    // サブネットマスク
    subnetMaskField = new TextField(ViewProperties.getCaption("field.subnetMask"));
    subnetMaskField.setWidth("100%");
    form.getLayout().addComponent(subnetMaskField);

    // デフォルトゲートウェイ
    defaultGatewayField = new TextField(ViewProperties.getCaption("field.defaultGateway"));
    defaultGatewayField.setWidth("100%");
    form.getLayout().addComponent(defaultGatewayField);

    addComponent(form);
}
项目:mycollab    文件:ProjectNotificationSettingViewComponent.java   
public ProjectNotificationSettingViewComponent(final ProjectNotificationSetting bean) {
    super(UserUIContext.getMessage(ProjectSettingI18nEnum.VIEW_TITLE));

    MVerticalLayout body = new MVerticalLayout().withMargin(new MarginInfo(true, false, false, false));
    body.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);

    final OptionGroup optionGroup = new OptionGroup(null);
    optionGroup.setItemCaptionMode(ItemCaptionMode.EXPLICIT);

    optionGroup.addItem(NotificationType.Default.name());
    optionGroup.setItemCaption(NotificationType.Default.name(), UserUIContext
            .getMessage(ProjectSettingI18nEnum.OPT_DEFAULT_SETTING));

    optionGroup.addItem(NotificationType.None.name());
    optionGroup.setItemCaption(NotificationType.None.name(),
            UserUIContext.getMessage(ProjectSettingI18nEnum.OPT_NONE_SETTING));

    optionGroup.addItem(NotificationType.Minimal.name());
    optionGroup.setItemCaption(NotificationType.Minimal.name(), UserUIContext
            .getMessage(ProjectSettingI18nEnum.OPT_MINIMUM_SETTING));

    optionGroup.addItem(NotificationType.Full.name());
    optionGroup.setItemCaption(NotificationType.Full.name(), UserUIContext
            .getMessage(ProjectSettingI18nEnum.OPT_MAXIMUM_SETTING));

    optionGroup.setWidth("100%");
    body.with(optionGroup);

    String levelVal = bean.getLevel();
    if (levelVal == null) {
        optionGroup.select(NotificationType.Default.name());
    } else {
        optionGroup.select(levelVal);
    }

    MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> {
        try {
            bean.setLevel((String) optionGroup.getValue());
            ProjectNotificationSettingService projectNotificationSettingService = AppContextUtil.getSpringBean(ProjectNotificationSettingService.class);

            if (bean.getId() == null) {
                projectNotificationSettingService.saveWithSession(bean, UserUIContext.getUsername());
            } else {
                projectNotificationSettingService.updateWithSession(bean, UserUIContext.getUsername());
            }
            NotificationUtil.showNotification(UserUIContext.getMessage(GenericI18Enum.OPT_CONGRATS),
                    UserUIContext.getMessage(ProjectSettingI18nEnum.DIALOG_UPDATE_SUCCESS));
        } catch (Exception e) {
            throw new MyCollabException(e);
        }
    }).withIcon(FontAwesome.SAVE).withStyleName(WebThemes.BUTTON_ACTION);
    body.addComponent(saveBtn);

    this.addComponent(body);
}
项目:mycollab    文件:NotificationSettingWindow.java   
public NotificationSettingWindow(SimpleProjectMember projectMember) {
    super(UserUIContext.getMessage(ProjectCommonI18nEnum.ACTION_EDIT_NOTIFICATION));
    withModal(true).withResizable(false).withWidth("600px").withCenter();
    ProjectNotificationSettingService prjNotificationSettingService = AppContextUtil.getSpringBean(ProjectNotificationSettingService.class);
    ProjectNotificationSetting notification = prjNotificationSettingService.findNotification(projectMember.getUsername(), projectMember.getProjectid(),
            projectMember.getSaccountid());

    MVerticalLayout body = new MVerticalLayout();

    final OptionGroup optionGroup = new OptionGroup(null);
    optionGroup.setItemCaptionMode(AbstractSelect.ItemCaptionMode.EXPLICIT);

    optionGroup.addItem(NotificationType.Default.name());
    optionGroup.setItemCaption(NotificationType.Default.name(), UserUIContext
            .getMessage(ProjectSettingI18nEnum.OPT_DEFAULT_SETTING));

    optionGroup.addItem(NotificationType.None.name());
    optionGroup.setItemCaption(NotificationType.None.name(),
            UserUIContext.getMessage(ProjectSettingI18nEnum.OPT_NONE_SETTING));

    optionGroup.addItem(NotificationType.Minimal.name());
    optionGroup.setItemCaption(NotificationType.Minimal.name(), UserUIContext
            .getMessage(ProjectSettingI18nEnum.OPT_MINIMUM_SETTING));

    optionGroup.addItem(NotificationType.Full.name());
    optionGroup.setItemCaption(NotificationType.Full.name(), UserUIContext
            .getMessage(ProjectSettingI18nEnum.OPT_MAXIMUM_SETTING));

    optionGroup.setWidth("100%");

    body.with(optionGroup).withAlign(optionGroup, Alignment.MIDDLE_LEFT);

    String levelVal = notification.getLevel();
    if (levelVal == null) {
        optionGroup.select(NotificationType.Default.name());
    } else {
        optionGroup.select(levelVal);
    }

    MButton closeBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CLOSE), clickEvent -> close())
            .withStyleName(WebThemes.BUTTON_OPTION);
    MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> {
        try {
            notification.setLevel((String) optionGroup.getValue());
            ProjectNotificationSettingService projectNotificationSettingService = AppContextUtil.getSpringBean(ProjectNotificationSettingService.class);

            if (notification.getId() == null) {
                projectNotificationSettingService.saveWithSession(notification, UserUIContext.getUsername());
            } else {
                projectNotificationSettingService.updateWithSession(notification, UserUIContext.getUsername());
            }
            NotificationUtil.showNotification(UserUIContext.getMessage(GenericI18Enum.OPT_CONGRATS),
                    UserUIContext.getMessage(ProjectSettingI18nEnum.DIALOG_UPDATE_SUCCESS));
            close();
        } catch (Exception e) {
            throw new MyCollabException(e);
        }
    }).withStyleName(WebThemes.BUTTON_ACTION).withIcon(FontAwesome.SAVE);
    MHorizontalLayout btnControls = new MHorizontalLayout(closeBtn, saveBtn);
    body.with(btnControls).withAlign(btnControls, Alignment.TOP_RIGHT);

    withContent(body);
}
项目:mycollab    文件:CrmNotificationSettingViewImpl.java   
@Override
public void showNotificationSettings(final CrmNotificationSetting notification) {
    this.removeAllComponents();

    MVerticalLayout bodyWrapper = new MVerticalLayout();
    bodyWrapper.setSizeFull();

    MVerticalLayout body = new MVerticalLayout().withMargin(new MarginInfo(true, false, false, false));

    final OptionGroup optionGroup = new OptionGroup(null);
    optionGroup.setItemCaptionMode(ItemCaptionMode.EXPLICIT);

    optionGroup.addItem(NotificationType.Default.name());
    optionGroup.setItemCaption(NotificationType.Default.name(),
            UserUIContext.getMessage(ProjectSettingI18nEnum.OPT_DEFAULT_SETTING));

    optionGroup.addItem(NotificationType.None.name());
    optionGroup.setItemCaption(NotificationType.None.name(), UserUIContext
            .getMessage(ProjectSettingI18nEnum.OPT_NONE_SETTING));

    optionGroup.addItem(NotificationType.Minimal.name());
    optionGroup.setItemCaption(NotificationType.Minimal.name(),
            UserUIContext.getMessage(ProjectSettingI18nEnum.OPT_MINIMUM_SETTING));

    optionGroup.addItem(NotificationType.Full.name());
    optionGroup.setItemCaption(NotificationType.Full.name(), UserUIContext
            .getMessage(ProjectSettingI18nEnum.OPT_MAXIMUM_SETTING));

    optionGroup.setHeight("100%");

    body.with(optionGroup).withAlign(optionGroup, Alignment.MIDDLE_LEFT).expand(optionGroup);

    String levelVal = notification.getLevel();
    if (levelVal == null) {
        optionGroup.select(NotificationType.Default.name());
    } else {
        optionGroup.select(levelVal);
    }

    Button updateBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_UPDATE_LABEL), clickEvent -> {
        try {
            notification.setLevel((String) optionGroup.getValue());
            CrmNotificationSettingService crmNotificationSettingService = AppContextUtil
                    .getSpringBean(CrmNotificationSettingService.class);
            if (notification.getId() == null) {
                crmNotificationSettingService.saveWithSession(notification, UserUIContext.getUsername());
            } else {
                crmNotificationSettingService.updateWithSession(notification, UserUIContext.getUsername());
            }
            NotificationUtil.showNotification(UserUIContext.getMessage(GenericI18Enum.OPT_CONGRATS),
                    UserUIContext.getMessage(ProjectSettingI18nEnum.DIALOG_UPDATE_SUCCESS));
        } catch (Exception e) {
            throw new MyCollabException(e);
        }
    }).withIcon(FontAwesome.REFRESH).withStyleName(WebThemes.BUTTON_ACTION);
    body.with(updateBtn).withAlign(updateBtn, Alignment.BOTTOM_LEFT);

    bodyWrapper.addComponent(body);
    this.addComponent(bodyWrapper);
}
项目:XACML    文件:ObligationEditorWindow.java   
@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");

    // textFieldObligationID
    textFieldObligationID = new TextField();
    textFieldObligationID.setCaption("Obligation ID");
    textFieldObligationID.setImmediate(false);
    textFieldObligationID.setWidth("-1px");
    textFieldObligationID.setHeight("-1px");
    textFieldObligationID.setInvalidAllowed(false);
    textFieldObligationID.setRequired(true);
    textFieldObligationID.setInputPrompt("Eg. urn:com:foo:obligation:sample");
    mainLayout.addComponent(textFieldObligationID);

    // optionGroupFullfillOn
    optionGroupFullfillOn = new OptionGroup();
    optionGroupFullfillOn.setCaption("Fulfill On");
    optionGroupFullfillOn.setImmediate(false);
    optionGroupFullfillOn.setWidth("-1px");
    optionGroupFullfillOn.setHeight("-1px");
    optionGroupFullfillOn.setInvalidAllowed(false);
    optionGroupFullfillOn.setRequired(true);
    mainLayout.addComponent(optionGroupFullfillOn);

    // buttonSave
    buttonSave = new Button();
    buttonSave.setCaption("Save");
    buttonSave.setImmediate(true);
    buttonSave.setWidth("-1px");
    buttonSave.setHeight("-1px");
    mainLayout.addComponent(buttonSave);
    mainLayout.setComponentAlignment(buttonSave, new Alignment(48));

    return mainLayout;
}
项目:XACML    文件:AdviceEditorWindow.java   
@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");

    // textFieldAdviceID
    textFieldAdviceID = new TextField();
    textFieldAdviceID.setCaption("Advice ID");
    textFieldAdviceID.setImmediate(false);
    textFieldAdviceID.setWidth("-1px");
    textFieldAdviceID.setHeight("-1px");
    textFieldAdviceID.setInvalidAllowed(false);
    textFieldAdviceID.setRequired(true);
    textFieldAdviceID.setInputPrompt("Eg. urn:com:foo:advice:sample");
    mainLayout.addComponent(textFieldAdviceID);

    // optionGroupEffect
    optionGroupEffect = new OptionGroup();
    optionGroupEffect.setCaption("Applies To");
    optionGroupEffect.setImmediate(false);
    optionGroupEffect.setWidth("-1px");
    optionGroupEffect.setHeight("-1px");
    optionGroupEffect.setInvalidAllowed(false);
    optionGroupEffect.setRequired(true);
    mainLayout.addComponent(optionGroupEffect);

    // buttonSave
    buttonSave = new Button();
    buttonSave.setCaption("Save");
    buttonSave.setImmediate(true);
    buttonSave.setWidth("-1px");
    buttonSave.setHeight("-1px");
    mainLayout.addComponent(buttonSave);
    mainLayout.setComponentAlignment(buttonSave, new Alignment(48));

    return mainLayout;
}
项目:XACML    文件:RuleEditorWindow.java   
@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");

    // labelRuleID
    labelRuleID = new Label();
    labelRuleID.setCaption("Rule ID");
    labelRuleID.setImmediate(false);
    labelRuleID.setWidth("100.0%");
    labelRuleID.setHeight("-1px");
    labelRuleID.setValue("Label");
    mainLayout.addComponent(labelRuleID);
    mainLayout.setExpandRatio(labelRuleID, 1.0f);

    // optionGroupEffect
    optionGroupEffect = new OptionGroup();
    optionGroupEffect.setCaption("Choose the effect.");
    optionGroupEffect.setImmediate(false);
    optionGroupEffect.setWidth("-1px");
    optionGroupEffect.setHeight("-1px");
    optionGroupEffect.setInvalidAllowed(false);
    optionGroupEffect.setRequired(true);
    mainLayout.addComponent(optionGroupEffect);

    // textAreaDescription
    textAreaDescription = new TextArea();
    textAreaDescription.setCaption("Enter a description for the Rule.");
    textAreaDescription.setImmediate(false);
    textAreaDescription.setWidth("100.0%");
    textAreaDescription.setHeight("-1px");
    textAreaDescription.setNullSettingAllowed(true);
    textAreaDescription.setNullRepresentation("");
    mainLayout.addComponent(textAreaDescription);
    mainLayout.setExpandRatio(textAreaDescription, 1.0f);

    // buttonSave
    buttonSave = new Button();
    buttonSave.setCaption("Save");
    buttonSave.setImmediate(true);
    buttonSave.setWidth("-1px");
    buttonSave.setHeight("-1px");
    mainLayout.addComponent(buttonSave);
    mainLayout.setComponentAlignment(buttonSave, new Alignment(48));

    return mainLayout;
}
项目:XACML    文件:PolicyNameEditorWindow.java   
@AutoGenerated
private FormLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new FormLayout();
    mainLayout.setImmediate(false);

    // textFieldPolicyName
    textFieldPolicyName = new TextField();
    textFieldPolicyName.setCaption("Policy File Name");
    textFieldPolicyName.setImmediate(true);
    textFieldPolicyName.setWidth("-1px");
    textFieldPolicyName.setHeight("-1px");
    textFieldPolicyName.setInputPrompt("Enter filename eg. foobar.xml");
    textFieldPolicyName.setRequired(true);
    mainLayout.addComponent(textFieldPolicyName);

    // textAreaDescription
    textAreaDescription = new TextArea();
    textAreaDescription.setCaption("Description");
    textAreaDescription.setImmediate(false);
    textAreaDescription.setWidth("100%");
    textAreaDescription.setHeight("-1px");
    textAreaDescription
            .setInputPrompt("Enter a description for the Policy/PolicySet.");
    textAreaDescription.setNullSettingAllowed(true);
    mainLayout.addComponent(textAreaDescription);

    // optionPolicySet
    optionPolicySet = new OptionGroup();
    optionPolicySet.setCaption("Policy or PolicySet?");
    optionPolicySet.setImmediate(true);
    optionPolicySet
            .setDescription("Is the root level a Policy or Policy Set.");
    optionPolicySet.setWidth("-1px");
    optionPolicySet.setHeight("-1px");
    optionPolicySet.setRequired(true);
    mainLayout.addComponent(optionPolicySet);

    // comboAlgorithms
    comboAlgorithms = new ComboBox();
    comboAlgorithms.setCaption("Combining Algorithm");
    comboAlgorithms.setImmediate(false);
    comboAlgorithms.setDescription("Select the combining algorithm.");
    comboAlgorithms.setWidth("-1px");
    comboAlgorithms.setHeight("-1px");
    comboAlgorithms.setRequired(true);
    mainLayout.addComponent(comboAlgorithms);

    // buttonSave
    buttonSave = new Button();
    buttonSave.setCaption("Save");
    buttonSave.setImmediate(true);
    buttonSave.setWidth("-1px");
    buttonSave.setHeight("-1px");
    mainLayout.addComponent(buttonSave);
    mainLayout.setComponentAlignment(buttonSave, new Alignment(48));

    return mainLayout;
}