Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » E4 DI: Accessing the MPart from an EventObjectSupplier
E4 DI: Accessing the MPart from an EventObjectSupplier [message #1713191] Mon, 02 November 2015 08:50
Alexander Bunkowski is currently offline Alexander BunkowskiFriend
Messages: 29
Registered: February 2014
Junior Member
Hey Community!

Inspired from the UIEventTopic/UIEventObjectSupplier I implemented my own Annotation/Supplier called VisibleUIEventTopic and VisibleUIEventObjectSupplier.

The event is only handled if the belonging part is visible.

The usage of the annotation looks like:
@Inject
@Optional
private void handleEvent(@VisibleUIEventTopic(value = Topic.MY_EVENT_TOPIC, partId = THIS_PARTS_ID) String analysisId) {
//code here
}


And the VisibleEventObjectSupplier makes a VisibleUIEventHandler for it that gets the part via "requestorMPart = partService.findPart(partId)" on construction and checks on every handleEvent() "partService.isPartVisible(requestorMPart)"

Works perfectly as long as I have each part only once.

PROBLEM:
If I put a part more than once in my Application Model it does not work correctly because the implementing part pojo class needs to have a hard static final declaration of the THIS_PARTS_ID which is equal for all part instances.

QUESTION:
How can I get the link from an IRequestor inside an EventObjectSupplier to the belonging MPart. I now that the Requestor always is an MPart.

[Updated on: Mon, 02 November 2015 08:53]

Report message to a moderator

Previous Topic:Some text lowered only on Mac 10.10 and Mac 10.11
Next Topic:E4 way to react on part hide / show
Goto Forum:
  


Current Time: Tue Sep 29 09:59:20 GMT 2020

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

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

Back to the top