info.magnolia.ui.mediaeditor.data
Interface EditHistoryTrackingProperty

All Superinterfaces:
com.vaadin.data.Property<byte[]>, Serializable
All Known Implementing Classes:
EditHistoryTrackingPropertyImpl

public interface EditHistoryTrackingProperty
extends com.vaadin.data.Property<byte[]>

Property interface that is capable of tracking data modification and undo/redo the steps. The original value is buffered and the state can always be rolled back to it.


Nested Class Summary
static interface EditHistoryTrackingProperty.Listener
          Listener interface that receives important information about the property workflow.
 
Nested classes/interfaces inherited from interface com.vaadin.data.Property
com.vaadin.data.Property.Editor, com.vaadin.data.Property.ReadOnlyException, com.vaadin.data.Property.ReadOnlyStatusChangeEvent, com.vaadin.data.Property.ReadOnlyStatusChangeListener, com.vaadin.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.data.Property.Transactional<T>, com.vaadin.data.Property.ValueChangeEvent, com.vaadin.data.Property.ValueChangeListener, com.vaadin.data.Property.ValueChangeNotifier, com.vaadin.data.Property.Viewer
 
Method Summary
 void commit()
          Propagate changes to the original value.
 String getLastDoneActionName()
          Gets the last done action name.
 String getLastUnDoneActionName()
          Gets the last undone action name.
 void purgeHistory()
          Clears modification history which erases all the tracked steps.
 void redo()
          Redo last step.
 void revert()
          Roll back to original value.
 void setCapacity(int capacity)
          Sets the amount of steps that can be tracked.
 void setListener(EditHistoryTrackingProperty.Listener listener)
           
 void startAction(String actionName)
          Starts an action which will cause a new record to appear in history.
 void undo()
          Undo last step.
 
Methods inherited from interface com.vaadin.data.Property
getType, getValue, isReadOnly, setReadOnly, setValue
 

Method Detail

setListener

void setListener(EditHistoryTrackingProperty.Listener listener)

getLastDoneActionName

String getLastDoneActionName()
Gets the last done action name.

Returns:
last action name.

getLastUnDoneActionName

String getLastUnDoneActionName()
Gets the last undone action name.

Returns:
last undone action name.

purgeHistory

void purgeHistory()
Clears modification history which erases all the tracked steps. After this method call it will be impossible to undo/redo operations.


setCapacity

void setCapacity(int capacity)
Sets the amount of steps that can be tracked. When the limit is reached, the eldest recorded steps are erased.

Parameters:
capacity - amount of steps to be available for undo/redo.

startAction

void startAction(String actionName)
Starts an action which will cause a new record to appear in history.

Parameters:
actionName - the name of an action.

undo

void undo()
          throws ActionExecutionException
Undo last step.

Throws:
ActionExecutionException

redo

void redo()
          throws ActionExecutionException
Redo last step.

Throws:
ActionExecutionException

commit

void commit()
Propagate changes to the original value.


revert

void revert()
Roll back to original value.



Copyright © 2013 Magnolia International Ltd.. All Rights Reserved.