FXMisc / UndoFX

Undo manager for JavaFX
BSD 2-Clause "Simplified" License
99 stars 17 forks source link

Support for inspecting the change queue. #17

Closed dlemmermann closed 7 years ago

dlemmermann commented 7 years ago

It would be nice if changes could be named so that an undo / redo UI could display the name of the last change that will be undone or redone, e.g. "Undo 'Move Object'".

TomasMikula commented 7 years ago

I suppose that rather than any support for naming changes, we need a way to iterate over the changes in the queue. How one then extracts a name from a change is up to the user and the type of the change.

dlemmermann commented 7 years ago

That would be good, too. But for UI purposes it would be more convenient if a button or menu item could bind itself to a property. Tomas Mikula notifications@github.com schrieb am Mi. 26. Apr. 2017 um 04:45:

I suppose that rather than any support for naming changes, we need a way to iterate over the changes in the queue. How one then extracts a name from a change is up to the user and the type of the change.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TomasMikula/UndoFX/issues/17#issuecomment-297221823, or mute the thread https://github.com/notifications/unsubscribe-auth/AJF7XW9_zRnsyeoUkwYdiWm-XPk1uHeqks5rzq-tgaJpZM4NHUwX .

TomasMikula commented 7 years ago

If you only want to display a single item to undo/redo, then a property makes sense 👍

Something like

public Val<C> nextToUndoProperty();
public Val<C> nextToRedoProperty();
dlemmermann commented 7 years ago

Yes, something like that.

Am 26.04.2017 um 22:22 schrieb Tomas Mikula notifications@github.com:

If you only want to display a single item to undo/redo, then a property makes sense 👍

Something like

public Val nextToUndoProperty(); public Val nextToRedoProperty(); — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TomasMikula/UndoFX/issues/17#issuecomment-297530007, or mute the thread https://github.com/notifications/unsubscribe-auth/AJF7XYzKu2P5nVVhz4ee09kLgo6bp245ks5rz6eWgaJpZM4NHUwX.

TomasMikula commented 7 years ago

Available in release 1.3.0.

dlemmermann commented 7 years ago

Awesome, thanks!

dlemmermann commented 7 years ago

I think your commit failed. I can't see the new properties (nextToUndo(), nextToRedo()) in 1.3. Also, what is the best way to bind a boolean property to the new Val return types of undo/redoAvailableProperty()?

TomasMikula commented 7 years ago

Ah, you are right, silly me! I implemented them but forgot to put them on public API.

what is the best way to bind a boolean property to the new Val return types

Just plain old bind should work, as in the demo.

TomasMikula commented 7 years ago

Should be all fixed in 1.3.1.