Java Code Examples for javax.swing.undo.CannotUndoException#printStackTrace()

The following examples show how to use javax.swing.undo.CannotUndoException#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HTMLEditPanel.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
public void actionPerformed(final ActionEvent e) {
    if (!undoMngr.canUndo())
        return;
    try {
        undoMngr.undo();
    } catch (final CannotUndoException ex) {
        ex.printStackTrace();
    }
    updateUndoState();
    redoAction.updateRedoState();
}
 
Example 2
Source File: HTMLEditPanel.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
public void actionPerformed(final ActionEvent e) {
    if (!undoMngr.canRedo())
        return;
    try {
        undoMngr.redo();
    } catch (final CannotUndoException ex) {
        ex.printStackTrace();
    }
    updateRedoState();
    undoAction.updateUndoState();
}
 
Example 3
Source File: CommandUndo.java    From Robot-Overlord-App with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
    try {
        undo.undo();
    } catch (CannotUndoException ex) {
        Log.message("Unable to undo: " + ex);
        ex.printStackTrace();
    }
    updateUndoState();
    if(redoAction!=null) redoAction.updateRedoState();
}
 
Example 4
Source File: UndoAction.java    From gameserver with Apache License 2.0 5 votes vote down vote up
@Override
public void actionPerformed(ActionEvent e) {
	if ( undoManager.canUndo() ) {
		try {
			undoManager.undo();
		} catch (CannotUndoException e1) {
			e1.printStackTrace();
		}
		updateUndoStatus();
	} else {
		Toolkit.getDefaultToolkit().beep();
	}
}
 
Example 5
Source File: MainPanel.java    From java-swing-tips with MIT License 5 votes vote down vote up
@Override public void actionPerformed(ActionEvent e) {
  try {
    undoManager.undo();
  } catch (CannotUndoException ex) {
    ex.printStackTrace();
    Toolkit.getDefaultToolkit().beep();
  }
}
 
Example 6
Source File: HTMLDocumentEditor.java    From egdownloader with GNU General Public License v2.0 5 votes vote down vote up
public void actionPerformed(ActionEvent e) {
	try {
		undo.undo();
	} catch (CannotUndoException ex) {
		System.out.println("Unable to undo: " + ex);
		ex.printStackTrace();
	}
	update();
	redoAction.update();
}
 
Example 7
Source File: RedoCommand.java    From niftyeditor with Apache License 2.0 5 votes vote down vote up
@Override
public void perform() throws Exception {
    try{
        manager.redo();
    }catch(CannotUndoException ex){
        ex.printStackTrace(); 
    }
}
 
Example 8
Source File: UndoCommand.java    From niftyeditor with Apache License 2.0 5 votes vote down vote up
@Override
public void perform() throws Exception {
    try{
        manager.undo();
    }catch(CannotUndoException ex){
        ex.printStackTrace(); 
    }
}