|Link a part to another part in "e4 way" [message #1314166]
||Fri, 25 April 2014 07:50
| Istvan Meszaros
Registered: October 2009
i would like to implement something like the concept know as "editor linked view" in 3.x world.
Basically, i have a fixed Part that is always visible throughout the lifetime of the application. In another PartStack multiple editor like Parts can be opened or closed.
I would like the fixed Part to be linked to the active editor part and show information about the editor's content. If no editor is open, fields of the fixed part should be empty/disabled/hidden, etc. To put it simple, i would like the fixed Part to behave much like the "Outline" view in Eclipse.
My problem is that i don't know how to notify the fixed part properly about the "active" part or editor, or content object.
At first i thought i'd use the selection service. The editor parts would be selection providers and the fixed part would be a selection listener.
The hard thing is determining the "active" editor, and catching the right event when to determine it.
@UIEventTopic(UIEvents.UILifeCycle.ACTIVATE) looks confusing to me, it's called a lot even if i click on the currently active CTabItem, so no "real" part activation happens. Also, there is no similar event for part closing.
I think i need the following events:
- an editor Part is activated (by this i mean opened, or selected in the parent PartStack)
- an editor Part is closed
The order of these events is important. If two or more editor Parts are open, and one of them gets closed, the close event for that Part must come before the activation event of another part, because the "close" event would clear the selection in the selection service, and the "activate" event would set it again.
Do you have any ideas how to implement this behavior?
[Updated on: Fri, 25 April 2014 08:05]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.10259 seconds