PyDev perspective don't appear in RCP [message #1738301] |
Mon, 18 July 2016 16:05  |
Eclipse User |
|
|
|
Hi to all, i am developing an rcp, i add a perspective with the ID org.python.pydev.ui.PythonPerspective
When i tried to switch between perspectives from my rcp app, with this code:
MPerspective element = (MPerspective) modelService.find("org.python.pydev.ui.PythonPerspective", app);
partService.switchPerspective(element);
the perspective change but nothing appear.
I added the Pydev into my plg dependencies.
Can you give me an idea about what is happening
Thanks.
PD: I use the same way in e3 and works.
|
|
|
|
|
Re: PyDev perspective don't appear in RCP [message #1738428 is a reply to message #1738307] |
Tue, 19 July 2016 13:52   |
Eclipse User |
|
|
|
Patrik Suzzi wrote on Mon, 18 July 2016 16:54Esteban,
The code looks good; are you properly getting modelService and application via injection ?
As an example, I would give them value via injection using a handler, like below:
public class SwitchPerspectiveHandler {
@Execute
public void execute( EPartService partService, EModelService modelService, MApplication application) {
MPerspective element = (MPerspective) modelService.find("org.python.pydev.ui.PythonPerspective", application);
// switch perspective
partService.switchPerspective(element);
}
}
Regards,
Patrik
Hi Patrik, yes i get modelService and application via injection. Here is my code
public class ShowPyDevPerspective
{
@Execute
public void execute(MApplication app, EPartService partService, EModelService modelService)
{
MPerspective element = (MPerspective) modelService.find("org.python.pydev.ui.PythonPerspective", app);
partService.switchPerspective(element);
}
}
I need add perspective like i show in the image ?

Thanks for the anwser.
PD: I add the compability layer (http://www.vogella.com/tutorials/Eclipse4MigrationGuide/article.html#using-the-compatibility-mode)
* org.eclipse.rcp
* org.eclipse.emf.ecore
* org.eclipse.emf.common
in my plugin.xml
|
|
|
|
|
|
|
Re: PyDev perspective don't appear in RCP [message #1738467 is a reply to message #1738450] |
Wed, 20 July 2016 02:55  |
Eclipse User |
|
|
|
Yes PyDev requires the compat layer to be in charge of the application
bootstraping. eg you need to launch with an IApplication who bootstraps
the complete RCP-3.x Framework.
Tom
On 20.07.16 04:20, Esteban Avila wrote:
> Are you trying to do a mixed mode e4 application? From my memories this
> mixed mode stuff has never really worked. If you need something from the
> 3.x world you need to solely bet on the compat-layer and let it control
> the model.
>
> Hi Tom,
> My rcp is pure an e4 and here is where i dont understand, is neccesary
> use the compatibility layer with Pydev?
> If the answer is no; why using the code to switch perspectives, the
> PyDev not appear, what is missing?
> Thanks.
> Regards.
|
|
|
Powered by
FUDForum. Page generated in 0.06316 seconds