Package javax.swing.event

Examples of javax.swing.event.UndoableEditListener


        }
       
        Document doc = pane.getDocument();
       
        // Listen for undo and redo events
        doc.addUndoableEditListener(new UndoableEditListener() {
            public void undoableEditHappened(UndoableEditEvent evt) {
                if (isUndoable()) {
                    undomanager.addEdit(evt.getEdit());
                }
            }
View Full Code Here


        }
      });

      // Listen for undo and redo events on the textArea
      txtHeader.getDocument().addUndoableEditListener(
          new UndoableEditListener() {
            public void undoableEditHappened(UndoableEditEvent evt) {
              undo.addEdit(evt.getEdit());
            }
          });
View Full Code Here

          }
        }
      });

      // Listen for undo and redo events on the textArea
      txtBody.getDocument().addUndoableEditListener(new UndoableEditListener() {
        public void undoableEditHappened(UndoableEditEvent evt) {
          undo.addEdit(evt.getEdit());
        }
      });
View Full Code Here

  private UndoManager undo = new UndoManager();

  UndoRedoSupport(JTextComponent textComponent) {
    undoAction = new UndoAction();
    redoAction = new RedoAction();
    textComponent.getDocument().addUndoableEditListener(new UndoableEditListener() {
      @Override
      public void undoableEditHappened(UndoableEditEvent e) {
        undo.addEdit(e.getEdit());
        undoAction.updateUndoState();
        redoAction.updateRedoState();
View Full Code Here

  private void makeUndoable(JTextComponent textComponent) {
    // code from: http://stackoverflow.com/a/12030993
    final UndoManager undoManager = new UndoManager();
    Document doc = textComponent.getDocument();
    doc.addUndoableEditListener(new UndoableEditListener() {
      @Override
      public void undoableEditHappened(UndoableEditEvent e) {
        //System.out.println("Add edit");
        undoManager.addEdit(e.getEdit());
      }
View Full Code Here

  void InitializeUndo() {

    // Taken from
    // http://www.java2s.com/Tutorial/Java/0240__Swing/AddingUndoandRedotoaTextComponent.htm
    Document doc = jTextArea1.getDocument();
    doc.addUndoableEditListener(new UndoableEditListener() {
        public void undoableEditHappened(UndoableEditEvent evt) {
            undo.addEdit(evt.getEdit());
        }
    });
View Full Code Here

                    catch (CannotUndoException ex) {
                    }
                }
            };

        UndoableEditListener undoListener = new UndoableEditListener() {
                public void undoableEditHappened(UndoableEditEvent e) {
                    undoManager.addEdit(e.getEdit());
                }
            };
View Full Code Here

            navigationToolBar = new NavigationToolBar();   
               
            // set up the undo manager
            extendedUndoManager = new ExtendedUndoManager();

            extendedUndoManager.addUndoableEditListener(new UndoableEditListener() {

                public void undoableEditHappened(UndoableEditEvent uee) {
                    // update the undo buttons whenever a new undoable event is added to the manager.
                    updateUndoWidgets();
                }
View Full Code Here

            if (dataModel.getUndoableEditListeners().length == 0)
            {
                // Persiste el bug, no ha sido arreglado pues hemos salvado alg�n listener
                for(int i = 0; i < undoListeners.length; i++)
                {
                    UndoableEditListener listener = undoListeners[i];
                    dataModel.addUndoableEditListener(listener);
                }
            }
        }
    }
View Full Code Here

        setBackground(Color.white);
        //setFont(new Font("Monospaced", Font.PLAIN, 12));
               
        // add undoable edit
        undoManager = new UndoManager();
        UndoableEditListener undoableEditHandler = new UndoableEditListener() {
            public void undoableEditHappened(UndoableEditEvent e) {
                undoManager.addEdit(e.getEdit());
            }
        };
        getDocument().addUndoableEditListener(undoableEditHandler);
View Full Code Here

TOP

Related Classes of javax.swing.event.UndoableEditListener

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.