Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Suppress general views in dialog "Window->Show View"?
Suppress general views in dialog "Window->Show View"? [message #481178] Thu, 20 August 2009 00:47 Go to next message
Eclipse User
Originally posted by: carsten.labinsky.de

I am currently developing a RCP application using GEF's GraphicalEditor.
The "Show View" dialog shows the following views in category "General":
- Outline
- Palette
- Properties

Is there any way to remove these general views from the List?
Re: Suppress general views in dialog "Window->Show View"? [message #481354 is a reply to message #481178] Thu, 20 August 2009 15:03 Go to previous messageGo to next message
Eric Rizzo is currently offline Eric Rizzo
Messages: 2310
Registered: July 2009
Senior Member
Carsten Labinsky wrote:
> I am currently developing a RCP application using GEF's GraphicalEditor.
> The "Show View" dialog shows the following views in category "General":
> - Outline
> - Palette
> - Properties
>
> Is there any way to remove these general views from the List?

If you are using your own perspective, yes. That list is dictated by an
extension point to the perspective, so if the perspective is not your
own (not defined/created by your product) then I don't think so.

If you want to investigate, the extension point is
org.eclipse.ui.perspectiveExtensions (look at the viewShortcut child
element of that extension point). You might be able to find the code
that reads those extensions and find a way to programmaticaly suppress
contributions. But in general, it is not a good idea to mess around with
a perspective that you don't "own" other than to contribute to it via
extension points.

Hope this helps,
Eric
Re: Suppress general views in dialog "Window->Show View"? [message #481356 is a reply to message #481178] Thu, 20 August 2009 15:05 Go to previous messageGo to next message
Fred is currently offline Fred
Messages: 11
Registered: July 2009
Junior Member
Carsten Labinsky a écrit :
> I am currently developing a RCP application using GEF's GraphicalEditor.
> The "Show View" dialog shows the following views in category "General":
> - Outline
> - Palette
> - Properties
>
> Is there any way to remove these general views from the List?

I guess one of the most common way to do that is to use activities.

For example, add an extension like this in your bundle:

<extension
point="org.eclipse.ui.activities">
<activity
id="forbidden.contributions"
name="forbidden actions and contributions">
</activity>

<activityPatternBinding
activityId="forbidden.contributions"
pattern=" org\.eclipse\.ui\.views/org\.eclipse\.ui\.views\.ContentOutl ine ">
</activityPatternBinding>

<activityPatternBinding
activityId="forbidden.contributions"
pattern=" org\.eclipse\.ui\.views/org\.eclipse\.ui\.views\.PropertyShe et ">
</activityPatternBinding>

<!--... and so on ... -->

</extension>


You can have more information there:
http://help.eclipse.org/galileo/topic/org.eclipse.platform.d oc.isv/guide/workbench_scalability.htm

The hard thing with this is to find all identifiers of the graphical
contributions you want to remove...

Please note that this doesn't work for popup menus of editors' tabs, and
that activities are not very useful when you want to deal with security
or authorization stuff, cause it's (almost) always possible for the user
to enable them ...

Hope this helps,

Fred
Re: Suppress general views in dialog "Window->Show View"? [message #481668 is a reply to message #481356] Sat, 22 August 2009 20:42 Go to previous message
Eclipse User
Originally posted by: carsten.labinsky.de

Fred schrieb:
> I guess one of the most common way to do that is to use activities.
> ...

That's exactly what I needed. Great! :)

Here is my final solution (for the sake of completeness):
<extension point="org.eclipse.ui.activities">
<activity
id="my.hidden.contributions"
name="Hidden Contributions">
</activity>
<activityPatternBinding
activityId="my.hidden.contributions"
isEqualityPattern="true"
pattern="org.eclipse.ui.views/org.eclipse.ui.views.ContentOutline ">
</activityPatternBinding>
<activityPatternBinding
activityId="com.intanges.iplotx.hidden.contributions"
isEqualityPattern="true"
pattern="org.eclipse.ui.views/org.eclipse.ui.views.PropertySheet ">
</activityPatternBinding>
<activityPatternBinding
activityId="com.intanges.iplotx.hidden.contributions"
isEqualityPattern="true"
pattern="org.eclipse.gef/org.eclipse.gef.ui.palette_view">
</activityPatternBinding>
</extension>

Thank you very much for your help!
Carsten
Previous Topic:EMF databinding to multiple fields
Next Topic:API for programmtically creating Plugins+features
Goto Forum:
  


Current Time: Thu Oct 23 11:07:46 GMT 2014

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

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