Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Action and updateTargets(): strange behaviour(calling updateTargets() from an Action defined in a separate compilation unit won't work properly)
Action and updateTargets(): strange behaviour [message #674540] Fri, 27 May 2011 09:53
Gianni Paglia is currently offline Gianni PagliaFriend
Messages: 3
Registered: May 2011
Junior Member
I am hitting a strange behavior in the interaction between Action and DataBindingContext.
In summary, I have a Text widget and a domain model which contains a nested object, and I have built a binding between the domain nested property and the Text widget.
I have 2 actions (which I will call internal actions) defined as anonymous subclasses of Action within the java compilation unit defining the ApplicationWIndow.
I have other 2 actions (which I will call external actions) defined in external java compilation units, with a 2 param constructor that allows me to pass in (on action creation) my domain object and the DataBindingContext object as defined inside the ApplicationWindow compilation unit.
All actions do the following:
= set the nested property inside the domain model to a string
= call updateTargets() on the DataBindingContext object

The behavior I see is the following:
= if I trigger one of the internal actions, I see the Text on the screen updated with the expected string
= if I trigger one of the external actions, I see no update on the screen
= after one of the external actions have been triggered at least once, also the internal actions will stop working (no update on the screen)
= I have tried passing the domain object and the DataBindingContext object to the external actions through a Singleton store instead of having a 2 param constructor but that doesn't change the behavior.
= if I use a simple property (not nested, i.e. a field of the domain model object) everything works properly then.

I hope somebody can explain this, maybe there is something wrong in my code or is this a bug?

I attach a zip with my java sources:
= ExpBinding is the main file, extending ApplicationWindow object
= ExpDomainModel is the domain model, containing a nested object of type ExpConfig
= ExpConfig is the nested object inside the domain model, the property I use is proxyHost (with setters and getters)
= ExpExternalAction and ExpExternalAction2 are the external actions (the first uses a 2 param contructor to receive the model and DataBindingContext, the second gets them through the ExpSingleton)
= ExpUtil just exposes a static doAction method performing the required action
= ExpSingleton is the singleton to store the domain model and the data binding context object (used by ExternalAction2)

Regards,
Gianni
  • Attachment: test.rar
    (Size: 4.27KB, Downloaded 264 times)
Previous Topic:using 32 by 32 image in treeviewer
Next Topic:Opening a multi-page forms editor on a specific page and section
Goto Forum:
  


Current Time: Wed Apr 24 21:21:02 GMT 2024

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

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

Back to the top