Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f8842b4254b1e63d438ac6add641f3c05b699616 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
@namespace(uri="http://www.eclipse.org/gmf/2005/ToolDefinition", prefix="gmftool")
package tooldef;

/////////////////
// Root container
//

class ToolRegistry {
	@genmodel(documentation="Instead of placing	common actions somewhere in menu hierarchy and referencing them in (2..n) cases, keep them in this central registry and use ItemRef everywhere (i.e. in 1..n cases)")
	val MenuAction[*] sharedActions;
	val Menu[*] allMenus;
	val Palette[?] palette;
}

//////////
// Palette
//

abstract class AbstractTool {
	val Image smallIcon;
	val Image largeIcon;
	attr String title;
	attr String description;
}

abstract class ToolContainer extends AbstractTool {
	// TODO opposite ref
	ordered val AbstractTool[*] tools;
}

class PaletteSeparator extends AbstractTool {
}

class ToolGroup extends ToolContainer {
	attr boolean collapsible;
	attr boolean stack;
	ref AbstractTool[?] active;
}

class Palette extends ToolContainer {
	ref AbstractTool[?] default;
}

@genmodel(documentation="predefined, like zoom or marquee")
class StandardTool extends AbstractTool {
	//attr String identifier;
	attr StandardToolKind toolKind;
}

enum StandardToolKind {
	SELECT;
	SELECT_PAN;
	MARQUEE;
	ZOOM_PAN;
	ZOOM_IN;
	ZOOM_OUT;
}

class CreationTool extends AbstractTool {
}

class GenericTool extends AbstractTool {
	attr String[1] toolClass;
}

/////////////////////
// Menus and toolbars
//

abstract interface ItemBase {
}

abstract class Menu {
	ordered val ItemBase[*] items; 
}

class Separator extends ItemBase {
	attr String name;
}

class PredefinedItem extends ItemBase {
	attr String identifier;
}

class PredefinedMenu extends Menu, PredefinedItem {
}

abstract interface ContributionItem extends ItemBase {
	val Image icon;
	attr String title;
}

class MenuAction extends ContributionItem {
	attr ActionKind kind;
	attr String hotKey;
}

class ItemRef extends ItemBase {
	// constraints: self.item not instanceof Separator?
	ref ItemBase[1] item;
}

class ContextMenu extends Menu {
	// constraint: isUndefined(default) or super.items.contains(default)
	// FIXME - what if default should be itemRef? int (=position) instead?
	ref MenuAction[?] default;
}

class PopupMenu extends Menu, ContributionItem {
	id attr String iD;
}

@genmodel(documentation="no default action and no id, just a collection of items")
class MainMenu extends Menu {
	attr String title;
}

class Toolbar extends Menu {
}

///////////////
// Action kinds
//

enum ActionKind {
	CREATE;
	PROPCHANGE; // detailsLevel, isVisible, modifier
	MODIFY;
	PROCESS; // READ?
	CUSTOM = 99;
}


//class OutlineView {
//	attr boolean dontneedthat;
//}

/////////
// Images
//

abstract interface Image {
}

@genmodel(documentation="Delegate to EMF.Edit providers")
class DefaultImage extends Image {
}

@genmodel(documentation="Image bundled as part of distribution")
class BundleImage extends Image {
	@genmodel(documentation="Relative path to image")
	attr String path;
	@genmodel(documentation="Empty value means image path is relative to generated bundle")
	attr String bundle;
}

/////////////////////////////
// Customizing Property Sheet
//

abstract interface StyleSelector {
	op boolean isOk(Object style);
}

class GenericStyleSelector extends StyleSelector {
	attr AppearanceStyle[+] values;
}

enum AppearanceStyle {
	Font;
	Fill;
	Line;
}

Back to the top