Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Adding stacked views to an existing perspective via "perspectiveExtensions"
Adding stacked views to an existing perspective via "perspectiveExtensions" [message #323831] Wed, 09 January 2008 11:55 Go to next message
Eclipse UserFriend
hi I've been trying different ways to add a stack of views to an
existing perspective via the extension point "perspectiveExtensions".
Sounds fairly standard. The problem is that at the location where I'd
like to add the stacked views, there is not an existing view in the
target perspective. So using the extension point I can add the first
view but I can't add any additional views to the same stack since the
extension point requires an existing view, in the original perspective
definition, as the reference point.

I'm pretty sure it is not possible as per the current API but would like
to as if anyone has found a way to do that.

Thanks!
Re: Adding stacked views to an existing perspective via "perspectiveExtensions" [message #323869 is a reply to message #323831] Thu, 10 January 2008 12:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Jim Zhang wrote:
> hi I've been trying different ways to add a stack of views to an
> existing perspective via the extension point "perspectiveExtensions".
> Sounds fairly standard. The problem is that at the location where I'd
> like to add the stacked views, there is not an existing view in the
> target perspective. So using the extension point I can add the first
> view but I can't add any additional views to the same stack since the
> extension point requires an existing view, in the original perspective
> definition, as the reference point.
>
> I'm pretty sure it is not possible as per the current API but would like
> to as if anyone has found a way to do that.

If I understand your need correctly, you should be able to accomplish it
by adding one of your views relative to something that is already in the
perspective (another view or the editor area) and then stack the rest of
your new views relative to the first one.
For example,
ViewA added relative to the bottom of org.eclipse.ui.editorss (the
editor area).
ViewB and ViewC added as stacked relative to ViewA.

Hope this helps,
Eric
Re: Adding stacked views to an existing perspective via "perspectiveExtensions" [message #323874 is a reply to message #323869] Thu, 10 January 2008 13:58 Go to previous messageGo to next message
Eclipse UserFriend
Eric, thanks for the reply. It tried the exact tactic before I wrote
the post, which didn't work. My theory at the time was that it was not
supported. However just now I tried it again and it worked for me.

I checked the source of PerspectiveExtensionReader, and whether the
above will work or not reliably depends on if
IConfigurationElement.getChildren() preserves the order of the <view>
elements as they appear in the plugin.xml. Anybody knows if that's
indeed the case?
Re: Adding stacked views to an existing perspective via "perspectiveExtensions" [message #323875 is a reply to message #323874] Thu, 10 January 2008 14:47 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Jim Zhang wrote:
> Eric, thanks for the reply. It tried the exact tactic before I wrote
> the post, which didn't work. My theory at the time was that it was not
> supported. However just now I tried it again and it worked for me.
>
> I checked the source of PerspectiveExtensionReader, and whether the
> above will work or not reliably depends on if
> IConfigurationElement.getChildren() preserves the order of the <view>
> elements as they appear in the plugin.xml. Anybody knows if that's
> indeed the case?

I'll be curios to hear the answer, because it the answer is "no" then
I'd really like to know how the whole relative positioning strategy can
work at all. Plus the fact that my current project is relying on the
kind of structure where most of our custom views are relative to one
particular one.

Eric
Re: Adding stacked views to an existing perspective via "perspectiveExtensions" [message #323894 is a reply to message #323875] Fri, 11 January 2008 08:50 Go to previous message
Eclipse UserFriend
The extension registry won't guarantee the order of extensions for an
extension point, but within an extension the IConfigurationElements (for
something like "view" or "command", etc) seem to be in the plugin.xml order.

Assuming that's correct (and org.eclipse.ui.actionSets depends on that
behaviour, as well as a number of other UI extension points) you can
stack views within one perspectiveExtension:

<extension
point="org.eclipse.ui.perspectiveExtensions">
<perspectiveExtension
targetID="org.eclipse.jdt.ui.JavaPerspective">
<view
id="org.eclipse.ui.views.ResourceNavigator"
minimized="false"
ratio="0.5"
relationship="top"
relative="org.eclipse.ui.views.ContentOutline"
visible="true">
</view>
<view
id="org.eclipse.ui.views.BookmarkView"
minimized="false"
relationship="stack"
relative="org.eclipse.ui.views.ResourceNavigator"
visible="true">
</view>
</perspectiveExtension>
</extension>
[/xml]

Later,
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/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm
Previous Topic:Hook into SaveAction
Next Topic:providing a progress dialog for nested jobs
Goto Forum:
  


Current Time: Mon Jul 14 14:46:08 EDT 2025

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

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

Back to the top