Examples of SelectOption


Examples of com.volantis.mcs.protocols.SelectOption

        // group 1
        SelectOptionGroup group1 = createOptionGroup("1");
        // option A
        group1.addSelectOption(createOption("A"));
        // Option B
        SelectOption B = createOption("B");
        //option C
        SelectOption C = createOption("C");
        // group 2
        SelectOptionGroup group2 = createOptionGroup("2");
        group2.addSelectOption(B);
        group2.addSelectOption(C);
        group1.addSelectOptionGroup(group2);
        // option D
        SelectOption D = createOption("D");
        D.setSelected(true);
        // option E
        SelectOption E = createOption("E");
        E.setSelected(true);
        // group 3
        SelectOptionGroup group3 = createOptionGroup("3");
        group3.addSelectOption(D);
        group3.addSelectOption(E);
        group1.addSelectOptionGroup(group3);
        // option F
        SelectOption F = createOption("F");
        // option G
        SelectOption G = createOption("G");
        // group 4
        SelectOptionGroup group4 = createOptionGroup("4");
        group4.addSelectOption(F);
        group4.addSelectOption(G);
        group1.addSelectOptionGroup(group4);

        // option H
        SelectOption H = createOption("H");
        H.setSelected(true);
        group1.addSelectOption(H);

        // add group1 to the select attributes
        attributes.addOptionGroup(group1);
View Full Code Here

Examples of com.volantis.mcs.protocols.SelectOption

     * Factory method for creating a SelectOption
     * @param value the value of the option
     * @return the new SelectOption instance
     */
    private SelectOption createOption(String value) {
        SelectOption option = new SelectOption();
        option.setValue(value);
        return option;
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.SelectOption

        final List options =
                xfSingleSelectElement.getProtocolAttributes().getOptions();
        assertEquals(1, options.size());

        final SelectOption option = (SelectOption) options.get(0);
        final MutablePropertyValues propertyValues =
                option.getCaptionStyles().getPropertyValues();
        assertEquals(FontWeightKeywords.BOLD,
                propertyValues.getComputedValue(StylePropertyDetails.FONT_WEIGHT));
        assertEquals(FontSizeKeywords.LARGE,
                propertyValues.getComputedValue(StylePropertyDetails.FONT_SIZE));
        assertEquals(FontStyleKeywords.ITALIC,
View Full Code Here

Examples of com.volantis.mcs.protocols.SelectOption

            LocalizationFactory.createLogger(XFValueElementImpl.class);

    public XFValueElementImpl(XDIMEContextInternal context) {
        super(XFormElements.VALUE, new StoreDataStrategy(), context);

        protocolAttributes = new SelectOption();
        protocolAttributes.setTagName("xfvalue");
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.SelectOption

        // retrieve this element's parent from the stack
        Object element = context.getCurrentElement();
        // if it can have a value (i.e. it is an item) then set it
        if (element instanceof XFItemElementImpl) {
            SelectOption select = (SelectOption)
                    ((XFItemElementImpl)element).getProtocolAttributes();
            // the value appears as the body content of the value element
            final String value = getCharData();
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("XForms value text: " + value);
            }
            select.setValue(value);
        }
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.SelectOption

            int numOptions = options.size();

            for (int i = 0; i < numValues; i++) {
                final String initialValue = initialValues[i];
                for (int j = 0; j < numOptions; j++) {
                    final SelectOption selectOption = (SelectOption)options.get(j);
                    if (initialValue.equals(selectOption.getValue())) {
                        selectOption.setSelected(true);

                        // This only seems to be of interest for single selectors -
                        // it's not used when processing multiple selectors.
                        ((XFFormFieldAttributes) protocolAttributes).
                                setInitial(initialValue);
View Full Code Here

Examples of com.volantis.mcs.protocols.SelectOption

     * @param context
     */
    public XFItemElementImpl(XDIMEContextInternal context) {
        super(XFormElements.ITEM, new StoreDataStrategy(), context);

        protocolAttributes = new SelectOption();
        protocolAttributes.setTagName("xfoption");
    }
View Full Code Here

Examples of com.volantis.mcs.protocols.SelectOption

    // Javadoc inherited.
    public void callCloseOnProtocol(XDIMEContextInternal context)
            throws XDIMEException {

        // selector item markup should be sent to the entry container instance.
        SelectOption option = ((SelectOption)protocolAttributes);
        option.setEntryContainerInstance(
                getPageContext(context).getCurrentContainerInstance());

        // retrieve this element's parent from the stack
        Object element = context.getCurrentElement();
        if (element instanceof AbstractXFSelectElementImpl) {
View Full Code Here

Examples of com.volantis.mcs.protocols.SelectOption

    // Javadoc inherited.
    public void setUp() throws Exception {
        super.setUp();

        OPTION1 = new SelectOption();
        OPTION1.setCaption(new LiteralTextAssetReference("Option one caption"));
        OPTION1.setValue(OPTION1_VALUE);

        OPTION2 = new SelectOption();
        OPTION2.setCaption(new LiteralTextAssetReference("Option two caption"));
        OPTION2.setValue(OPTION2_VALUE);
        mockFieldType = new FieldTypeMock(
            "mockFieldType", expectations);
        protocol = new VolantisProtocolMock("protocol", expectations, null);
View Full Code Here

Examples of com.volantis.mcs.protocols.SelectOption

    public void testWithNullInitialValue() throws XDIMEException {
        List options = doTest(null);

        final int length = options.size();
        for (int i = 0; i < length; i++) {
            final SelectOption option = (SelectOption) options.get(i);
            assertFalse(option.isSelected());
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.