Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3891b3bfa334b449fed6586c6273f5eb6be99b26 (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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
modeltype genModel uses "http://www.eclipse.org/gmf/2008/GenModel";

library Utils;

helper isStandaloneDomainModel(diagram : genModel::GenDiagram) : Boolean {
	return not diagram.editorGen.sameFileForDiagramAndModel and null <> diagram.domainDiagramElement
}

helper hasNavigator(editorView : genModel::GenEditorView) : Boolean {
	return null <> editorView.editorGen.navigator
}

helper addGotoMarker(editorView : genModel::GenEditorView, implementsList : Sequence(String)) : Sequence(String) {
	return (if isIDEMode(editorView) then implementsList->including('org.eclipse.ui.ide.IGotoMarker') else implementsList endif)
}

helper isIDEMode(editorView : genModel::GenEditorView) : Boolean {
	return null = editorView.editorGen.application
}

helper addReadOnlyPropSheet(editorView : genModel::GenEditorView, implementsList : Sequence(String)) : Sequence(String) {
	return (if hasPropertySheet(editorView) and editorView.editorGen.propertySheet.readOnly then implementsList->including('org.eclipse.gmf.runtime.diagram.ui.properties.views.IReadOnlyDiagramPropertySheetPageContributor') else implementsList endif)
}

helper hasPropertySheet(editorView : genModel::GenEditorView) : Boolean {
	return null <> editorView.editorGen.propertySheet
}

helper getEditorImplementsList(editorView : genModel::GenEditorView) : Sequence(String) {
	return addGotoMarker(editorView, addReadOnlyPropSheet(editorView, Sequence {  }))
}

helper getContainedSemanticNodes(container : genModel::GenContainerBase) : Sequence(genModel::GenNode) {
	return container.containedNodes->select(node | null <> node.modelFacet)->asSequence()
}

helper genModel::GenCommonBase::getEssentialVisualChildren() : Collection(genModel::GenCommonBase) {
	return Sequence {  }
}

helper genModel::GenLink::getEssentialVisualChildren() : Collection(genModel::GenCommonBase) {
	return self.labels
}

helper genModel::GenContainerBase::getEssentialVisualChildren() : Collection(genModel::GenCommonBase) {
	return self.containedNodes
}

helper genModel::GenNode::getEssentialVisualChildren() : Collection(genModel::GenCommonBase) {
	return ((Sequence {  })[genModel::GenNodeLabel]->union(self.labels->asSequence()))[genModel::GenCommonBase]->union(self.compartments->asSequence())->union(self.containedNodes->asSequence())
}

helper defaultShortcutCreationWizardClassName(diagram : genModel::GenDiagram) : String {
	return 'ShortcutCreationWizard'
}

helper defaultModelElementSelectionPageClassName(diagram : genModel::GenDiagram) : String {
	return 'ModelElementSelectionPage'
}

helper defaultValidateActionClassName(diagram : genModel::GenDiagram) : String {
	return 'ValidateAction'
}

helper i18nKeyForDocumentProvider(diagram : genModel::GenDiagram) : String {
	return diagram.documentProviderClassName
}

helper i18nKeyForDocumentProviderIsModifiable(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDocumentProvider(diagram) + '_isModifiable'
}

helper i18nKeyForDocumentProviderHandleElementContentChanged(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDocumentProvider(diagram) + '_handleElementContentChanged'
}

helper i18nKeyForDocumentProviderIncorrectInputError(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDocumentProvider(diagram) + '.IncorrectInputError'
}

helper i18nKeyForDocumentProviderNoDiagramInResourceError(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDocumentProvider(diagram) + '.NoDiagramInResourceError'
}

helper i18nKeyForDocumentProviderDiagramLoadingError(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDocumentProvider(diagram) + '.DiagramLoadingError'
}

helper i18nKeyForDocumentUnsynchronizedFileSaveError(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDocumentProvider(diagram) + '.UnsynchronizedFileSaveError'
}

helper i18nKeyForDocumentSaveDiagramTask(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDocumentProvider(diagram) + '.SaveDiagramTask'
}

helper i18nKeyForDocumentSaveNextResourceTask(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDocumentProvider(diagram) + '.SaveNextResourceTask'
}

helper i18nKeyForDocumentSaveAs(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDocumentProvider(diagram) + '.SaveAsOperation'
}

helper i18nKeyForDiagramEditorUtil(diagram : genModel::GenDiagram) : String {
	return diagram.diagramEditorUtilClassName
}

helper i18nKeyForOpenModelResourceErrorDialog(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDiagramEditorUtil(diagram) + '.OpenModelResourceErrorDialog'
}

helper i18nKeyForCreateDiagramProgressTask(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDiagramEditorUtil(diagram) + '.CreateDiagramProgressTask'
}

helper i18nKeyForCreateDiagramCommandLabel(diagram : genModel::GenDiagram) : String {
	return i18nKeyForDiagramEditorUtil(diagram) + '.CreateDiagramCommandLabel'
}

helper i18nKeyForInitDiagramFileResourceErrorDialog() : String {
	return 'InitDiagramFile.ResourceErrorDialog'
}

helper i18nKeyForInitDiagramFileWizardTitle() : String {
	return 'InitDiagramFile.WizardTitle'
}

helper i18nKeyForInitDiagramOpenFileDialogTitle() : String {
	return 'InitDiagramFile.OpenModelFileDialogTitle'
}

helper i18nKeyForNewDiagramFileWizard(diagram : genModel::GenDiagram) : String {
	return diagram.newDiagramFileWizardClassName
}

helper i18nKeyForNewDiagramFileWizardCreationPage(diagram : genModel::GenDiagram) : String {
	return i18nKeyForNewDiagramFileWizard(diagram) + '.CreationPage'
}

helper i18nKeyForNewDiagramFileWizardRootSelectionPage(diagram : genModel::GenDiagram) : String {
	return i18nKeyForNewDiagramFileWizard(diagram) + '.RootSelectionPage'
}

helper i18nKeyForNewDiagramFileWizardRootSelectionPageSelectionTitle(diagram : genModel::GenDiagram) : String {
	return i18nKeyForNewDiagramFileWizardRootSelectionPage(diagram) + 'SelectionTitle'
}

helper i18nKeyForNewDiagramFileWizardRootSelectionPageNoSelectionMessage(diagram : genModel::GenDiagram) : String {
	return i18nKeyForNewDiagramFileWizardRootSelectionPage(diagram) + 'NoSelectionMessage'
}

helper i18nKeyForNewDiagramFileWizardRootSelectionPageInvalidSelectionMessage(diagram : genModel::GenDiagram) : String {
	return i18nKeyForNewDiagramFileWizardRootSelectionPage(diagram) + 'InvalidSelectionMessage'
}

helper i18nKeyForNewDiagramFileWizardInitDiagramCommand(diagram : genModel::GenDiagram) : String {
	return i18nKeyForNewDiagramFileWizard(diagram) + '.InitDiagramCommand'
}

helper i18nKeyForNewDiagramFileWizardIncorrectRootError(diagram : genModel::GenDiagram) : String {
	return i18nKeyForNewDiagramFileWizard(diagram) + '.IncorrectRootError'
}

helper i18nKeyForSavingDeletedFile(editor : genModel::GenEditorView) : String {
	return i18nKeyForEditor(editor) + '.SavingDeletedFile'
}

helper i18nKeyForSaveAsProblems(editor : genModel::GenEditorView) : String {
	return i18nKeyForEditor(editor) + '.SaveAsError'
}

helper i18nKeyForSaveProblems(editor : genModel::GenEditorView) : String {
	return i18nKeyForEditor(editor) + '.SaveError'
}

helper i18nKeyForEditor(editor : genModel::GenEditorView) : String {
	return editor.className
}

helper i18nKeyForSelectModelElement(diagram : genModel::GenDiagram) : String {
	return i18nKeyForElementChooser(diagram) + '.SelectModelElement'
}

helper i18nKeyForElementChooser(diagram : genModel::GenDiagram) : String {
	return diagram.elementChooserClassName
}

helper i18nKeyForCreateShortcutOpenModel() : String {
	return 'CreateShortcutAction.OpenModel'
}

helper i18nKeyForCreateShortcutWizard() : String {
	return 'CreateShortcutAction.Wizard'
}

helper i18nKeyForShortcutWizardReferencedElementPage(diagram : genModel::GenDiagram) : String {
	return defaultShortcutCreationWizardClassName(diagram) + '.ReferencedElementSelectionPage'
}

helper i18nKeyForModelElementSelectionPage(diagram : genModel::GenDiagram) : String {
	return defaultModelElementSelectionPageClassName(diagram)
}

helper i18nKeyForValidateAction(diagram : genModel::GenDiagram) : String {
	return defaultValidateActionClassName(diagram)
}

helper i18nKeyForShortcutWizardReferencedElementPageEmptyError(diagram : genModel::GenDiagram) : String {
	return i18nKeyForShortcutWizardReferencedElementPage(diagram) + 'EmptyError'
}

helper i18nKeyForShortcutWizardReferencedElementPageInvalidError(diagram : genModel::GenDiagram) : String {
	return i18nKeyForShortcutWizardReferencedElementPage(diagram) + 'InvalidError'
}

helper i18nKeyForCreationWizard(diagram : genModel::GenDiagram) : String {
	return diagram.creationWizardClassName
}

helper i18nKeyForCreationWizardDiagramPage(diagram : genModel::GenDiagram) : String {
	return diagram.creationWizardClassName + '.DiagramModelFilePage'
}

helper i18nKeyForCreationWizardDomainPage(diagram : genModel::GenDiagram) : String {
	return diagram.creationWizardClassName + '.DomainModelFilePage'
}

helper i18nKeyForCreationWizardOpenEditorError(diagram : genModel::GenDiagram) : String {
	return diagram.creationWizardClassName + 'OpenEditorError'
}

helper i18nKeyForCreationWizardCreationError(diagram : genModel::GenDiagram) : String {
	return diagram.creationWizardClassName + 'CreationError'
}

helper i18nKeyForCreationWizardPageExtensionError(diagram : genModel::GenDiagram) : String {
	return diagram.creationWizardPageClassName + 'ExtensionError'
}

helper titleKey(dialogKey : String) : String {
	return dialogKey + 'Title'
}

helper messageKey(dialogKey : String) : String {
	return dialogKey + 'Message'
}

helper nameKey(dialogKey : String) : String {
	return dialogKey + 'Name'
}

helper descriptionKey(dialogKey : String) : String {
	return dialogKey + 'Description'
}

Back to the top