Difference between revisions of "GEF/Developer FAQ"

From Eclipsepedia

< GEF
Jump to: navigation, search
(finished adding content to FAQ)
 
(42 intermediate revisions by 16 users not shown)
Line 1: Line 1:
= General =
 
 
 
== What is GEF ==
 
== What is GEF ==
The Graphical Editing Framework is an open source framework dedicated to providing a rich, consistent graphical editing environment for applications on the Eclipse Platform.
+
The [http://www.eclipse.org/gef/ Graphical Editing Framework] is an open source framework dedicated to providing a rich, consistent graphical editing environment for applications on the [http://www.eclipse.org/eclipse/index.php Eclipse Platform].
  
 
== Why should I use GEF? ==
 
== Why should I use GEF? ==
GEF enables developers to easily create rich graphical editors within Eclipse. GEF has been used to build a variety of applications, including state diagrams, activity diagrams, class diagrams, GUI builders for AWT, Swing and SWT, and process flow editors. For more information on GEF features, please see the Project Overview.
+
GEF enables developers to easily create rich graphical editors and views within Eclipse. GEF has been used to build a variety of applications, including state diagrams, activity diagrams, class diagrams, GUI builders for AWT, Swing and SWT, and process flow editors. For more information on GEF features, please see the [http://www.eclipse.org/gef/overview.html?cvsroot=Tools_Project Project Overview].  
 
+
== What version of Eclipse do I need? ==
+
A given version of GEF requires the exact same version of the Eclipse Platform.  For example, GEF 3.0.1 requires Eclipse 3.0.1.
+
 
+
== How do I make a suggestion for this FAQ? ==
+
The best way to contribute to this FAQ is to post your suggestion to the GEF newsgroup with the subject prefixed by "[FAQ]". You may post just a question or both a question and answer.
+
 
+
== Which operating systems does GEF support? ==
+
GEF is written in pure Java and should run on all operating systems officially supported by the Eclipse platform. It's primarily tested on Windows and Linux (GTK and Motif). See the readme file that came with your installation of GEF for specific versions.
+
 
+
== How is GEF licensed? ==
+
GEF if licensed in accordance with the Eclipse Public License. Third party components built using GEF are made available under their own licenses.
+
 
+
----
+
 
+
= Download and Install =
+
 
+
== How do I Install GEF? ==
+
Download the version of GEF that matches your installation of Eclipse. (The SDK download contains documentation and source, while the runtime download does not.) Exit Eclipse and unzip into the "eclipse" directory's parent directory. Restart Eclipse and verify that everything is installed. To do so, go to Help->About Eclipse Platform->Plug-in Details. Check the following entries:
+
 
+
Provider        Plug-in name
+
Eclipse.org      Draw2d
+
Eclipse.org      Draw2d Documentation (SDK only)
+
Eclipse.org      Graphical Editing Framework
+
Eclipse.org      Graphical Editing Framework Documentation (SDK only)
+
Eclipse.org      Graphical Editing Framework SDK (SDK only)
+
 
+
The following directories should be present in your eclipse/plugins directory:
+
(Note: Version numbers may differ according to download. This list assumes Eclipse build 2.1.0):
+
 
+
org.eclipse.draw2d.doc.isv_2.1.0 (SDK only)
+
org.eclipse.draw2d_2.1.0
+
org.eclipse.gef.doc.isv_2.1.0 (SDK only)
+
org.eclipse.gef.source_2.1.0 (SDK only)
+
org.eclipse.gef_2.1.0
+
 
+
The following directories should be present in your eclipse/features directory:
+
(Note: Version numbers may differ according to download. This list assumes Eclipse build 2.1.0):
+
 
+
org.eclipse.gef.source_2.1.0 (SDK only)
+
org.eclipse.gef_2.1.0
+
 
+
== Why isn't GEF showing up in Eclipse? ==
+
After installing GEF by extracting it to the necessary directories, it may be necessary to accept the changes within Eclipse. This can be accomplished by going to Help->Software Updates->Manage Configuration and right-clicking on Eclipse Platform. Select "Detected Changes..." from the menu and click Finish to complete the installation. This is the most common cause of the install not showing up in the aforementioned Plug-in Details view.
+
 
+
== How do I Run the Logic Example? ==
+
Download the example that matches your version of GEF.  Exit Eclipse and unzip into the eclipse directory.  Restart Eclipse and verify it was installed by going to Help->About Eclipse Platform->Plug-in Details and checking for Logic GEF Example in the list.  Next, create a simple Project. Then run the Logic Wizard. The wizard can be found at File->New->Other (Control+N), under the Examples heading. Select the simple project as the container in which the wizard will place the example document. The document should open automatically when you press Finish.
+
 
+
== Where do I find the documentation? ==
+
The 3.1 documentation is now available online.  [[Image:help_menu-1.png]]
+
 
+
The latest documentation is available in the SDK download. After unzipping this build into your Eclipse installation directory, start Eclipse (and possibly restart after updating via the update manager), click on the Help menu and then Help Contents.
+
 
+
When the Help window opens, there will be a section called GEF and Draw2d Plug-in Developer Guide. [[Image:help_toc.png]]
+
 
+
In this section, you'll find Developer Guides which contain high-level descriptions of GEF and Draw2d, as well as API References containing javadoc. 
+
[[Image:gef_dev_guide.png]]
+
 
+
== How do I checkout GEF via CVS? ==
+
Open the CVS Repositories View using the Window menu.  Right-click on the view and select "New" --> "Repository Location..."
+
Enter the data shown here. Check out both the GEF and Draw2d plug-ins from the head stream for the most recent versions.
+
[[Image:FAQ_CVS.gif]]
+
 
+
----
+
 
+
= Developer =
+
  
 
== When should I use GEF and when should I use just Draw2d? ==
 
== When should I use GEF and when should I use just Draw2d? ==
Line 81: Line 13:
  
 
== How do I redistribute GEF with my application? ==
 
== How do I redistribute GEF with my application? ==
First off, you should probably check out the Eclipse.org Legal FAQ, the CPL FAQ, and/or the CPL itself. More information forthcoming.
+
First off, you should probably check out the [http://www.eclipse.org/legal/legalfaq.html Eclipse.org Legal FAQ], the [http://www-106.ibm.com/developerworks/library/os-cplfaq.html CPL FAQ], and/or the [http://www.eclipse.org/legal/cpl-v10.html CPL] itself. More information forthcoming.
  
 
== How do I ask questions? ==
 
== How do I ask questions? ==
Questions about the use of GEF in user projects that are not addressed in this FAQ should be posted to the GEF newsgroup. Questions and comments regarding the implementation of GEF itself should be posted to the GEF mailing list.
+
Questions about the use of GEF in user projects that are not addressed in this FAQ should be posted to the [news://news.eclipse.org/eclipse.tools.gef GEF newsgroup]. Questions and comments regarding the implementation of GEF itself should be posted to the [https://dev.eclipse.org/mailman/listinfo/gef-dev GEF mailing list].
  
 
== How do I report a bug or request a feature? ==
 
== How do I report a bug or request a feature? ==
GEF, like the Eclipse project, uses Bugzilla as its bug and feature tracking system. Entering a bug\feature report is as simple as filling in a web form on the eclipse bugzilla page. The first time you enter a bug you will need to create a new bugzilla account for yourself by providing an email address and choosing a password. Before submitting a bug, please be sure to check the list of open GEF bugs and recentely closed GEF bugs.
+
GEF, like the Eclipse project, uses [http://www.bugzilla.org/ Bugzilla] as its bug and feature tracking system. Entering a bug\feature report is as simple as filling in a web form on the [http://dev.eclipse.org/bugs/ eclipse bugzilla page]. The first time you enter a bug you will need to [http://dev.eclipse.org/bugs/createaccount.cgi create a new bugzilla account] for yourself by providing an email address and choosing a password. Before submitting a bug, please be sure to check the list of [https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&email1=&emailtype1=substring&emailassigned_to1=1&email2=&emailtype2=substring&emailreporter2=1&bugidtype=include&bug_id=&changedin=&votes=&chfieldfrom=&chfieldto=Now&chfieldvalue=&product=GEF&short_desc=&short_desc_type=allwordssubstr&long_desc=&long_desc_type=allwordssubstr&keywords=&keywords_type=anywords&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&order=Reuse+same+sort+as+last+time open GEF bugs] and [https://bugs.eclipse.org/bugs/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&product=GEF&long_desc_type=allwordssubstr&long_desc=&bug_file_loc_type=allwordssubstr&bug_file_loc=&keywords_type=allwords&keywords=&bug_status=RESOLVED&bug_status=VERIFIED&bug_status=CLOSED&emailtype1=substring&email1=&emailtype2=substring&email2=&bugidtype=include&bug_id=&votes=&changedin=7&chfieldfrom=&chfieldto=Now&chfieldvalue=&cmdtype=doit&order=Reuse+same+sort+as+last+time&field0-0-0=noop&type0-0-0=noop&value0-0-0= recently closed GEF bugs].
  
 
== Can I develop a standalone GEF application without use of the Eclipse platform? ==
 
== Can I develop a standalone GEF application without use of the Eclipse platform? ==
The official answer is No, this is not supported. The main reason involves the use of an Eclipse-specific file titled plugin.properties which GEF uses for string externalizations. However, since GEF is an open source project, modifications to the GEF codebase could potentially allow a GEF editor external to Eclipse.
+
The official answer is No, this is not supported.
  
 
== How can I get started on my GEF-based editor? ==
 
== How can I get started on my GEF-based editor? ==
The best place to investigate initially is the GEF documentation. This provides high-level concepts of GEF and Draw2d. There is also a sample GEF editor that can be downloaded at the GEF download page . The source code is made entirely available.
+
The best place to investigate initially is the [http://www.eclipse.org/gef/documentation.php GEF documentation]. This provides high-level concepts of GEF and Draw2d.
 
+
----
+
 
+
= Coding =
+
  
== How do I do "X" when the User double-clicks? ==
+
= Additional Documentation Links =
Mouse events are handled by a Draw2D event dispatcher.  When using GEF, a DomainEventDispatcher is used which allows heterogeneous handling of mouse events.  Mouse presses in general can either be processed by a Figure, or by a Tool.  A double-click is also a click, so the first event is a MouseDown, followed by a DoubleClick event.  When a MouseDown is dispatched, the event dispatcher will continue to send events to either the Figure or Tool until the Mouse is released.  So this means if the Tool processes MouseDown, it continues to get DoubleClick, dragging, and MouseUp.  If a Figure consumes the MouseDown event, it will receive these events.
+
* [[GEF/New and Noteworthy| New and Noteworthy]]
 +
* [[GEF/Reference Documentation | Reference Documentation]]
 +
* [[GEF/Articles, Tutorials, Slides | Articles, Tutorials, Slides]]
 +
* [[GEF/Examples | Examples]]
 +
* [[GEF/Troubleshooting Guide | Draw2d/GEF Troubleshooting Guide]]
  
The GEF SelectionTool already processes double-click and will send a SelectionRequest to the target EditPart under the mouse of the type REQ_OPEN.  The request is sent by calling EditPart.performRequest(Request).  This is the preferred way to do something in response to double-clicks.
+
= How do I make a suggestion for this FAQ? =
 +
This FAQ is hosted as a Wiki. Anyone can edit this page after creating an account.
  
== How do I find the location of the context menu? ==
+
[[Category:FAQ]]
Often, GEF clients want to know the location of the context menu so that, for instance, new parts can be created or pasted at that location. The context menu can be brought up via the keyboard (Shift+F10) and there's no guarantee that the mouse cursor will be over the editor (or even the active window) when the context menu comes up. Hence, we recommend to do this in a location-neutral manner. For instance, new parts can be added to the top-left visible corner of the selected container, or the location can be determined based on the location of the part that was copied.
+
[[Category:GEF]]

Latest revision as of 11:03, 1 March 2012

Contents

[edit] What is GEF

The Graphical Editing Framework is an open source framework dedicated to providing a rich, consistent graphical editing environment for applications on the Eclipse Platform.

[edit] Why should I use GEF?

GEF enables developers to easily create rich graphical editors and views within Eclipse. GEF has been used to build a variety of applications, including state diagrams, activity diagrams, class diagrams, GUI builders for AWT, Swing and SWT, and process flow editors. For more information on GEF features, please see the Project Overview.

[edit] When should I use GEF and when should I use just Draw2d?

The simple answer to this question lies in their names. Draw2d is for drawing. GEF (or Graphical Editing Framework) is for editing.

Draw2d is used for rendering and layout. If all you want is to display data, all you need is Draw2d. If, on the other hand, you want to be able to manipulate that data, you should use GEF. GEF adds important functionality for editing -- commands for changing your model, a palette and tools for selecting and manipulating the edit parts that represent your model, direct edit, accessibility support such as keyboard navigation, native drag and drop, and much more that I've probably missed.

There may be only a few of these functions that you need -- for instance, you may just want to add drag and drop support so that you can drag files from the navigator or a file explorer and drop them onto your application/view, but otherwise only need to display the dropped data and not manipulate it. This is where the line gets blurred. You'll need to weigh the advantages and disadvantages of both options. On the one hand, you could move to GEF, get a bunch of functionality that you don't need and increase the complexity of your code. Or you could stick with Draw2d and implement the functionality you need yourself, maintaining a much simpler implementation. For the above example, I would personally implement the drag and drop function myself and stick with Draw2d. However, you should also consider future needs. You may want more of these functions down the road and moving to GEF now may be helpful.

[edit] How do I redistribute GEF with my application?

First off, you should probably check out the Eclipse.org Legal FAQ, the CPL FAQ, and/or the CPL itself. More information forthcoming.

[edit] How do I ask questions?

Questions about the use of GEF in user projects that are not addressed in this FAQ should be posted to the GEF newsgroup. Questions and comments regarding the implementation of GEF itself should be posted to the GEF mailing list.

[edit] How do I report a bug or request a feature?

GEF, like the Eclipse project, uses Bugzilla as its bug and feature tracking system. Entering a bug\feature report is as simple as filling in a web form on the eclipse bugzilla page. The first time you enter a bug you will need to create a new bugzilla account for yourself by providing an email address and choosing a password. Before submitting a bug, please be sure to check the list of open GEF bugs and recently closed GEF bugs.

[edit] Can I develop a standalone GEF application without use of the Eclipse platform?

The official answer is No, this is not supported.

[edit] How can I get started on my GEF-based editor?

The best place to investigate initially is the GEF documentation. This provides high-level concepts of GEF and Draw2d.

[edit] Additional Documentation Links

[edit] How do I make a suggestion for this FAQ?

This FAQ is hosted as a Wiki. Anyone can edit this page after creating an account.