Perspectives [message #336938] |
Tue, 14 July 2009 21:02 ![Go to next message Go to next message](theme/Solstice/images/down.png) |
|
We are porting an old C application and came up with these questions:
Is it possible to dynamically/programmatically create then show or hide
views which will show in Eclipse's Window | Show View dialog when these
views did not previously exist in plugin.xml?
Are there any best practices or has anyone tried this?
|
|
|
Re: Perspectives [message #336939 is a reply to message #336938] |
Wed, 15 July 2009 06:52 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: aurelien.pupier.esial.net
Dilton McGowan II a écrit :
> We are porting an old C application and came up with these questions:
>
> Is it possible to dynamically/programmatically create then show or hide
> views which will show in Eclipse's Window | Show View dialog when these
> views did not previously exist in plugin.xml?
>
> Are there any best practices or has anyone tried this?
Hi Dilton,
not sure to understand :
1.Do you want to add a view in Window->Show View?
or
2. Do you want to open views that will be available in WIndow->show View?
For 1., use org.eclipse.ui.perspectiveExtensions, choose the perspective to which you will to contribute and then add a view shortcut
For 2., use org.eclipse.ui.perspectiveExtensions, choose the perspective to which you will to contribute and then add a view. Perhaps you will need to reset your perspective (Window-> reset perspective).
|
|
|
Re: Perspectives [message #336949 is a reply to message #336939] |
Wed, 15 July 2009 14:09 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
|
On Wed, 15 Jul 2009 08:52:35 +0200, Aurelien Pupier wrote:
> Dilton McGowan II a écrit :
>> We are porting an old C application and came up with these questions:
>>
>> Is it possible to dynamically/programmatically create then show or hide
>> views which will show in Eclipse's Window | Show View dialog when these
>> views did not previously exist in plugin.xml?
>>
>> Are there any best practices or has anyone tried this?
>
> Hi Dilton,
>
> not sure to understand :
> 1.Do you want to add a view in Window->Show View? or
> 2. Do you want to open views that will be available in WIndow->show
> View?
>
> For 1., use org.eclipse.ui.perspectiveExtensions, choose the perspective
> to which you will to contribute and then add a view shortcut
>
> For 2., use org.eclipse.ui.perspectiveExtensions, choose the perspective
> to which you will to contribute and then add a view. Perhaps you will
> need to reset your perspective (Window-> reset perspective).
Hi Aurelien,
I have views showing where I want them now but this is a requirement we
have and it's an odd one well two:
1) a View at some time while Eclipse is running needs to be manufactured
from some input information, a view that is not in plugin-xml and never
existed before
2) while Eclipse is running and based on some runtime parameters that
change as the plugin is used; a view will need to be marked as grey
(disabled?) in the Window | Show View dialog(wizard?) or it will simply
need to not show up when we need it to not show up and some time later
possibly show up if needed
|
|
|
Re: Perspectives [message #336953 is a reply to message #336938] |
Wed, 15 July 2009 18:52 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
|
There's no programmatic API to generate an individual view. You have 2
options.
1) create a multi-instance view. When these are opened, the secondaryId
is often used as a key that would allow you to look up your "input" and
customize your createPartControl accordingly. Only the default view,
without a secondary ID, will show up in the Show View menu
2) assuming you have the class available you can (in RCP apps) use
org.eclipse.core.runtime.IExtensionRegistry.addContribution( InputStream,
IContributor, boolean, String, ResourceBundle, Object) to feed a snippet
of XML (like an org.eclipse.ui.views extension) into the
IExtensionRegistry. That would then show up in the Show View menu. You
would need to be able to encode all of your input into the view XML in
some way (parameters are supported since a view is an
org.eclipse.core.runtime.IExecutableExtension) or once again, pass in a
key that can be used to look up information in the system.
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
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Re: Perspectives [message #336954 is a reply to message #336953] |
Wed, 15 July 2009 20:05 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
|
On Wed, 15 Jul 2009 14:52:53 -0400, Paul Webster wrote:
> There's no programmatic API to generate an individual view. You have 2
> options.
>
> 1) create a multi-instance view. When these are opened, the secondaryId
> is often used as a key that would allow you to look up your "input" and
> customize your createPartControl accordingly. Only the default view,
> without a secondary ID, will show up in the Show View menu
>
You're right we will need to address the single instance view only issue.
> 2) assuming you have the class available you can (in RCP apps) use
> org.eclipse.core.runtime.IExtensionRegistry.addContribution( InputStream,
> IContributor, boolean, String, ResourceBundle, Object) to feed a snippet
> of XML (like an org.eclipse.ui.views extension) into the
> IExtensionRegistry. That would then show up in the Show View menu. You
> would need to be able to encode all of your input into the view XML in
> some way (parameters are supported since a view is an
> org.eclipse.core.runtime.IExecutableExtension) or once again, pass in a
> key that can be used to look up information in the system.
>
> PW
Item 2 specifically addContribution and passing XML sounds very
interesting.
Thanks for the suggestions.
|
|
|
Powered by
FUDForum. Page generated in 0.03920 seconds