Package javax.swing.undo

Examples of javax.swing.undo.CompoundEdit


  implements Testlet
{
  public void test(TestHarness harness)
  {
    MyUES ues;
    CompoundEdit cedit;

    ues = new MyUES();

    // Check #1 and #2: Pre-requisites.
    harness.check(ues.getCompoundEdit(), null);
View Full Code Here


        } else {
          startPos = position;
          if( span2.isEmpty() ) {
            edit = TimelineVisualEdit.position( this, doc, position ).perform();
          } else {
            edit = new CompoundEdit();
            edit.addEdit( TimelineVisualEdit.select( this, doc, new Span() ).perform() );
            edit.addEdit( TimelineVisualEdit.position( this, doc, position ).perform() );
            ((CompoundEdit) edit).end();
          }
        }
View Full Code Here

      switch( mode ) {
      case SCROLL_SESSION_START:
        if( timelinePos != 0 ) {
          edit  = TimelineVisualEdit.position( this, doc, 0 ).perform();
          if( !timelineVis.contains( 0 )) {
            final CompoundEdit ce  = new BasicCompoundEdit();
            ce.addEdit( edit );
            newSpan  = new Span( 0, timelineVis.getLength() );
            ce.addEdit( TimelineVisualEdit.scroll( this, doc, newSpan ).perform() );
            ce.end();
            edit  = ce;
          }
        }
        break;
       
View Full Code Here

        else if (mediator.getCurrentPaths() != null) { // multiple deletion
            if (dialog.shouldDelete("selected objects")) {
                Object[] paths = mediator.getCurrentPaths();

                CompoundEdit compoundEdit = new RemoveCompoundUndoableEdit();

                for (Object path : paths) {
                    compoundEdit.addEdit(removeLastPathComponent(path));
                }

                application.getUndoManager().addEdit(compoundEdit);

            }
View Full Code Here

    protected class TextPaneUndoableEditListener implements UndoableEditListener {
        public void undoableEditHappened(UndoableEditEvent e) {
            if(!isEnabled())
                return;

            CompoundEdit groupEdit = getUndoGroup();
            if(groupEdit == null)
                addEditEvent(e.getEdit());
            else
                groupEdit.addEdit(e.getEdit());
        }
View Full Code Here

        else if (mediator.getCurrentPaths() != null) { // multiple deletion
            if (dialog.shouldDelete("selected objects")) {
                Object[] paths = mediator.getCurrentPaths();

                CompoundEdit compoundEdit = new RemoveCompoundUndoableEdit();

                for (Object path : paths) {
                    compoundEdit.addEdit(removeLastPathComponent(path));
                }

                application.getUndoManager().addEdit(compoundEdit);

            }
View Full Code Here

        } else {
          startPos = position;
          if( span2.isEmpty() ) {
            edit = TimelineVisualEdit.position( this, doc, position ).perform();
          } else {
            edit = new CompoundEdit();
            edit.addEdit( TimelineVisualEdit.select( this, doc, new Span() ).perform() );
            edit.addEdit( TimelineVisualEdit.position( this, doc, position ).perform() );
            ((CompoundEdit) edit).end();
          }
        }
View Full Code Here

      switch( mode ) {
      case SCROLL_SESSION_START:
        if( timelinePos != 0 ) {
          edit  = TimelineVisualEdit.position( this, doc, 0 ).perform();
          if( !timelineVis.contains( 0 )) {
            final CompoundEdit ce  = new BasicCompoundEdit();
            ce.addEdit( edit );
            newSpan  = new Span( 0, timelineVis.getLength() );
            ce.addEdit( TimelineVisualEdit.scroll( this, doc, newSpan ).perform() );
            ce.end();
            edit  = ce;
          }
        }
        break;
       
View Full Code Here

    this.doc  = doc;
    undoText  = doc.getApplication().getResourceString( "menuUndo" );
    redoText  = doc.getApplication().getResourceString( "menuRedo" );
    undoAction  = createUndoAction();
    redoAction  = createRedoAction();
    pendingEdits= new CompoundEdit();
    updateStates();
  }
View Full Code Here

    if( anEdit.isSignificant() ) {
      synchronized( pendingEdits ) {
        if( pendingEditCount > 0 ) {
          pendingEdits.end();
          super.addEdit( pendingEdits );
          pendingEdits = new CompoundEdit();
          pendingEditCount = 0;
        }
      }
      final boolean result = super.addEdit( anEdit );
      updateStates();
View Full Code Here

TOP

Related Classes of javax.swing.undo.CompoundEdit

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.