Package javax.swing.undo

Examples of javax.swing.undo.AbstractUndoableEdit


    private void postEdit( final CropBounds newBounds, final String name,
                           final boolean significant ) {
        final CropBounds oldBounds = bounds;
        bounds = newBounds;
        UndoableEdit edit = new AbstractUndoableEdit() {
            public String getPresentationName() {
                return name;
            }
            public void undo() {
                super.undo();
View Full Code Here


        setSelection(control);

        control.addUndoableEditListener(this);

        if (! undoSupport.isRestoring()) {
            UndoableEdit edit = new AbstractUndoableEdit() {
                public String getPresentationName() {
                    String name = control.getTitleText();
                    return LOCALE.get("AddToolEditName", name);
                }
                public void undo() {
View Full Code Here

        engine.removeOperation(index);

        opControl.removeUndoableEditListener(this);

        if (! undoSupport.isRestoring()) {
            UndoableEdit edit = new AbstractUndoableEdit() {
                public String getPresentationName() {
                    String name = opControl.getTitleText();
                    return LOCALE.get("RemoveToolEditName", name);
                }
                public void undo() {
View Full Code Here

        if (control.isContentShown()) {
            return;
        }
        control.setShowContent(true);
        if (! undoSupport.isRestoring()) {
            UndoableEdit edit = new AbstractUndoableEdit() {
                public String getPresentationName() {
                    return LOCALE.get("ExpandToolEditName");
                }
                public boolean isSignificant() {
                    return false;
View Full Code Here

        if (! control.isContentShown()) {
            return;
        }
        control.setShowContent(false);
        if (! undoSupport.isRestoring()) {
            UndoableEdit edit = new AbstractUndoableEdit() {
                public String getPresentationName() {
                    return LOCALE.get("CollapseToolEditName");
                }
                public boolean isSignificant() {
                    return false;
View Full Code Here

            // gesture, then sync the DraggableStack layout manually:
            JComponent upper = pop(index);
            push(upper, index + 1);
        }
        if (! undoSupport.isRestoring()) {
            UndoableEdit edit = new AbstractUndoableEdit() {
                public String getPresentationName() {
                    return LOCALE.get("SwapToolEditName");
                }
                public void undo() {
                    super.undo();
View Full Code Here

        // Push an insignificant selection-change edit onto the stack.
        // (Undoing the operations without undoing the regions is confusing.)
        if (! undoSupport.isRestoring()) {
            undoSupport.postEdit(
                new AbstractUndoableEdit() {
                    public String getPresentationName() {
                        return LOCALE.get("ToolSelectionEditName");
                    }
                    public boolean isSignificant() {
                        return false;
View Full Code Here

            return null;
        }
    };

    public void testFireUndoableEditUpdate() {
        UndoableEditEvent undoEvent = new UndoableEditEvent(doc, new AbstractUndoableEdit());
        doc.addUndoableEditListener(this);
        doc.fireUndoableEditUpdate(undoEvent);
        checkCalledEvents(false, false, false, true);
        assertSame(undoEvent, undo);
    }
View Full Code Here

  {
    CompoundEdit edit;

    // Check #1.
    edit = new CompoundEdit();
    edit.addEdit(new AbstractUndoableEdit());
    harness.check(!edit.canRedo());

    // Check #2.
    edit.end();
    harness.check(!edit.canRedo());
View Full Code Here


  public void test(TestHarness harness)
  {
    MyCompoundEdit edit;
    AbstractUndoableEdit e1, e2;

    // Check #1.
    edit = new MyCompoundEdit();
    harness.check(edit.getLast() == null);

    // Check #2.
    edit.addEdit(e1 = new AbstractUndoableEdit());
    harness.check(edit.getLast() == e1);

    // Check #3.
    edit.addEdit(e2 = new AbstractUndoableEdit());
    harness.check(edit.getLast() == e2);
  }
View Full Code Here

TOP

Related Classes of javax.swing.undo.AbstractUndoableEdit

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.