Package javax.swing.undo

Examples of javax.swing.undo.UndoableEditSupport.addUndoableEditListener()


      Locale.setDefault(Locale.FRANCE);
      this.preferences = new DefaultUserPreferences();
      ViewFactory viewFactory = new SwingViewFactory();
      UndoableEditSupport undoSupport = new UndoableEditSupport();
      final UndoManager undoManager = new UndoManager();
      undoSupport.addUndoableEditListener(undoManager);
      this.planController = new PlanController(this.home, this.preferences, viewFactory, null, undoSupport);
      // Add plan component to frame at its preferred size
      add(new JScrollPane((JComponent)this.planController.getView()));
      // Create a toggle button for plan component mode
      this.modeButton = new JToggleButton(new ImageIcon(
View Full Code Here


    Locale.setDefault(Locale.FRANCE);
    UserPreferences preferences = new DefaultUserPreferences();
    ViewFactory viewFactory = new SwingViewFactory();
    UndoableEditSupport undoSupport = new UndoableEditSupport();
    UndoManager undoManager = new UndoManager();
    undoSupport.addUndoableEditListener(undoManager);
    PlanController planController =
        new PlanController(home, preferences, viewFactory, null, undoSupport);
   
    // Build an ordered list of walls added to home
    final ArrayList<Wall> orderedWalls = new ArrayList<Wall>();
View Full Code Here

                  + " compoundEdit: null");

    // Check #2.
    u.beginUpdate();
    u.beginUpdate();
    u.addUndoableEditListener(new MyListener());
    u.addUndoableEditListener(new MyListener());
    harness.check(u.toString(),
                  u.getClass().getName() + "@"
                  + Integer.toHexString(u.hashCode())
                  + " updateLevel: 2 listeners: [lily, lily]"
View Full Code Here

    // Check #2.
    u.beginUpdate();
    u.beginUpdate();
    u.addUndoableEditListener(new MyListener());
    u.addUndoableEditListener(new MyListener());
    harness.check(u.toString(),
                  u.getClass().getName() + "@"
                  + Integer.toHexString(u.hashCode())
                  + " updateLevel: 2 listeners: [lily, lily]"
                  + " compoundEdit: rose");
View Full Code Here

    // Check #1.
    l = ues.getUndoableEditListeners();
    harness.check((l != null) && (l.length == 0));

    // Check #2.
    ues.addUndoableEditListener(t1);
    l = ues.getUndoableEditListeners();
    harness.check((l != null) && (l.length == 1) && (l[0] == t1));

    // Check #3.
    ues.addUndoableEditListener(t2);
View Full Code Here

    ues.addUndoableEditListener(t1);
    l = ues.getUndoableEditListeners();
    harness.check((l != null) && (l.length == 1) && (l[0] == t1));

    // Check #3.
    ues.addUndoableEditListener(t2);
    l = ues.getUndoableEditListeners();
    harness.check(l != null && l.length == 2
                  && l[0] == t1 && l[1] == t2);

    // Check #4.
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.