Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2008-12-29 07:41:38 -0500
committerashatalin2008-12-29 07:41:38 -0500
commitfc1dfb3b462e159eec1b6031bb41ab79c762474b (patch)
tree66acb7873f68640147106dcd919a5041ecbc918b /plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/Utils.qvto
parent7f3bb1960b122d5d9c4edae8dc1c330032c9cf60 (diff)
downloadorg.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.gz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.xz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.zip
QVTO-based xpand implementation was merged to HEAD
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/Utils.qvto')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/Utils.qvto255
1 files changed, 255 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/Utils.qvto b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/Utils.qvto
new file mode 100644
index 000000000..3891b3bfa
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/Utils.qvto
@@ -0,0 +1,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