Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » PyDev perspective don't appear in RCP
PyDev perspective don't appear in RCP [message #1738301] Mon, 18 July 2016 16:05 Go to next message
Eclipse UserFriend
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 #1738307 is a reply to message #1738301] Mon, 18 July 2016 16:54 Go to previous messageGo to next message
Eclipse UserFriend
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 16:55] by Moderator

Re: PyDev perspective don't appear in RCP [message #1738332 is a reply to message #1738307] Tue, 19 July 2016 03:00 Go to previous messageGo to next message
Eclipse UserFriend
Well PyDev needs to compat layer not? Are you running the compat layer?

Tom

On 18.07.16 22:54, Patrik Suzzi wrote:
> 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);
>
> // Now switch perspective
> partService.switchPerspective(element);
> }
>
> }
>
>
> Regards,
> Patrik
Re: PyDev perspective don't appear in RCP [message #1738428 is a reply to message #1738307] Tue, 19 July 2016 13:52 Go to previous messageGo to next message
Eclipse UserFriend
Patrik Suzzi wrote on Mon, 18 July 2016 16:54
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



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 ?

index.php/fa/26498/0/

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 #1738429 is a reply to message #1738332] Tue, 19 July 2016 13:56 Go to previous messageGo to next message
Eclipse UserFriend
Hi Tom, yes i add the compability layer.

and add the perspectives importing like the last picture and continuos importing 3.x and i can see the corresponding class, but when i run my rcp in the perpesctive show the title but not the content.

index.php/fa/26499/0/

Thanks.
  • Attachment: pyEdit.png
    (Size: 24.16KB, Downloaded 564 times)
Re: PyDev perspective don't appear in RCP [message #1738442 is a reply to message #1738429] Tue, 19 July 2016 17:25 Go to previous messageGo to next message
Eclipse UserFriend
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.

Tom

On 19.07.16 19:56, Esteban Avila wrote:
> Hi Tom, yes i add the compability layer.
>
> and add the perspectives importing like the last picture and continuos importing 3.x and i can see the corresponding class, but when i run my rcp in the perpesctive show the title but not the content.
>
>
>
> Thanks.
>
Re: PyDev perspective don't appear in RCP [message #1738450 is a reply to message #1738442] Tue, 19 July 2016 22:20 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: PyDev perspective don't appear in RCP [message #1738466 is a reply to message #1738450] Wed, 20 July 2016 02:54 Go to previous messageGo to next message
Eclipse UserFriend
You are trying to include some 3.x plugins into a plain e4 application. And this is what doesn't work that easy. There are some tutorials out there that show that it is possible somehow, but you need to know the exact workarounds. Sorry, I don't have the links right now.

The other approach is to create an Eclipse 3 application, which means your application will run on the compat layer. And then you can add E4 stuff step by step until you are not able to migrate anymore. This is a mixed mode application starting from e3 which is working quite good. I wrote a tutorial about that, but it is only available in German.
Re: PyDev perspective don't appear in RCP [message #1738467 is a reply to message #1738450] Wed, 20 July 2016 02:55 Go to previous message
Eclipse UserFriend
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.
Previous Topic:ITEXTEDITOR plugin required bundle
Next Topic:Disable Double Click on RCP Toolbar Items
Goto Forum:
  


Current Time: Wed Jul 23 18:11:00 EDT 2025

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

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

Back to the top