Examples of canUndo()


Examples of org.eclipse.core.commands.operations.IUndoableOperation.canUndo()

      // record the current valid state for the top operation in case it remains the
      // top operation but changes state.
      IUndoableOperation op= fHistory.getUndoOperation(fUndoContext);
      boolean wasValid= false;
      if (op != null)
        wasValid= op.canUndo();
      // Process the change, providing the before and after timestamps
      processChange(event.getOffset(), event.getOffset() + event.getLength(), event.getText(), fReplacedText, fPreservedUndoModificationStamp, fPreservedRedoModificationStamp);

      // now update fCurrent with the latest buffers from the document change.
      fCurrent.pretendCommit();
View Full Code Here

Examples of org.eclipse.emf.common.command.CommandStack.canUndo()

  ContactsManager contactsManager;
 
  @CanExecute
  public boolean canUndo() {
    CommandStack commandStack = contactsManager.getEditingDomain().getCommandStack();
    return commandStack.canUndo();
  }

  @Execute
  public void undo() {
    CommandStack commandStack = contactsManager.getEditingDomain().getCommandStack();
View Full Code Here

Examples of org.eclipse.gef.commands.Command.canUndo()

   * @see org.eclipse.gef.commands.CommandStack#canUndo()
   */
  @Override
  public boolean canUndo() {
    Command c = getUndoCommand();
    return (c != null) && c.canUndo();
  }

 
  /**
   * @see org.eclipse.gef.commands.CommandStack#getRedoCommand()
View Full Code Here

Examples of org.enhydra.jawe.UndoHistoryManager.canUndo()

    }

    public void enableDisableAction() {
        JaWEController jc = JaWEManager.getInstance().getJaWEController();
        UndoHistoryManager um = jc.getUndoHistoryManager();
        setEnabled(um.canUndo());
    }

    public void actionPerformed(ActionEvent e) {
        JaWEController jc = JaWEManager.getInstance().getJaWEController();
        jc.undo();
View Full Code Here

Examples of org.evolizer.daforjava.commands.CommandController.canUndo()

    @Test
    public void undoRedoShowClassPlanet() {
        showClassPlanet();
       
        CommandController commandController = fGraphPanel.getCommandController();
        Assert.assertEquals("Command controller must be able to undo the last command ", true, commandController.canUndo());
       
        commandController.undoCommand();
        Assert.assertEquals("Graph must not contain nodes after undo", 0, fGraphPanel.getGraph().nodeCount());
        Assert.assertEquals("Graph must not contain edges after undo", 0, fGraphPanel.getGraph().edgeCount());
        Assert.assertEquals("There should be no more command to be undone", false, commandController.canUndo());
View Full Code Here

Examples of org.evolizer.daforjava.commands.CommandController.canUndo()

        Assert.assertEquals("Command controller must be able to undo the last command ", true, commandController.canUndo());
       
        commandController.undoCommand();
        Assert.assertEquals("Graph must not contain nodes after undo", 0, fGraphPanel.getGraph().nodeCount());
        Assert.assertEquals("Graph must not contain edges after undo", 0, fGraphPanel.getGraph().edgeCount());
        Assert.assertEquals("There should be no more command to be undone", false, commandController.canUndo());
       
        Assert.assertEquals("Command controller must be able to redo the last command ", true, commandController.canRedo());
        commandController.redoCommand();
        Assert.assertEquals("There should be no more command to be redone", false, commandController.canRedo());
       
View Full Code Here

Examples of org.evolizer.daforjava.commands.CommandController.canUndo()

            if (!controller.canRedo()) {
                fRedoButton.setEnabled(false);
            } else {
                fRedoButton.setEnabled(true);
            }
            if (!controller.canUndo()) {
                fUndoButton.setEnabled(false);
            } else {
                fUndoButton.setEnabled(true);
            }
        }
View Full Code Here

Examples of org.freeplane.core.undo.IUndoHandler.canUndo()

          mapViewManager.close(true);
          Controller.setCurrentController(AEditStylesAction.this.controller);
          super.componentHidden(e);
          switch (modeController.getStatus()) {
            case JOptionPane.OK_OPTION:
              if (undoHandler.canUndo()) {
                commit();
                break;
              }
            case JOptionPane.CANCEL_OPTION:
              rollback();
View Full Code Here

Examples of org.freeplane.core.undo.IUndoHandler.canUndo()

  void tryToCloseDialog() {
      final IMapViewManager mapViewManager = getController().getMapViewManager();
      final MapModel map = mapViewManager.getModel();
      final IUndoHandler undoHandler = (IUndoHandler) map.getExtension(IUndoHandler.class);
      final Window dialog = ((DialogController) getController().getViewController()).getDialog();
      if (! undoHandler.canUndo()){
        dialog.setVisible(false);
        return;
      }
      final String text = TextUtils.getText("save_unsaved_styles");
      final String title = TextUtils.getText("SaveAction.text");
View Full Code Here

Examples of org.freeplane.core.undo.IUndoHandler.canUndo()

        }
        final Object eventSource = e.getSource();
        if (!eventSource.equals(undoHandler)) {
          return;
        }
        setEnabled(undoHandler.canUndo());
        redo.setEnabled(undoHandler.canRedo());
      }
    };
  }
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.