public class HistoryBasedDirtyStateProvider extends java.lang.Object implements IDirtyStateProvider, IDisposable
WorkbenchPart
that
uses an IOperationHistory
and an IUndoContext
.Type | Property and Description |
---|---|
javafx.beans.property.ReadOnlyBooleanProperty |
dirty
A read-only property that provides the current dirty state.
|
Constructor and Description |
---|
HistoryBasedDirtyStateProvider(IOperationHistory operationHistory,
IUndoContext undoContext)
Creates a new
HistoryBasedDirtyStateProvider . |
Modifier and Type | Method and Description |
---|---|
protected IOperationHistoryListener |
createOperationHistoryListener()
Returns the
IOperationHistoryListener that is to be used to
update the dirty state of this editor. |
javafx.beans.property.ReadOnlyBooleanProperty |
dirtyProperty()
A read-only property that provides the current dirty state.
|
void |
dispose() |
protected boolean |
isContentsRelated(IUndoableOperation operation)
Tests whether the given
IUndoableOperation is relevant for the
dirty-state of the editor. |
boolean |
isDirty()
Gets the value of the property dirty.
|
void |
markNonDirty()
Notifies the provider to mark the current state as being unchanged with
respect to the saved state.
|
public javafx.beans.property.ReadOnlyBooleanProperty dirtyProperty
dirtyProperty
in interface IDirtyStateProvider
isDirty()
public HistoryBasedDirtyStateProvider(IOperationHistory operationHistory, IUndoContext undoContext)
HistoryBasedDirtyStateProvider
.operationHistory
- The IOperationHistory
to use.undoContext
- The IUndoContext
to evaluate.protected IOperationHistoryListener createOperationHistoryListener()
IOperationHistoryListener
that is to be used to
update the dirty state of this editor.IOperationHistoryListener
that is to be used to
update the dirty state of this editor.public javafx.beans.property.ReadOnlyBooleanProperty dirtyProperty()
IDirtyStateProvider
dirtyProperty
in interface IDirtyStateProvider
isDirty()
public void dispose()
dispose
in interface IDisposable
protected boolean isContentsRelated(IUndoableOperation operation)
IUndoableOperation
is relevant for the
dirty-state of the editor.operation
- The IUndoableOperation
to test.true
if the operation encapsulates a dirty-state
relevant change, false
otherwise.public boolean isDirty()
isDirty
in interface IDirtyStateProvider
true
if the source is dirty, false
otherwise.public void markNonDirty()
IDirtyStateProvider
markNonDirty
in interface IDirtyStateProvider
Copyright (c) 2014, 2016 itemis AG and others. All rights reserved.