How to handle multiple instances of views and handlers [message #331778] |
Mon, 22 September 2008 11:55  |
Eclipse User |
|
|
|
Hello,
I've multiple instances of one view. (allowMultiple = true),
TaskView processorView = (TaskView)page.showView(TaskView.ID, secondaryId,
IWorkbenchPage.VIEW_CREATE);
Further more I'm using org.eclipse.ui.handles together with property
testers as described here:
http://www.eclipse.org/newsportal/article.php?id=77810&g roup=eclipse.platform#77810
My problem is, that when having more that one instance of TaskView I'm not
sure how to check which views commands are getting checked.
For instance:
- TaskView tv1 represents task1 of the model
- TaskView tv2 represents task2 of the model
task1 is active where as task2 is inactive.
TaskView holds commands defined in org.eclipse.menus for starting and
stopping a task. So view tv1's start command should be disabled since
task1 is currently active and its stop command should be enabled. The
commands of tv2 should have the opposite state since task2 is inactive.
The PropertyTester::test() Method is called once for each command of each
view. So thats just fine. But since I'm not sure how to tell the
corresponding view of the test I can not get the corresponding peace of
model.
Is there any way how I can figure that out?
Thought a bit forward the same question comes up regarding perspectives.
(I'm using IPerspectiveRegistry::clonePerspective() a lot in my plug-in).
Thanks,
Jan
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05059 seconds