Skip to content

Commit b4ce354

Browse files
Merge pull request #669 from JordanMartinez/updateDependencies
Update dependencies: WellBehavedFX and UndoFX
2 parents 6e41a19 + 255d9af commit b4ce354

3 files changed

Lines changed: 20 additions & 17 deletions

File tree

richtextfx/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ if (gradle.gradleVersion.substring(0, 1) >= "4") {
2626
}
2727
dependencies {
2828
compile group: 'org.reactfx', name: 'reactfx', version: '2.0-M5'
29-
compile group: 'org.fxmisc.undo', name: 'undofx', version: '1.3.1'
29+
compile group: 'org.fxmisc.undo', name: 'undofx', version: '1.4.0'
3030
compile group: 'org.fxmisc.flowless', name: 'flowless', version: '0.6'
31-
compile group: 'org.fxmisc.wellbehaved', name: 'wellbehavedfx', version: '0.3'
31+
compile group: 'org.fxmisc.wellbehaved', name: 'wellbehavedfx', version: '0.3.1'
3232

3333
testCompile group: 'junit', name: 'junit', version: '4.12'
3434

richtextfx/src/main/java/org/fxmisc/richtext/util/UndoManagerInactivityWrapper.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* after a specified period of time.
1515
*
1616
* @param <C> the type of change the UndoManager can undo/redo
17+
* @deprecated No longer needed since UndoFX 1.4.0. Will be removed in future release.
1718
*/
1819
final class UndoManagerInactivityWrapper<C> implements UndoManager<C> {
1920

@@ -51,6 +52,11 @@ public boolean isUndoAvailable() {
5152
return delegate.isUndoAvailable();
5253
}
5354

55+
@Override
56+
public Val<C> nextUndoProperty() {
57+
return delegate.nextUndoProperty();
58+
}
59+
5460
@Override
5561
public Val<C> nextToUndoProperty() {
5662
return delegate.nextToUndoProperty();
@@ -61,6 +67,11 @@ public C getNextToUndo() {
6167
return delegate.getNextToUndo();
6268
}
6369

70+
@Override
71+
public Val<C> nextRedoProperty() {
72+
return delegate.nextRedoProperty();
73+
}
74+
6475
@Override
6576
public Val<C> nextToRedoProperty() {
6677
return delegate.nextToRedoProperty();

richtextfx/src/main/java/org/fxmisc/richtext/util/UndoUtils.java

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
/**
1515
* A class filled with factory methods to help easily construct an {@link UndoManager} for a {@link GenericStyledArea}.
1616
*
17-
* <p>
18-
* To create an UndoManager that will prevent incoming changes from merging with the previous one after a period
19-
* of user inactivity (via {@link UndoManager#preventMerge()}),
20-
* use {@link #wrap(UndoManager, EventStream, Duration)}.
21-
* </p>
2217
*/
2318
public final class UndoUtils {
2419

@@ -84,11 +79,8 @@ public static <PS, SEG, S> UndoManager<RichTextChange<PS, SEG, S>> richTextUndoM
8479
public static <PS, SEG, S> UndoManager<RichTextChange<PS, SEG, S>> richTextUndoManager(GenericStyledArea<PS, SEG, S> area,
8580
UndoManagerFactory factory,
8681
Duration preventMergeDelay) {
87-
return wrap(
88-
factory.create(area.richChanges(), TextChange::invert, applyRichTextChange(area), TextChange::mergeWith, TextChange::isIdentity),
89-
area.richChanges(),
90-
preventMergeDelay
91-
);
82+
return factory.create(area.richChanges(), TextChange::invert, applyRichTextChange(area),
83+
TextChange::mergeWith, TextChange::isIdentity, preventMergeDelay);
9284
};
9385

9486
/**
@@ -128,11 +120,8 @@ public static <PS, SEG, S> UndoManager<PlainTextChange> plainTextUndoManager(Gen
128120
public static <PS, SEG, S> UndoManager<PlainTextChange> plainTextUndoManager(GenericStyledArea<PS, SEG, S> area,
129121
UndoManagerFactory factory,
130122
Duration preventMergeDelay) {
131-
return wrap(
132-
factory.create(area.plainTextChanges(), TextChange::invert, applyPlainTextChange(area), TextChange::mergeWith, TextChange::isIdentity),
133-
area.plainTextChanges(),
134-
preventMergeDelay
135-
);
123+
return factory.create(area.plainTextChanges(), TextChange::invert, applyPlainTextChange(area),
124+
TextChange::mergeWith, TextChange::isIdentity, preventMergeDelay);
136125
}
137126

138127
/* ********************************************************************** *
@@ -162,7 +151,10 @@ public static <PS, SEG, S> Consumer<RichTextChange<PS, SEG, S>> applyRichTextCha
162151
/**
163152
* Wraps an {@link UndoManager} and prevents the next emitted change from merging with the previous one are a
164153
* period of inactivity (i.e., the {@code changeStream} has not emitted an event in {@code preventMergeDelay}
154+
*
155+
* @deprecated No longer needed since UndoFX 1.4.0
165156
*/
157+
@Deprecated
166158
public static <T> UndoManager<T> wrap(UndoManager<T> undoManager, EventStream<T> changeStream, Duration preventMergeDelay) {
167159
return new UndoManagerInactivityWrapper<>(undoManager, changeStream, preventMergeDelay);
168160
}

0 commit comments

Comments
 (0)