Package javax.swing.text.AbstractDocument

Examples of javax.swing.text.AbstractDocument.ElementEdit


            @Override
            protected void insertUpdate(final DefaultDocumentEvent event,
                    final AttributeSet attrs) {
                insert = event;
                super.insertUpdate(event, attrs);
                event.addEdit(new ElementEdit(altRoot, 0, new Element[0], new Element[0]) {
                    private static final long serialVersionUID = 1L;

                    @Override
                    public void undo() {
                        super.undo();
View Full Code Here


        lineRange.check(1, 1, shape, container);
        lineRange = null;
        assertNull(preferenceChange);
        // We remove the first and second lines, but the widest one isn't
        // changed, therefore the preferred width is not changed
        ElementEdit ee = new ElementEdit(root, 0, null, new Element[] { root.getElement(0),
                root.getElement(1) });
        ((DefaultDocumentEvent) event).addEdit(ee);
        view.updateDamage(event, shape, factory);
        assertNull(lineRange);
        preferenceChange.check(isHarmony() ? false : true, true);
View Full Code Here

        viewsCreated.clear();
    }

    public void testInsertUpdate() {
        event = doc.new DefaultDocumentEvent(4, 5, EventType.INSERT);
        event.addEdit(new ElementEdit(p1, 0, new Element[] { p1L }, new Element[] { p1L }));
        event.end();
        view.layout(alloc.width, alloc.height);
        assertTrue(view.isAllocationValid());
        view.strategy.insertUpdate(view, event, alloc);
        assertTrue(view.isAllocationValid());
View Full Code Here

        assertFalse(view.isLayoutValid(Y_AXIS));
    }

    public void testRemoveUpdate() {
        event = doc.new DefaultDocumentEvent(4, 5, EventType.REMOVE);
        event.addEdit(new ElementEdit(p1, 0, new Element[] { p1L }, new Element[] { p1L }));
        event.end();
        view.layout(alloc.width, alloc.height);
        assertTrue(view.isAllocationValid());
        view.strategy.removeUpdate(view, event, alloc);
        assertTrue(view.isAllocationValid());
View Full Code Here

        assertFalse(view.isLayoutValid(Y_AXIS));
    }

    public void testChangedUpdate() {
        event = doc.new DefaultDocumentEvent(4, 5, EventType.CHANGE);
        event.addEdit(new ElementEdit(p1, 0, new Element[] { p1L }, new Element[] { p1L }));
        event.end();
        view.layout(alloc.width, alloc.height);
        assertTrue(view.isAllocationValid());
        view.strategy.changedUpdate(view, event, alloc);
        assertTrue(view.isAllocationValid());
View Full Code Here

            @Override
            protected void insertUpdate(final DefaultDocumentEvent event,
                    final AttributeSet attrs) {
                insert = event;
                super.insertUpdate(event, attrs);
                event.addEdit(new ElementEdit(altRoot, 0, new Element[0], new Element[0]) {
                    private static final long serialVersionUID = 1L;

                    @Override
                    public void undo() {
                        super.undo();
View Full Code Here

            @Override
            protected void insertUpdate(final DefaultDocumentEvent event,
                    final AttributeSet attrs) {
                insert = event;
                super.insertUpdate(event, attrs);
                event.addEdit(new ElementEdit(altRoot, 0, new Element[0], new Element[0]) {
                    private static final long serialVersionUID = 1L;

                    @Override
                    public void undo() {
                        super.undo();
View Full Code Here

        viewsCreated.clear();
    }

    public void testInsertUpdate() {
        event = doc.new DefaultDocumentEvent(4, 5, EventType.INSERT);
        event.addEdit(new ElementEdit(p1, 0, new Element[] { p1L }, new Element[] { p1L }));
        event.end();
        view.layout(alloc.width, alloc.height);
        assertTrue(view.isAllocationValid());
        view.strategy.insertUpdate(view, event, alloc);
        assertTrue(view.isAllocationValid());
View Full Code Here

        assertFalse(view.isLayoutValid(Y_AXIS));
    }

    public void testRemoveUpdate() {
        event = doc.new DefaultDocumentEvent(4, 5, EventType.REMOVE);
        event.addEdit(new ElementEdit(p1, 0, new Element[] { p1L }, new Element[] { p1L }));
        event.end();
        view.layout(alloc.width, alloc.height);
        assertTrue(view.isAllocationValid());
        view.strategy.removeUpdate(view, event, alloc);
        assertTrue(view.isAllocationValid());
View Full Code Here

        assertFalse(view.isLayoutValid(Y_AXIS));
    }

    public void testChangedUpdate() {
        event = doc.new DefaultDocumentEvent(4, 5, EventType.CHANGE);
        event.addEdit(new ElementEdit(p1, 0, new Element[] { p1L }, new Element[] { p1L }));
        event.end();
        view.layout(alloc.width, alloc.height);
        assertTrue(view.isAllocationValid());
        view.strategy.changedUpdate(view, event, alloc);
        assertTrue(view.isAllocationValid());
View Full Code Here

TOP

Related Classes of javax.swing.text.AbstractDocument.ElementEdit

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.