Package org.apache.harmony.x.swing.text.html.form

Examples of org.apache.harmony.x.swing.text.html.form.FormFieldsetModel


            return openedBlocks.contains(PARAGRAPH_TAG) || openedBlocks.contains(Tag.IMPLIED) && impliedBlockOpen;
        }

        private boolean handleLegend(final String legend, final MutableAttributeSet legendAttr) {
            final ElementSpec fieldSetSpec = findLastSpec(Tag.FIELDSET);
            FormFieldsetModel fieldSet = (FormFieldsetModel)getModel(fieldSetSpec);
            if (fieldSet == null || fieldSet.getLegend() != null) {
                return false;
            }               
            if (legend != null) {
                fieldSet.setLegend(legend);
            }
            if (legendAttr != null) {
                fieldSet.setLegendAttributes(legendAttr);
            }
            return true;
        }
View Full Code Here


                    openedBlocks.add(Tag.LEGEND);
                    if (openedBlocks.contains(Tag.FIELDSET)) {
                        handleLegend(null, specAttr);
                    }
                } else if (Tag.FIELDSET.equals(tag)) {
                    model = new FormFieldsetModel(getCurrentForm(), attr);
                    openedBlocks.add(Tag.FIELDSET);
                } else if (Tag.SELECT.equals(tag)) {
                    if (FormAttributes.isListSelect(specAttr)) {
                        selectModel = new FormSelectListModel(getCurrentForm(), attr);
                    } else {
View Full Code Here

                    openedBlocks.add(Tag.LEGEND);
                    if (openedBlocks.contains(Tag.FIELDSET)) {
                        handleLegend(null, specAttr);
                    }
                } else if (Tag.FIELDSET.equals(tag)) {
                    model = new FormFieldsetModel(getCurrentForm(), attr);
                    openedBlocks.add(Tag.FIELDSET);
                } else if (Tag.SELECT.equals(tag)) {
                    if (FormAttributes.isListSelect(specAttr)) {
                        selectModel = new FormSelectListModel(getCurrentForm(), attr);
                    } else {
View Full Code Here

            return openedBlocks.contains(PARAGRAPH_TAG) || openedBlocks.contains(Tag.IMPLIED) && impliedBlockOpen;
        }

        private boolean handleLegend(final String legend, final MutableAttributeSet legendAttr) {
            final ElementSpec fieldSetSpec = findLastSpec(Tag.FIELDSET);
            FormFieldsetModel fieldSet = (FormFieldsetModel)getModel(fieldSetSpec);
            if (fieldSet == null || fieldSet.getLegend() != null) {
                return false;
            }               
            if (legend != null) {
                fieldSet.setLegend(legend);
            }
            if (legendAttr != null) {
                fieldSet.setLegendAttributes(legendAttr);
            }
            return true;
        }
View Full Code Here

        assertEquals(3, specAttr.getAttributeCount());
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {' '});
        Object contentModel = specAttr.getAttribute(StyleConstants.ModelAttribute);
        assertNotNull(contentModel);
        assertTrue(contentModel instanceof FormFieldsetModel);
        FormFieldsetModel fieldSet = (FormFieldsetModel)contentModel;
        assertNull(fieldSet.getLegend());
        assertNull(fieldSet.getLegendAttributes());

        action.start(Tag.LEGEND, legendAttr1);
        reader.handleText(text1.toCharArray(), 0);
        action.end(Tag.LEGEND);
        assertEquals(text1, fieldSet.getLegend());
        assertNotNull(fieldSet.getLegendAttributes());
        assertEquals(2, fieldSet.getLegendAttributes().getAttributeCount());
        checkAttributes(fieldSet.getLegendAttributes(), "bbbb", "aaaa");
        checkAttributes(fieldSet.getLegendAttributes(), StyleConstants.NameAttribute, Tag.LEGEND);
        assertNotSame(legendAttr1, fieldSet.getLegendAttributes());
       
        action.start(Tag.LEGEND, legendAttr2);
        reader.handleText(text2.toCharArray(), 0);
        action.end(Tag.LEGEND);
        assertEquals(text1, fieldSet.getLegend());
        assertNotNull(fieldSet.getLegendAttributes());
        assertEquals(2, fieldSet.getLegendAttributes().getAttributeCount());
        checkAttributes(fieldSet.getLegendAttributes(), StyleConstants.NameAttribute, Tag.LEGEND);
        checkAttributes(fieldSet.getLegendAttributes(), "bbbb", "aaaa");
    }
View Full Code Here

        assertEquals(3, specAttr.getAttributeCount());
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {' '});
        Object contentModel = specAttr.getAttribute(StyleConstants.ModelAttribute);
        assertNotNull(contentModel);
        assertTrue(contentModel instanceof FormFieldsetModel);
        FormFieldsetModel fieldSet = (FormFieldsetModel)contentModel;
        assertNull(fieldSet.getLegend());
        assertNull(fieldSet.getLegendAttributes());
        action.end(Tag.FIELDSET);

        action.start(Tag.LEGEND, attr);
        reader.handleText(text1.toCharArray(), 0);
        action.end(Tag.LEGEND);
        assertNull(fieldSet.getLegend());
        assertNull(fieldSet.getLegendAttributes());
    }
View Full Code Here

        assertEquals(3, specAttr.getAttributeCount());
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {' '});
        Object contentModel = specAttr.getAttribute(StyleConstants.ModelAttribute);
        assertNotNull(contentModel);
        assertTrue(contentModel instanceof FormFieldsetModel);
        FormFieldsetModel fieldSet = (FormFieldsetModel)contentModel;
        assertNull(fieldSet.getLegend());
        assertNull(fieldSet.getLegendAttributes());

        action.start(Tag.LEGEND, legendAttr1);
        reader.handleText(text1.toCharArray(), 0);
        action.end(Tag.LEGEND);
        assertEquals(text1, fieldSet.getLegend());
        assertNotNull(fieldSet.getLegendAttributes());
        assertEquals(2, fieldSet.getLegendAttributes().getAttributeCount());
        checkAttributes(fieldSet.getLegendAttributes(), "bbbb", "aaaa");
        checkAttributes(fieldSet.getLegendAttributes(), StyleConstants.NameAttribute, Tag.LEGEND);
        assertNotSame(legendAttr1, fieldSet.getLegendAttributes());
       
        action.start(Tag.LEGEND, legendAttr2);
        reader.handleText(text2.toCharArray(), 0);
        action.end(Tag.LEGEND);
        assertEquals(text1, fieldSet.getLegend());
        assertNotNull(fieldSet.getLegendAttributes());
        assertEquals(2, fieldSet.getLegendAttributes().getAttributeCount());
        checkAttributes(fieldSet.getLegendAttributes(), StyleConstants.NameAttribute, Tag.LEGEND);
        checkAttributes(fieldSet.getLegendAttributes(), "bbbb", "aaaa");
    }
View Full Code Here

        assertEquals(3, specAttr.getAttributeCount());
        assertSpec(spec, ElementSpec.ContentType, ElementSpec.OriginateDirection, 0, new char[] {' '});
        Object contentModel = specAttr.getAttribute(StyleConstants.ModelAttribute);
        assertNotNull(contentModel);
        assertTrue(contentModel instanceof FormFieldsetModel);
        FormFieldsetModel fieldSet = (FormFieldsetModel)contentModel;
        assertNull(fieldSet.getLegend());
        assertNull(fieldSet.getLegendAttributes());
        action.end(Tag.FIELDSET);

        action.start(Tag.LEGEND, attr);
        reader.handleText(text1.toCharArray(), 0);
        action.end(Tag.LEGEND);
        assertNull(fieldSet.getLegend());
        assertNull(fieldSet.getLegendAttributes());
    }
View Full Code Here

            return openedBlocks.contains(PARAGRAPH_TAG) || openedBlocks.contains(Tag.IMPLIED) && impliedBlockOpen;
        }

        private boolean handleLegend(final String legend, final MutableAttributeSet legendAttr) {
            final ElementSpec fieldSetSpec = findLastSpec(Tag.FIELDSET);
            FormFieldsetModel fieldSet = (FormFieldsetModel)getModel(fieldSetSpec);
            if (fieldSet == null || fieldSet.getLegend() != null) {
                return false;
            }               
            if (legend != null) {
                fieldSet.setLegend(legend);
            }
            if (legendAttr != null) {
                fieldSet.setLegendAttributes(legendAttr);
            }
            return true;
        }
View Full Code Here

                    openedBlocks.add(Tag.LEGEND);
                    if (openedBlocks.contains(Tag.FIELDSET)) {
                        handleLegend(null, specAttr);
                    }
                } else if (Tag.FIELDSET.equals(tag)) {
                    model = new FormFieldsetModel(getCurrentForm(), attr);
                    openedBlocks.add(Tag.FIELDSET);
                } else if (Tag.SELECT.equals(tag)) {
                    if (FormAttributes.isListSelect(specAttr)) {
                        selectModel = new FormSelectListModel(getCurrentForm(), attr);
                    } else {
View Full Code Here

TOP

Related Classes of org.apache.harmony.x.swing.text.html.form.FormFieldsetModel

Copyright © 2018 www.massapicom. 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.