Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to change the view from Projects to Working Sets programmatically?
icon4.gif  How to change the view from Projects to Working Sets programmatically? [message #666097] Tue, 19 April 2011 06:43 Go to next message
Kivanc Muslu is currently offline Kivanc Muslu
Messages: 153
Registered: November 2010
Senior Member
Hi all,

I want to change the view of the user from projects to working sets programmatically. This way some of the extra projects I create for my plug-in will not be directly visible to the user.
Is this possible?
If yes, can someone point me the related API for doing this.

Thanks,
Re: How to change the view from Projects to Working Sets programmatically? [message #666175 is a reply to message #666097] Tue, 19 April 2011 11:58 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You might be able to use
org.eclipse.ui.IWorkbenchPage.setWorkingSets(IWorkingSet[])

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: How to change the view from Projects to Working Sets programmatically? [message #666274 is a reply to message #666175] Tue, 19 April 2011 17:17 Go to previous messageGo to next message
Kivanc Muslu is currently offline Kivanc Muslu
Messages: 153
Registered: November 2010
Senior Member
Hi Paul,

Thanks for the suggestion. I tried using it, however for some reason it does not change the current view.

What I mean is the following: as you know the default view in Eclipse is that you see all the projects (even if the working sets exist, it is not the default view).This can be changed from the package explorer by hitting the down arrow (on the top right of package explorer) and then selecting Top Level Elements => Working Sets. This lets you to select the working sets you want to make visible and also changes the view.

What I need is to make this switch programmatically. In other words, I want to:
1- Detect whether the current view is working sets or projects.
2- If it is projects, change it to working sets.
3- If it is working sets, change it is projects (not need it, just to learn).
4- If a particular workspace (the one I created), is not visible (i.e., the user removed it), make it visible again.

How can I (or can I) do these?

Thanks, best regards,
Re: How to change the view from Projects to Working Sets programmatically? [message #666547 is a reply to message #666097] Wed, 20 April 2011 20:37 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2265
Registered: July 2009
Senior Member
On 4/19/2011 2:43 AM, Kivanc Muslu wrote:
> I want to change the view of the user from projects to working sets
> programmatically. This way some of the extra projects I create for my
> plug-in will not be directly visible to the user.
> Is this possible?

You might want to rethink why you need those projects. I wouldn't want
the view settings changed on me as a user.

--
Nitin Dahyabhai
Eclipse WTP Source Editing and JSDT
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: How to change the view from Projects to Working Sets programmatically? [message #666548 is a reply to message #666547] Wed, 20 April 2011 20:55 Go to previous messageGo to next message
Kivanc Muslu is currently offline Kivanc Muslu
Messages: 153
Registered: November 2010
Senior Member
Hi Nitin,

This will be first prompted to the user (as a question, at the beginning) with the explanation of the extra projects and suggestion that changing the view to working sets would be better for him/her. Then if (s)he clicks okay, I want to change the view.

I have to have these projects. And my current users don't really care that much that these projects are created. However, some of them told me that the extra projects confuse them in the package explorer view. That is why I am trying to resolve this.

Thanks,
Re: How to change the view from Projects to Working Sets programmatically? [message #667727 is a reply to message #666548] Sun, 01 May 2011 18:50 Go to previous message
Francis Upton IV is currently offline Francis Upton IV
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
It's not API, but there is ProjectExplorer.setRootMode(), I'm not sure there is any actual API for this. You might want to file an enhancement request for that.

Previous Topic:Manipulating Working Sets - beginner's questions
Next Topic:problem while creating a jar file
Goto Forum:
  


Current Time: Tue Sep 16 11:46:36 GMT 2014

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

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