Home » Eclipse Projects » Rich Client Platform (RCP) » Initialize a view that was contributed via perspective extensions(How to initialize a view, that was contributed via the perspective extensions extension point)
Initialize a view that was contributed via perspective extensions [message #644736] |
Tue, 14 December 2010 01:48 |
Simon L. Messages: 22 Registered: January 2010 |
Junior Member |
|
|
Hello,
I just contributed the console view to my RCP over the extension point:
<view
closeable="true"
id="org.eclipse.ui.console.ConsoleView"
minimized="false"
moveable="true"
relationship="stack"
standalone="false"
visible="true">
</view>
Now, the console view can be displayed. But, with my plugin, I also want to initialize this ui console plugin of eclipse with something -- in my case, the first console in the view. But my Activator class of the plugin is not loaded at the start of the RCP (because no classes from the plugin are loaded), and such, from that plugin, I don't know how to pass something to the console view right from teh start of the RCP.
(Just want to make sure, one, two functions get called from this plugin at RCP start)
Any tips? I'm fairly new to RCP, I dont know the usual proceedings except from looking at other projects and how they did it. But i couldnt manage to find something alike.
Thanks, your time is appreciated!
|
|
| | | | |
Re: Initialize a view that was contributed via perspective extensions [message #650029 is a reply to message #649880] |
Fri, 21 January 2011 13:45 |
|
On 01/20/2011 03:17 PM, Simon L. wrote:
> What would be your proposed, ideological conform method to solve my
> problem? I'm always interested in good practice!
In an RCP, you get to control everything and have a number of
post-methods to do it (like postStartup()).
If you're an eclipse plugin or 2, the best practice is:
1) ask yourself if it can wait until something is loaded (a view, and
editor, a command executed, a connection made, etc).
2) isolate the code that needs to be started. The smaller the plugin,
the better. Separate from UI contributions (things in plugin.xml) is
best, since once activated the framework is free to load and create
instances of all contributions that come in through plugin.xml
3) don't put long operations in the activator or in the early startup
extension class. Make sure they complete swiftly, delegating to a Job
if necessary.
That's about it. It's not that the extension can't be used, but we
admonish people because 7 times out of 10, it's just a spot solution for
them, it doesn't help the Eclipse application as a whole.
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/galileo/index.jsp?topic=/org.eclipse .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: Initialize a view that was contributed via perspective extensions [message #650140 is a reply to message #650029] |
Fri, 21 January 2011 22:07 |
Simon L. Messages: 22 Registered: January 2010 |
Junior Member |
|
|
Okay. May I try to exercise this for my case here? Many of those rules I did already consider while trying to find a solution in the first place.
My case again: contributing a view "org.eclipse.ui.console" to the perspectiveExtensions extension point.
My goal: to prepare a self-defined console behaviour which has to be active the very moment the user activates the view.
My problem: the perspectiveExtensions extension points introduces the console view to the pool of views that can be loaded by the user. But I found no way to hook into this loading process to participate in this lazy-loading-process by defining the behaviour of the console the moment it is loaded.
1) ask yourself if it can wait until something is loaded (a view, and editor, a command executed, a connection made, etc).
-- Yes it can wait. Until the console view is loaded.
2) isolate the code that needs to be started. The smaller the plugin, the better. Separate from UI contributions (things in plugin.xml) is best, since once activated the framework is free to load and create instances of all contributions that come in through plugin.xml
-- did. Code is isolated from UI contribution part. I only define behaviour of the console, which can be done before, or after the view is loaded.
3) don't put long operations in the activator or in the early startup extension class. Make sure they complete swiftly, delegating to a Job if necessary.
-- did - code isnt taking much computation
I dont see how that helps me here. Point 1 seems to suggest, since I answered with yes, that I have to wait with the execution to the loading of the view. But I see no way how.
Because of that I gave the early startup a try... But still, I'm not completely satisfied with it, since everything else in RCP context I managed to get done with elegant seeming solutions.
|
|
|
Goto Forum:
Current Time: Wed Sep 25 21:56:06 GMT 2024
Powered by FUDForum. Page generated in 0.04774 seconds
|