Package javax.swing.undo

Examples of javax.swing.undo.CompoundEdit


  {
    synchronized( pendingEdits ) {
      if( pendingEditCount > 0 ) {
        pendingEdits.end();
        pendingEdits.undo();
        pendingEdits = new CompoundEdit();
        pendingEditCount = 0;
      }
    }
  }
View Full Code Here


   */
  public void discardAllEdits()
  {
    synchronized( pendingEdits ) {
      pendingEdits.die();
      pendingEdits = new CompoundEdit();
      pendingEditCount = 0;
    }
    super.discardAllEdits();
    updateStates();
  }
View Full Code Here

      span  = new Span( Math.min( position, selectionStart ),
                Math.max( position, selectionStart ));
      edit  = TimelineVisualEdit.select( this, doc, span ).perform();
        } else {
      if( altDrag ) {
        edit  = new CompoundEdit();
        edit.addEdit( TimelineVisualEdit.select( this, doc, new Span() ).perform() );
        edit.addEdit( TimelineVisualEdit.position( this, doc, position ).perform() );
        ((CompoundEdit) edit).end();
        altDrag = false;
      } else {
View Full Code Here

    }
   
    private void perform()
    {
      Span      selSpan;
      CompoundEdit  edit;
      long      pos;
   
      selSpan    = getSelectionSpan();
      if( selSpan.isEmpty() ) return;
     
      edit  = new BasicCompoundEdit();
      if( deselect ) edit.addEdit( TimelineVisualEdit.select( this, doc, new Span() ).perform() );
      pos    = (long) (selSpan.getStart() + selSpan.getLength() * weight + 0.5);
      edit.addEdit( TimelineVisualEdit.position( this, doc, pos ).perform() );
      edit.end();
      doc.getUndoManager().addEdit( edit );
    }
View Full Code Here

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

                CompoundEdit compoundEdit = new RemoveCompoundUndoableEdit();

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

                application.getUndoManager().addEdit(compoundEdit);

            }
View Full Code Here

    }
  }

  private void newCurrentCompoundEdit() {
    // Set current compound edit to a new one
    currentCompoundEdit = new CompoundEdit() {
      // Make sure canUndo() and canRedo() works
      @Override
      public boolean isInProgress() {
        return false;
      }
View Full Code Here

    }

    private void handleEdit(UndoableEdit edit) {
        if (isBulkChange) {
            if (compoundEdit == null) {
                compoundEdit = new CompoundEdit();
            }
            compoundEdit.addEdit(edit);
        } else {
            fireUndoableEdit(edit);
        }
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));
                }
                compoundEdit.end();

                application.getUndoManager().addEdit(compoundEdit);

            }
        }
View Full Code Here

  void startCompoundEdit()
  {
      if(compoundMode) {
        throw new RuntimeException("already in compound mode");
      }
      ce = new CompoundEdit();
      compoundMode = true;
  }
View Full Code Here

        if (type == old) {
            return;
        }
        boolean sendEdit = false;
        if (currentEdit == null) {
            currentEdit = new CompoundEdit();
            sendEdit = true;
        }
        OperationId oldResponseGenerator = getResponseGenerator();
        setResponseTypeImpl(type, false);
        OperationId newResponseGenerator = getResponseGenerator();
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.