List of usage examples for javax.swing.undo CannotRedoException initCause
public synchronized Throwable initCause(Throwable cause)
From source file:ca.sqlpower.object.undo.PropertyChangeEdit.java
/** * Sets the value of the property to be the new value *//*from w w w . java 2 s. co m*/ @Override public void redo() throws CannotRedoException { logger.debug("Undoing Property change: Setting " + sourceEvent.getPropertyName() + " from " + sourceEvent.getOldValue() + " to " + sourceEvent.getNewValue()); super.redo(); try { Method setter = PropertyUtils.getWriteMethod( PropertyUtils.getPropertyDescriptor(sourceEvent.getSource(), sourceEvent.getPropertyName())); logger.info("Found setter: " + setter.getName()); setter.invoke(sourceEvent.getSource(), sourceEvent.getNewValue()); } catch (Exception ex) { CannotRedoException wrapper = new CannotRedoException(); wrapper.initCause(ex); throw wrapper; } }