1
+ ifdef::env-github[]
2
+ :imagesdir: ../guide/
3
+ endif::[]
4
+
1
5
= GEF Developer's Guide
2
6
3
7
== GEF Programmer's Guide +
4
8
org.eclipse.gef
5
9
6
- * link:#Overview[Overview] - Description of the "big picture"
7
- * link:#When[When to Use] - How can GEF and the Eclipse Platform be used
8
- * link:#EditParts[EditParts] - An introduction to primary building block
9
- of GEF
10
- * link:#GraphicalView[Graphical View] - How to create a Graphical View
11
- of your Model
12
- * link:#Editing[Editing and Edit Policies] - Adding editing support to
13
- your Graphical View
14
- * link:#Lifecycle[Editpart Lifecycle] - Interesting events to know about
15
- * link:#ToolPalette[Tools and Palette]
16
- * link:#Interactions[Interactions] - the GEF interactions and the
17
- players involved
18
-
19
- === [#Overview]#Overview#
10
+ * xref:#overview[Overview] - Description of the "big picture"
11
+ * xref:#when-can-i-use-gef[When to Use] - How can GEF and the Eclipse Platform
12
+ be used
13
+ * xref:#an-introduction-to-editparts[EditParts] - An introduction to primary
14
+ building block of GEF
15
+ * xref:#creating-a-graphical-view-of-a-model[Graphical View] - How to create a
16
+ Graphical View of your Model
17
+ * xref:#editing-and-editpolicies[Editing and Edit Policies] - Adding editing
18
+ support to your Graphical View
19
+ * xref:#the-editpart-lifecycle[Editpart Lifecycle] - Interesting events to know
20
+ about
21
+ * xref:#tools-and-the-palette[Tools and Palette]
22
+ * xref:#types-of-interactions-in-gef[Interactions] - the GEF interactions and
23
+ the players involved
24
+
25
+ === [#overview]#Overview#
20
26
21
27
Draw2d focuses on efficient painting and layout of figures. The GEF
22
28
plug-in adds editing on top of Draw2d. The purpose of this framework is
@@ -78,7 +84,7 @@ JFace viewers in that they manage an SWT Control. Viewers are also a
78
84
selection provider, and the unit of selection is the EditPart.
79
85
____
80
86
81
- === [#When ]#When can I use GEF?#
87
+ === [#when-can-i-use-gef ]#When can I use GEF?#
82
88
83
89
GEF can be used anywhere that you can use an SWT Control inside a
84
90
Workbench. It could be an editor, a view, a wizard page, etc. Most
@@ -88,7 +94,7 @@ outline page.
88
94
GEF requires the Eclipse Rich Client Platform (RCP) and the "views"
89
95
plug-in (`org.eclipse.ui.views`), which provides property sheet support.
90
96
91
- === [#EditParts ]#An Introduction to EditParts#
97
+ === [#an-introduction-to-editparts ]#An Introduction to EditParts#
92
98
93
99
Editparts associate their view and model, but they also form their own
94
100
structure. An editpart maintains children. Usually this corresponds to a
@@ -139,7 +145,7 @@ As the name implies, editparts must support editing the model. But first
139
145
we will focus on the initial steps of building an application, which is
140
146
to display the initial model.
141
147
142
- === [#GraphicalView ]#Creating a Graphical View of a Model#
148
+ === [#creating-a-graphical-view-of-a-model ]#Creating a Graphical View of a Model#
143
149
144
150
Once you have a model and some figures with which to view it, the next
145
151
step is to put the pieces together. This means creating the editparts
@@ -256,7 +262,7 @@ model elements for which children editparts should be created.
256
262
elements returned here indicate connections for which the editpart is
257
263
the source or target.
258
264
259
- === [#Editing ]#Editing and EditPolicies#
265
+ === [#editing-and-editpolicies ]#Editing and EditPolicies#
260
266
261
267
Once you have some editparts displayed it's time to start editing.
262
268
Editing is usually the most complex task an editpart performs. Editing
@@ -344,7 +350,7 @@ removed or swapped out. The rest of the time it is just a good habit.
344
350
GEF also provides several policies for use with these roles. Many of
345
351
these policies must be extended to fill in the missing pieces that work
346
352
with the application's model. EditPolicies are discussed in more detail
347
- in the section on link:#Interactions [interactions].
353
+ in the section on xref:#types-of-interactions-in-gef [interactions].
348
354
| image:images/editing2.gif[image]
349
355
|===
350
356
@@ -356,7 +362,7 @@ encapsulate and combine changes to the application's model.
356
362
An application has a single command stack. Commands must be executed
357
363
using the command stack rather than directly calling execute.
358
364
359
- === [#Lifecycle ]#The EditPart Lifecycle#
365
+ === [#the-editpart-lifecycle ]#The EditPart Lifecycle#
360
366
361
367
With respect to lifecycle, editpart implementations typically only have
362
368
to worry about extending activation and deactivation, which is when the
@@ -448,7 +454,7 @@ editparts should not contain any important state that must be restored
448
454
on undo.
449
455
|===
450
456
451
- === [#ToolPalette ]#Tools and the Palette#
457
+ === [#tools-and-the-palette ]#Tools and the Palette#
452
458
453
459
A tool handles most events from a viewer. The `EditDomain` keeps track
454
460
of the currently active tool. Applications may use the palette
@@ -470,7 +476,7 @@ A tool is activated by setting it on the EditDomain. There is only one
470
476
active tool for all viewers in the domain. If a palette is being used,
471
477
selecting a tool in the palette will activate that tool.
472
478
473
- ==== [#Tools/Selection ]#The Selection Tool#
479
+ ==== [#the-selection-tool ]#The Selection Tool#
474
480
475
481
The Selection Tool is the primary tool used in GEF and is often the
476
482
default for an application. The selection tool is unique in its ability
@@ -495,7 +501,7 @@ selection gesture, it modifies the viewer's selection. Trackers even
495
501
handle events like double-click.
496
502
497
503
For more on the selection tool and trackers, see the section on
498
- link:#Interactions/Selection [Selection Interaction].
504
+ xref:#selection [Selection Interaction].
499
505
500
506
==== Palette
501
507
@@ -517,13 +523,13 @@ The PaletteViewer displays a Palette model, which starts with the
517
523
which open and close, or groups, which do not. Each grouping element
518
524
then contains Palette Entries. An Entry defines either a tool or
519
525
template for the User. Templates are described below in
520
- link:#Interactions/Creation [Creation].
526
+ xref:#creation [Creation].
521
527
522
528
The Palette provides several display modes, such as icon-only. You can
523
529
also provide a customizer to allow the user to modify or create palette
524
530
content.
525
531
526
- === [#Interactions ]#Types of Interactions in GEF#
532
+ === [#types-of-interactions-in-gef ]#Types of Interactions in GEF#
527
533
528
534
This section discusses the various types of interactions that are
529
535
included in the framework, and which parts of the framework are involved
@@ -551,7 +557,7 @@ These are just constants defined on the EditPolicy interface.
551
557
* Any EditPolicy implementations provided in GEF for use with the
552
558
interaction.
553
559
554
- ==== [#Interactions/Selection ]#Selection#
560
+ ==== [#selection ]#Selection#
555
561
556
562
[.custom,width="100%",cols="25%,25%,25%,25%",options="header"]
557
563
|===
@@ -573,7 +579,7 @@ No interaction is more basic or universal than selecting items in a
573
579
viewer. Most of the interactions discussed here operate on what is
574
580
currently selected. Yet, selection is a complex topic and there are
575
581
several steps involved. The Selection Tool was
576
- link:#Tools/Selection [briefly discussed] in the above section on tools.
582
+ xref:#the-selection-tool [briefly discussed] in the above section on tools.
577
583
578
584
Let's first define selection. Selection is a List of EditParts
579
585
maintained by an EditPartViewer. Changes to the selection are made by
@@ -736,7 +742,7 @@ deleted as part of multiple selection. The logic example's delete
736
742
command addresses all of these concerns.
737
743
|===
738
744
739
- ==== [#Interactions/Creation ]#Creation#
745
+ ==== [#creation ]#Creation#
740
746
741
747
[.custom,width="100%",cols="25%,25%,25%,25%",options="header",]
742
748
|===
0 commit comments