Package org.eclipse.gef.mvc.fx.ui.parts
Class HistoryBasedDirtyStateProvider
- java.lang.Object
-
- org.eclipse.gef.mvc.fx.ui.parts.HistoryBasedDirtyStateProvider
-
- All Implemented Interfaces:
IDirtyStateProvider,IDisposable
public class HistoryBasedDirtyStateProvider extends java.lang.Object implements IDirtyStateProvider, IDisposable
A support class to handle the dirty state of aWorkbenchPartthat uses anIOperationHistoryand anIUndoContext.
-
-
Constructor Summary
Constructors Constructor Description HistoryBasedDirtyStateProvider(IOperationHistory operationHistory, IUndoContext undoContext)Creates a newHistoryBasedDirtyStateProvider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IOperationHistoryListenercreateOperationHistoryListener()Returns theIOperationHistoryListenerthat is to be used to update the dirty state of this editor.javafx.beans.property.ReadOnlyBooleanPropertydirtyProperty()A read-only property that provides the current dirty state.voiddispose()protected booleanisContentsRelated(IUndoableOperation operation)Tests whether the givenIUndoableOperationis relevant for the dirty-state of the editor.booleanisDirty()Returns the dirty state of this support.voidmarkNonDirty()Notifies the provider to mark the current state as being unchanged with respect to the saved state.
-
-
-
Constructor Detail
-
HistoryBasedDirtyStateProvider
public HistoryBasedDirtyStateProvider(IOperationHistory operationHistory, IUndoContext undoContext)
Creates a newHistoryBasedDirtyStateProvider.- Parameters:
operationHistory- TheIOperationHistoryto use.undoContext- TheIUndoContextto evaluate.
-
-
Method Detail
-
createOperationHistoryListener
protected IOperationHistoryListener createOperationHistoryListener()
Returns theIOperationHistoryListenerthat is to be used to update the dirty state of this editor.- Returns:
- The
IOperationHistoryListenerthat is to be used to update the dirty state of this editor.
-
dirtyProperty
public javafx.beans.property.ReadOnlyBooleanProperty dirtyProperty()
Description copied from interface:IDirtyStateProviderA read-only property that provides the current dirty state.- Specified by:
dirtyPropertyin interfaceIDirtyStateProvider- Returns:
- A read-only boolean property.
-
dispose
public void dispose()
- Specified by:
disposein interfaceIDisposable
-
isContentsRelated
protected boolean isContentsRelated(IUndoableOperation operation)
Tests whether the givenIUndoableOperationis relevant for the dirty-state of the editor.- Parameters:
operation- TheIUndoableOperationto test.- Returns:
trueif the operation encapsulates a dirty-state relevant change,falseotherwise.
-
isDirty
public boolean isDirty()
Description copied from interface:IDirtyStateProviderReturns the dirty state of this support.- Specified by:
isDirtyin interfaceIDirtyStateProvider- Returns:
trueif the source is dirty,falseotherwise.
-
markNonDirty
public void markNonDirty()
Description copied from interface:IDirtyStateProviderNotifies the provider to mark the current state as being unchanged with respect to the saved state.- Specified by:
markNonDirtyin interfaceIDirtyStateProvider
-
-