Java 8 CannotRedoException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 CannotRedoException class.

This code example shows how to use the following methods:
     * @throws CannotRedoException if redo operation cannot be performed 
     */ 
    public void redo() { 
        // only check the action can be redo or not 
        if (!this.canRedo()) {
            throw new CannotRedoException();
        } 
    } 
 
    /** 
     * <p> 
     * Undo the action represented by this component. 
     * </p> 
     * 
     * <p> 
     * This method will only check if undo is allowed, otherwise CannotUndoException will be thrown. 
     * </p> 
     * 
     * <p> 
     * Subclasses of this class should provide the actual implementation of this method. 
3
CodeRank
This code example shows how to use the following methods:
     */ 
    @Override 
    public void redo() throws CannotRedoException
    { 
        if (!canRedo()) 
            throw new CannotRedoException();
 
        hasBeenDone = true;
    } 
 
    @Override 
    public boolean canRedo() 
    { 
        // checkIsAlive(); 
        return alive && !hasBeenDone;
    } 
 
    /* 
     * This default implementation returns false. 
     */ 
3
CodeRank
This code example shows how to use the following methods:printStackTrace
            return; 
 
        try { 
            undoManager.redo();
        } catch (CannotRedoException ex) {
            ex.printStackTrace();
        } 
        updateRedoState(); 
        undoAction.updateUndoState();
    } 
 
    protected void updateRedoState() { 
        if (undoManager.canRedo()) {
            setEnabled(true);
            putValue(Action.NAME, undoManager.getRedoPresentationName());
        } else { 
            setEnabled(false);
            putValue(Action.NAME, "Redo");
        } 
    } 
3
CodeRank
This code example shows how to use the following methods:
     *             element. 
     * 
     */ 
    public void redo() { 
        if (!undone || !diagram.removeContained(element)) { 
            throw new CannotRedoException(); 
        } 
 
    } 
 
    /** 
     * <p> 
     * This action never accept other edit to be added to this. So this method will 
     * just return false. 
     * </p> 
     * 
     * @param anEdit 
     *            The <code>UndoableEdit</code> to be added 
     * @return always false 
     * 
3
CodeRank
This code example shows how to use the following methods:
                JOptionPane.showMessageDialog(gemCutter, "Error reloading functional agent: " + fanpe.getEntityName(), 
                        "Reload error", JOptionPane.WARNING_MESSAGE);
            } 
            gemCutter.recompileWorkspace(true);
        } else { 
            throw new CannotRedoException();
        } 
    } 
 
    /** 
     * Undo the edit. 
     */ 
    @Override 
    public void undo() throws CannotUndoException {        
        super.undo(); 
         
        RenameRefactoringDialog renameDialog = new RenameRefactoringDialog(gemCutter, gemCutter.getWorkspaceManager(), gemCutter.getPerspective(), (QualifiedName.make(moduleName, newName)).getQualifiedName(), oldName, entityType, true, false);        
        renameDialog.setTitle(GemCutter.getResourceString("UndoText_UndoRenameDialogTitle"));
         
        // Display refactoring dialog and recompile dirty modules if any changes are made 
3
CodeRank
This code example shows how to use the following methods:
        return layerUndo != null && editedLayer != null;
    } 
 
    public void redo() throws CannotRedoException {
        if (editedLayer == null) {
            throw new CannotRedoException();
        } 
        layerRedo.copyTo(editedLayer);
    } 
 
    public boolean canRedo() { 
        return layerRedo != null && editedLayer != null;
    } 
 
    public void die() { 
        layerUndo = null;
        layerRedo = null;
        inProgress = false;
    } 
 
3
CodeRank
This code example shows how to use the following methods:
        figure.changed(); 
    } 
    @Override 
    public void redo() { 
        if (!canRedo()) { 
            throw new CannotRedoException(); 
        } 
        figure.willChange(); 
        super.redo(); 
        figure.changed(); 
    } 
} 
3
CodeRank
See Code Examples for Java 8 CannotRedoException Methods: