I'm writting an RCP application which has an application model that can be simplified as below:
==================================================
= lpart || rpart1 | rpart2 =
= -------------------- || ---------------------- =
= <a table> || <some sfuff about =
= || the selected item> =
==================================================
- The window is divided into two part stacks: left and right
- The left PS contains one part, and the part contains only a table
- The right PS contains two parts, each will show some details about the selected item in the table
The problem:
- It seems that Eclipse is lazily initializing my part implementation class. If I call MPart.getObject() on rpart2 before I ever clicked the tab, it returns null. Can I make Eclipse to initialize all my part implementation class when it starts up.
- How can I tell which one of rpart1 and rpart2 is showing. I want to avoid loading data for both parts whenever the selection of the table changes, after all, only one of them is really showing.
What I want to achieve:
- Whenever an item gets selected, both rpart1 and rpart2 get notified and remember the selection (item id or sth. similar). It will be impossible if rpart2 is lazily initialized.
- Only the part that is currently showing will fetch the details it needs. It will be impossible if a part cannot tell whether it is showing.
- When the other part gets selected, it will fetch and display its data according to the remembered selection. Well, this is the only part I know how to do it.
Any help would be really appreciated! Thanks a lot!