org.eclipse.gef.mvc.fx.ui.parts

## Class HistoryBasedDirtyStateProvider

- java.lang.Object
- - org.eclipse.gef.mvc.fx.ui.parts.HistoryBasedDirtyStateProvider

All Implemented Interfaces:
  IDirtyStateProvider, org.eclipse.ui.services.IDisposable

    public class HistoryBasedDirtyStateProvider
    extends java.lang.Object
    implements IDirtyStateProvider, org.eclipse.ui.services.IDisposable

A support class to handle the dirty state of a `WorkbenchPart` that uses an `IOperationHistory` and an `IUndoContext`.

### Property Summary

All Methods Instance Methods Concrete Methods
`javafx.beans.property.ReadOnlyBooleanProperty` `dirty` A read-only property that provides the current dirty state.

### Constructor Summary

Constructors
Constructor and Description
`HistoryBasedDirtyStateProvider(org.eclipse.core.commands.operations.IOperationHistory operationHistory, org.eclipse.core.commands.operations.IUndoContext undoContext)` Creates a new `HistoryBasedDirtyStateProvider`.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected org.eclipse.core.commands.operations.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(org.eclipse.core.commands.operations.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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Property Detail

#### dirty

    public javafx.beans.property.ReadOnlyBooleanProperty dirtyProperty

Specified by:
  `dirtyProperty` in interface `IDirtyStateProvider`
Returns:
  A read-only boolean property.
See Also:
  `isDirty()`

### Constructor Detail

#### HistoryBasedDirtyStateProvider

    public HistoryBasedDirtyStateProvider(org.eclipse.core.commands.operations.IOperationHistory operationHistory,
                                          org.eclipse.core.commands.operations.IUndoContext undoContext)

Creates a new `HistoryBasedDirtyStateProvider`.

Parameters:
  `operationHistory` - The `IOperationHistory` to use.
  `undoContext` - The `IUndoContext` to evaluate.

### Method Detail

#### createOperationHistoryListener

    protected org.eclipse.core.commands.operations.IOperationHistoryListener createOperationHistoryListener()

Returns the `IOperationHistoryListener` that is to be used to update the dirty state of this editor.

Returns:
  The `IOperationHistoryListener` that is to be used to update the dirty state of this editor.

#### dirtyProperty

    public javafx.beans.property.ReadOnlyBooleanProperty dirtyProperty()

Description copied from interface: `IDirtyStateProvider`
A read-only property that provides the current dirty state.

Specified by:
  `dirtyProperty` in interface `IDirtyStateProvider`
Returns:
  A read-only boolean property.
See Also:
  `isDirty()`

#### dispose

    public void dispose()

Specified by:
  `dispose` in interface `org.eclipse.ui.services.IDisposable`

#### isContentsRelated

    protected boolean isContentsRelated(org.eclipse.core.commands.operations.IUndoableOperation operation)

Tests whether the given `IUndoableOperation` is relevant for the dirty-state of the editor.

Parameters:
  `operation` - The `IUndoableOperation` to test.
Returns:
  `true` if the operation encapsulates a dirty-state relevant change, `false` otherwise.

#### isDirty

    public boolean isDirty()

Gets the value of the property dirty.

Specified by:
  `isDirty` in interface `IDirtyStateProvider`
Returns:
  `true` if the source is dirty, `false` otherwise.

#### markNonDirty

    public void markNonDirty()

Description copied from interface: `IDirtyStateProvider`
Notifies the provider to mark the current state as being unchanged with respect to the saved state.

Specified by:
  `markNonDirty` in interface `IDirtyStateProvider`