Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » [Databinding] IBindingListener removed in 3.3M6
[Databinding] IBindingListener removed in 3.3M6 [message #314020] Sat, 31 March 2007 09:37 Go to next message
Eclipse UserFriend
Hi,

I'm using databinding features in some form editors. In 3.3M5, I made
these editors implementing IBindingEvent so it can detect model changes
and simply call setDirty() to report Workbench that the editor need to
be saved. This was very simple using :
public IStatus handleBindingEvent(BindingEvent e)
{
if(e.copyType == BindingEvent.EVENT_COPY_TO_MODEL &&
e.pipelinePosition == BindingEvent.PIPELINE_AFTER_GET &&
!dirty)
{
setDirty(true);
}
return Status.OK_STATUS;
}


Sample code working on 3.3M5 is available here :
http://fisheye.escapek.org/browse/~raw,r=76/escapek/org.esca pek.client.ui.security/trunk/src/org/escapek/client/ui/secur ity/editors/forms/RoleMainFormPage.java


In 3.3M6, the IBindingListener has been removed. How can i simply catch
target to model updates to report dirty state ?

Nicolas.
Re: [Databinding] IBindingListener removed in 3.3M6 [message #314021 is a reply to message #314020] Sat, 31 March 2007 10:09 Go to previous messageGo to next message
Eclipse UserFriend
By thinking about it, may be prefered way to manage disrty state is to
make my form editors listening to model objects property changes. That's
what i'm going to do actually.



Nicolas Jouanin a écrit :
> Hi,
>
> I'm using databinding features in some form editors. In 3.3M5, I made
> these editors implementing IBindingEvent so it can detect model changes
> and simply call setDirty() to report Workbench that the editor need to
> be saved. This was very simple using :
> public IStatus handleBindingEvent(BindingEvent e)
> {
> if(e.copyType == BindingEvent.EVENT_COPY_TO_MODEL &&
> e.pipelinePosition == BindingEvent.PIPELINE_AFTER_GET &&
> !dirty)
> {
> setDirty(true);
> }
> return Status.OK_STATUS;
> }
>
>
> Sample code working on 3.3M5 is available here :
> http://fisheye.escapek.org/browse/~raw,r=76/escapek/org.esca pek.client.ui.security/trunk/src/org/escapek/client/ui/secur ity/editors/forms/RoleMainFormPage.java
>
>
>
> In 3.3M6, the IBindingListener has been removed. How can i simply catch
> target to model updates to report dirty state ?
>
> Nicolas.
Re: [Databinding] IBindingListener removed in 3.3M6 [message #314043 is a reply to message #314021] Mon, 02 April 2007 10:16 Go to previous messageGo to next message
Eclipse UserFriend
BTW, there was a recent discussion on bugzilla[1] about this same issue.
A couple of techniques were discussed that might help with your
implementation.

-brad

[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=179064
Re: [Databinding] IBindingListener removed in 3.3M6 [message #314064 is a reply to message #314043] Mon, 02 April 2007 15:41 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the tip Brad.

As mentionned in bugzilla discussion, i used the the listener
initialization process as made in WizardPageSupport.
Instead of individual listener initialization, i iterate
BindingContext.getBindings() to initialize target listeners.
I've also added to listener on
BindingContext.getBindings().addListChangeListener() to get aware of
changes made to the binding list.

This page[1] shows differences made to one of my editor page. It may
help other people interested in databinding looking for examples

Nicolas.

[1]
http://fisheye.escapek.org/browse/escapek/org.escapek.client .ui.security/trunk/src/org/escapek/client/ui/security/editor s/forms/RoleMainFormPage.java?r=82
Re: [Databinding] IBindingListener removed in 3.3M6 [message #314070 is a reply to message #314064] Mon, 02 April 2007 18:44 Go to previous messageGo to next message
Eclipse UserFriend
This sounds like a good candidate for a snippet. If you have the time
and would like to contribute a small snippet feel free to log a bug and
we'd be happy to commit to it the examples project.

-brad
Re: [Databinding] IBindingListener removed in 3.3M6 [message #314106 is a reply to message #314070] Tue, 03 April 2007 11:25 Go to previous messageGo to next message
Eclipse UserFriend
The current code can't be easily extracted from the RCP application
because it depends on many classes and requires data to be loaded from
EJB3 component.
What kind of contribution would you like ? would a empty RCP app. with a
light version of a editor using databinding be enough as a snippet ?
Re: [Databinding] IBindingListener removed in 3.3M6 [message #314116 is a reply to message #314106] Tue, 03 April 2007 13:37 Go to previous messageGo to next message
Eclipse UserFriend
Just a snippet to monitor dirty state. No RCP, no EJB, just a
standalone snippet[1] that shows how to accomplish the task of tracking
changes in the multiple models.

-brad

[1]
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jface.e xamples.databinding/src/org/eclipse/jface/examples/databindi ng/snippets/

Nicolas Jouanin wrote:
> The current code can't be easily extracted from the RCP application
> because it depends on many classes and requires data to be loaded from
> EJB3 component.
> What kind of contribution would you like ? would a empty RCP app. with a
> light version of a editor using databinding be enough as a snippet ?
>
Re: [Databinding] IBindingListener removed in 3.3M6 [message #314129 is a reply to message #314116] Tue, 03 April 2007 16:40 Go to previous message
Eclipse UserFriend
Hi Brad,

I've logged a new bugzilla bug[1] for this snippet. May be you can
review it and tell me it's ok for you.
This snippet shows how to track changes on two binded objects :
- a list of person
- a text string.

Nicolas.

[1]https://bugs.eclipse.org/bugs/show_bug.cgi?id=180799
Previous Topic:Re-use of platform icons with the new org.eclipse.ui.menus extension
Next Topic:[Databinding] Using RCP- A Simple Snippet?
Goto Forum:
  


Current Time: Fri Nov 07 03:28:59 EST 2025

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

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

Back to the top