Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates/xpt/editor/palette/Utils.qvto')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/editor/palette/Utils.qvto44
1 files changed, 28 insertions, 16 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/palette/Utils.qvto b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/palette/Utils.qvto
index b7f133e41..37060a890 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/palette/Utils.qvto
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/editor/palette/Utils.qvto
@@ -1,49 +1,61 @@
+/*
+ * Copyright (c) 2006, 2009 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Artem Tikhomirov (Borland) - initial API and implementation
+ */
+
import xpt.StringOperations;
-modeltype genModel uses "http://www.eclipse.org/gmf/2008/GenModel";
+modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
library Utils;
-helper genModel::Palette::activatorFQN() : String {
+helper gmfgen::Palette::activatorFQN() : String {
return self.diagram.editorGen.plugin.getActivatorQualifiedClassName()
}
-helper genModel::AbstractToolEntry::activatorFQN() : String {
+helper gmfgen::AbstractToolEntry::activatorFQN() : String {
return self.group.palette.activatorFQN()
}
-helper genModel::ToolGroup::activatorFQN() : String {
+helper gmfgen::ToolGroup::activatorFQN() : String {
return self.palette.activatorFQN()
}
-helper i18nKey(group : genModel::EntryBase) : String {
+helper i18nKey(group : gmfgen::EntryBase) : String {
return let rv = group.createMethodName in (if rv.xpandStartsWith('get') then rv.xpandSubstring(3) else (if rv.xpandStartsWith('create') then rv.xpandSubstring(6) else rv endif) endif)
}
-helper i18nTitleKey(group : genModel::EntryBase) : String {
+helper i18nTitleKey(group : gmfgen::EntryBase) : String {
return i18nKey(group) + '_title'
}
-helper i18nDescKey(group : genModel::EntryBase) : String {
+helper i18nDescKey(group : gmfgen::EntryBase) : String {
return i18nKey(group) + '_desc'
}
-helper collectGroups(palette : genModel::Palette) : Sequence(genModel::ToolGroup) {
+helper collectGroups(palette : gmfgen::Palette) : Sequence(gmfgen::ToolGroup) {
return palette.groups->asSequence()->union(palette.groups->collect(it | collectSubGroups(it)))->asOrderedSet()->asSequence()
}
-helper collectSubGroups(group : genModel::ToolGroup) : Sequence(genModel::ToolGroup) {
- return let rv = (group.entries)[genModel::ToolGroup] in rv->union(rv->collect(g | collectSubGroups(g))->flatten()->asSet())->asSequence()
+helper collectSubGroups(group : gmfgen::ToolGroup) : Sequence(gmfgen::ToolGroup) {
+ return let rv = (group.entries)[gmfgen::ToolGroup] in rv->union(rv->collect(g | collectSubGroups(g))->flatten()->asSet())->asSequence()
}
-helper collectTools(palette : genModel::Palette) : Sequence(genModel::AbstractToolEntry) {
- return collectGroups(palette)->collect(g | (g.entries)[genModel::AbstractToolEntry])->flatten()
+helper collectTools(palette : gmfgen::Palette) : Sequence(gmfgen::AbstractToolEntry) {
+ return collectGroups(palette).entries[gmfgen::AbstractToolEntry]
}
-helper needsNodeToolEntryClass(palette : genModel::Palette) : Boolean {
- return (collectTools(palette))[genModel::ToolEntry]->exists(e | not e.genNodes->isEmpty())
+helper needsNodeToolEntryClass(palette : gmfgen::Palette) : Boolean {
+ return collectTools(palette)[gmfgen::ToolEntry]->exists(genNodes->notEmpty())
}
-helper needsLinkToolEntryClass(palette : genModel::Palette) : Boolean {
- return (collectTools(palette))[genModel::ToolEntry]->exists(e | not e.genLinks->isEmpty())
+helper needsLinkToolEntryClass(palette : gmfgen::Palette) : Boolean {
+ return collectTools(palette)[gmfgen::ToolEntry]->exists(genLinks->notEmpty())
}

Back to the top