|
Re: PyDev perspective don't appear in RCP [message #1738307 is a reply to message #1738301] |
Mon, 18 July 2016 20:54 |
Patrik Suzzi Messages: 2 Registered: February 2018 |
Junior Member |
|
|
Esteban,
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
[Updated on: Mon, 18 July 2016 20:55] by Moderator Report message to a moderator
|
|
|
|
Re: PyDev perspective don't appear in RCP [message #1738428 is a reply to message #1738307] |
Tue, 19 July 2016 17:52 |
Esteban Avila Messages: 49 Registered: June 2012 |
Member |
|
|
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
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03711 seconds