GEF - How to open GEF application on ViewPart application - eclipse

I am newbe in GEF development.
I had created one GEF application using Draw2D apis.
Application contains Two tree viewers. I need to draw connection to connect children of these trees. I also want to keep control on these connection so that I can able to delete them. I need to draw 1-1 and N-1 kind of connections.
I need to embed this application within an RCP application which I already have and want to show it as a view within my specific Perspective.
Additionally, I have my own data model.
I want to know that to convert my model to GEF understandable model format what changes do I need to make with my model.

What you want to essentially do is create an Eclipse modeling project. The way it works is by creating your own EMF models. All your tree nodes with their attributes are "modelled" in EMF.
Then you can convert this model to an GEF/Draw2d Diagram using something called GMF(Graphical Modeling Framework).
EMF :
The EMF project is a modeling framework and code generation facility
for building tools and other applications based on a structured data
model. From a model specification described in XMI, EMF provides tools
and runtime support to produce a set of Java classes for the model,
along with a set of adapter classes that enable viewing and
command-based editing of the model, and a basic editor.
http://www.eclipse.org/modeling/emf/
GMF :
The GMF Tooling project provides a model-driven approach to generating
graphical editors in Eclipse.
http://www.eclipse.org/modeling/gmp/?project=gmf-tooling
Tutorial :
I would suggest looking at the following tutorial to get a feel of the whole thing.
http://www.ibm.com/developerworks/opensource/library/os-ecl-gmf/

Related

Adding combined fragments in UML Designer for Eclipse

I'm using the latest version of UML Designer (7.1) for Eclipse. I have to create a Sequence Diagram, but in the palettes there are no combined Fragments. All I have are actors and sync/async messages. In some tutorials I've seen seen palettes with comb. fragments.. But I don't have them. How is it possible?
The combined fragments are not implemented in UML Designer and there is no plan to implement them at the moment.
As UML Designer is based on Eclipse Sirius, it is possible to do it and maybe you saw the same kind of features in another Sirius based modeler.
If you are interested in sponsoring us to implement this feature do not hesitate to comment the existing issue :
https://github.com/ObeoNetwork/UML-Designer/issues/175

Adding workflow in Eclipse RCP

I want to add workflow in my eclipse rcp. Please provide me some guidlines.
I tried few plugins, but they were not what I was looking for.
What you want to essentially do is create an Eclipse modeling project. The way it works is by creating your own EMF models. All your tree nodes with their attributes are "modelled" in EMF.
Then you can convert this model to an GEF/Draw2d Diagram using something called GMF(Graphical Modeling Framework).
EMF :
http://www.eclipse.org/modeling/emf/
GMF :
The GMF Tooling project provides a model-driven approach to generating graphical editors in Eclipse.
http://www.eclipse.org/modeling/gmp/?project=gmf-tooling
Tutorial : I would suggest looking at the following tutorial to get a feel of the whole thing.
http://www.ibm.com/developerworks/opensource/library/os-ecl-gmf/

How to create Class Diagram in Eclipse?

I just wanted to create the class diagram of my project in Eclipse.The project is already implemented,suggest me any tool that sketch the Diagram of this project in Eclipse.
Take a look at Model Development Tools (MDT).
For reverse engineering, you can use JUPE.
ObjectAid generates classes diagram when you are simply drag and dropping classes from Project manager to the diagram.
UMLGraph creates class/activities diagrams automatically from the code and append them to javadocs.
As far as I know, both work for Java. I don't know if they support other languages.
Papyrus is the very powerful tool for hand creation of any UML and other diagrams

Xtext and GMF integration

First of all, I have seen many links on stackoverflow of integrating XText with GMF.
The most consistent tutorial I've seen so far was: http://www.eclipse.org/forums/index.php/mv/msg/472225/1036564/#msg_1036564
..But not even generate a textual editor in the final step (only GMF editor).
I also saw the documentation, but I can not understand what they suggest in this link: http://www.eclipse.org/Xtext/documentation.html#gmf_integration
So I wonder if anyone knows how to integrate effectively the GMF with Xtext with an existing ecore! Use the XText 2.0.4.
Thank you!
Depending on how fixed you are on using GMF, you may want to look at Graphiti (built on GEF).
Graphiti is an Eclipse-based graphics framework that enables rapid development of state-of-the-art diagram editors for domain models. Graphiti can use EMF-based domain models very easily but can deal with any Java-based objects on the domain side as well.
There is an Eclipse Labs project for creation of Graphiti editors using an XText DSL, called Spray.
This project aims to provide one or more Domain Specific Languages (DSL) to describe Visual DSL Editors against the Graphiti runtime, and provide code generation to create the boilerplate code for realizing the implementation against the Graphiti framework. Potentially the Spray DSL can be used to generate code for other frameworks as well.
You can import your DSL ecore model into Spray, and using references to your DSL's types create a graphical editor with relatively little boilerplate. The presentation at CodeGen 2012 (SprayCodeGeneration2012.pdf on the Google Code link above) highlights some of Spray's features.

integrate an UML modeling Tool in my plugin?

I'm developing a plugin eclipse that generates code from a UML diagram. I want to integrate the tool making these UML diagrams in my plugin. I explain : I want to have a button or a menu that contains " create a new UML diagram". By clicking on it, the tool's editor ( papyrus for example ) shows up so I can create my diagram.
Is it possible ? I admit I am new in developing plugins. And if it is, how ?
Thank you for your help
Yes, this should be straightforward. You can use an Eclipse model-to-text templating technology like M2T-JET to easily generate the file containing the new model and to easily generate code from that model. Once the model file is created and populated with initial content, use the IDE class to open the default editor on the file.