Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [DataBinding] CRUD status - Best Practice
[DataBinding] CRUD status - Best Practice [message #320155] Wed, 12 September 2007 10:48 Go to next message
Eclipse UserFriend
I am now faced with the classic CRUD state problem.

If the user changes a value in the UI I need to enable the save button.

If a value in the UI is changed and then user selects New or Exit I want
to warn them the the current view has changed and is not saved.

Is there a Best Practice for this? It would seem the DataBindingContext
would know what model elements have changed but I can not see any hooks
for that.
Re: [DataBinding] CRUD status - Best Practice [message #320187 is a reply to message #320155] Wed, 12 September 2007 15:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse5.rizzoweb.com

Dave Smith wrote:
> I am now faced with the classic CRUD state problem.
>
> If the user changes a value in the UI I need to enable the save button.
>
> If a value in the UI is changed and then user selects New or Exit I want
> to warn them the the current view has changed and is not saved.
>
> Is there a Best Practice for this? It would seem the DataBindingContext
> would know what model elements have changed but I can not see any hooks
> for that.

I'm pretty sure that DataBinding is agnostic about dirty state tracking
[see EditorPart.isDirty()] and the related issue of undoable/redoable
operations (Commands).
Eclipse platform has API for both of those, but I use EMF and it has a
nice CommandStack that tracks dirty state and provides easy undo/redo
capability.

Hope this helps,
Eric
Re: [DataBinding] CRUD status - Best Practice [message #320287 is a reply to message #320155] Fri, 14 September 2007 23:31 Go to previous message
Eclipse UserFriend
> If the user changes a value in the UI I need to enable the save button.

For simple cases, it might be enough to listen to the UI observables for any
change after the bindings have been set up. Have a look at
WizardPageSupport, its implementation does exactly that (among other
things). It tracks all bindings of a data binding context and attaches a
change listeners to the target observable of each binding. Once one of these
fires a change event, the user must have done something in the UI.

I agree with Eric that using EMF on the model side helps.

Boris
Previous Topic:Copy resource from plugin into projects at runtime
Next Topic:Table and SWT.MULTI
Goto Forum:
  


Current Time: Fri May 09 21:25:46 EDT 2025

Powered by FUDForum. Page generated in 0.06380 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top