Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Graphiti and E4
Graphiti and E4 [message #741394] Wed, 19 October 2011 13:42 Go to next message
keersbulik Missing name is currently offline keersbulik Missing nameFriend
Messages: 6
Registered: May 2011
Junior Member
Hello,

I try to integrate graphiti in an E4 application.
I use compatibility layer.

i wrote an E4 handler to open a diagram in my editor.

public class MyHandler {

	@Execute
	public void openEditor(EPartService partService,
			MApplication application, EModelService modelService) {

		MInputPart part = MBasicFactory.INSTANCE.createInputPart();
		part.setLabel("Editor");
		part.setCloseable(true);
		part.setContributionURI("platform:/plugin/org.eclipse.graphiti.ui/org.eclipse.graphiti.ui.editor.DiagramEditor");
		part.setInputURI("my diagram path");
		List<MPartStack> stacks = modelService.findElements(application, null, MPartStack.class, null);
		stacks.get(0).getChildren().add(part);
		partService.showPart(part, PartState.ACTIVATE);
	}

}



When i perform the action a part is open, but the tab is empty.
Does anyone already try to do that ?

Thanks.
Re: Graphiti and E4 [message #771856 is a reply to message #741394] Wed, 28 December 2011 11:10 Go to previous messageGo to next message
Eduardo Fernández is currently offline Eduardo FernándezFriend
Messages: 7
Registered: October 2011
Junior Member
Hi keersbulik,

Did you achieve the Graphiti-e4 integration works fine? I'm currently trying with the same issue and the part shows a blank editor. I'm using compat layer too.

Thanks,
Eduardo Fernández.
Re: Graphiti and E4 [message #774744 is a reply to message #771856] Wed, 04 January 2012 14:07 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

To open an IEditorPart you need to use the standard compatibility layer methods, either on IDE or IWorkbenchPage. If you want to see the behind-the-scenes work to open an IEditorPart in the model, track down how the WorkbenchPage and EditorReference create a CompatibilityPart/CompatibilityEditor to host the IEditorPart.

PW


Re: Graphiti and E4 [message #776139 is a reply to message #774744] Sat, 07 January 2012 15:55 Go to previous messageGo to next message
Eduardo Fernández is currently offline Eduardo FernándezFriend
Messages: 7
Registered: October 2011
Junior Member
Hi Paul,

Thanks for your answer. Finally I decided to develope my app using Eclipse RCP because I found hard to use all the components I needed (graphiti, xtext, ...) in the app with e4. When e4 1.0 is released I will try this framework.

Eduardo Fernández.
Re: Graphiti and E4 [message #903662 is a reply to message #741394] Fri, 24 August 2012 18:58 Go to previous messageGo to next message
Johnny Qin is currently offline Johnny QinFriend
Messages: 40
Registered: April 2012
Member
Hi keersbulik,

Did you manage to integrate graphiti with e4?

Paul, can you explain a little more about your idea? It's been 8 months now. Do you think there's an easier approach?

I am right now struggling with this approach. Any suggestions or comments will be highly appreciated!

Regards,
Johnny


keersbulik Mising name wrote on Wed, 19 October 2011 09:42
Hello,

I try to integrate graphiti in an E4 application.
I use compatibility layer.

i wrote an E4 handler to open a diagram in my editor.

public class MyHandler {

	@Execute
	public void openEditor(EPartService partService,
			MApplication application, EModelService modelService) {

		MInputPart part = MBasicFactory.INSTANCE.createInputPart();
		part.setLabel("Editor");
		part.setCloseable(true);
		part.setContributionURI("platform:/plugin/org.eclipse.graphiti.ui/org.eclipse.graphiti.ui.editor.DiagramEditor");
		part.setInputURI("my diagram path");
		List<MPartStack> stacks = modelService.findElements(application, null, MPartStack.class, null);
		stacks.get(0).getChildren().add(part);
		partService.showPart(part, PartState.ACTIVATE);
	}

}



When i perform the action a part is open, but the tab is empty.
Does anyone already try to do that ?

Thanks.
Re: Graphiti and E4 [message #907049 is a reply to message #903662] Mon, 03 September 2012 08:04 Go to previous message
Fredrik Attebrant is currently offline Fredrik AttebrantFriend
Messages: 34
Registered: June 2012
Member

Basically the problem with Graphiti is that it depends on GEF which is dependening on org.eclipse.ui.workbench.
That package requires your application to run with the compatibility layer, which supplies a re-implementation of org.eclipse.ui.workbench on top of "4.x".

So until GEF (and Graphiti) has been migrated/rewritten to be "pure 4.x", you need to write your editor the old 3.x way, which ensures that the "compatibility layer" is pulled in.

There's a bug 372171 for GEF which you may want to vote for... Not much has happened in the bug so it would be great to push it to make sure GEF moves along...

Previous Topic:Tray icon/menu
Next Topic:Calling setContributorURI From A @ProcessAdditions Method Has No Effect
Goto Forum:
  


Current Time: Fri Apr 19 20:40:47 GMT 2024

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

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

Back to the top