Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to handle multiple instances of views and handlers
How to handle multiple instances of views and handlers [message #331778] Mon, 22 September 2008 11:55 Go to next message
Eclipse UserFriend
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
Re: How to handle multiple instances of views and handlers [message #331781 is a reply to message #331778] Mon, 22 September 2008 13:37 Go to previous messageGo to next message
Eclipse UserFriend
So your current property tester,
com.swisslab.xslprocessor.ui.test.processors.running, does not currently
test its receiver object (you simply need the property tester to run)?
If the model is accessible only through your view, you should change
your property tester to work against the activeView ... that way your
property tester receiver will be the activeView part that you can test
and down cast as appropriate.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm
Re: How to handle multiple instances of views and handlers [message #331782 is a reply to message #331778] Mon, 22 September 2008 13:47 Go to previous messageGo to next message
Eclipse UserFriend
I've found a really good email about hat topic from Mike Parker.
http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/m sg31920.html

It seems I have to rollback to Actions when it comes to a viewers toolbar.

Unfortunately Mike did'nt got any feedback on his email. So what is the
future developing on this issue? Is there going to be one?

Jan
Re: How to handle multiple instances of views and handlers [message #331785 is a reply to message #331782] Mon, 22 September 2008 14:14 Go to previous messageGo to next message
Eclipse UserFriend
Jan Kohnert wrote:
> I've found a really good email about hat topic from Mike Parker.
> http://dev.eclipse.org/newslists/news.eclipse.platform.rcp/m sg31920.html
>
> It seems I have to rollback to Actions when it comes to a viewers toolbar.
>
> Unfortunately Mike did'nt got any feedback on his email. So what is the
> future developing on this issue? Is there going to be one?

So the 3 news post conversation after the link you mentioned (2 from me,
one from Mike) doesn't count as feedback? :-)

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm
Re: How to handle multiple instances of views and handlers [message #331787 is a reply to message #331785] Mon, 22 September 2008 15:00 Go to previous message
Eclipse UserFriend
Sorry Paul!

Somehow I've overseen the asweres... :/

Jan
Previous Topic:disable cut/copy/paste on StyledText
Next Topic:Debugger Plug-in: Extending Variables View - Advice Please
Goto Forum:
  


Current Time: Thu Feb 13 07:39:33 GMT 2025

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

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

Back to the top