Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2010-03-09 15:12:01 -0500
committeratikhomirov2010-03-09 15:12:01 -0500
commit9dde6fd77983286b34dfc519d473dc3978e1d6eb (patch)
tree1119e205d3f38d20326d455e6b853fe97f07327b /plugins/org.eclipse.gmf.codegen/models/gmfgen.emf
parent7ebce3d244ace680f46fd8e3f3303865f54ef71b (diff)
downloadorg.eclipse.gmf-tooling-9dde6fd77983286b34dfc519d473dc3978e1d6eb.tar.gz
org.eclipse.gmf-tooling-9dde6fd77983286b34dfc519d473dc3978e1d6eb.tar.xz
org.eclipse.gmf-tooling-9dde6fd77983286b34dfc519d473dc3978e1d6eb.zip
[138179] Allow to define labels based on attributes of referenced objects - script/expression-backed labels
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/models/gmfgen.emf')
-rw-r--r--plugins/org.eclipse.gmf.codegen/models/gmfgen.emf23
1 files changed, 16 insertions, 7 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf b/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf
index 8ccb8316d..913fe3bfc 100644
--- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf
+++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.emf
@@ -72,8 +72,11 @@ class GenDiagram extends GenContainerBase, PackageNames, ProviderClassNames, Lin
val GenCompartment[*]#diagram compartments;
val Palette[?]#diagram palette;
attr boolean synchronized = true;
+ @genmodel(documentation="Handy operation to get top and child nodes")
op GenNode[*] getAllNodes();
+ @genmodel(documentation="All nodes (top and child) and compartments")
op GenChildContainer[*] getAllChildContainers();
+ @genmodel(documentation="All nodes, compartments and diagram itself")
op GenContainerBase[*] getAllContainers();
@genmodel(documentation="Gets the name of the class to hold the initializer methods for domain elements")
op String getElementInitializersClassName();
@@ -847,12 +850,10 @@ class DesignLabelModelFacet extends LabelModelFacet {
@genmodel(documentation="Model facet of a label calculated with an expression")
class ExpressionLabelModelFacet extends LabelModelFacet {
- @genmodel(documentation="Expression to calculate user-readable label value")
- ref ValueExpression[1] viewExpression;
- @genmodel(documentation="Optional expression to represent value for editing")
- ref ValueExpression[?] editExpression;
- @genmodel(documentation="Optional expression to answer whether user input is ok for further parsing")
- ref GenConstraint[?] validateExpression;
+ // right now it is just a marker, in case we need extra information in future
+ // ExpressionLabelParser doesn't rely on any specific kind of model facet.
+ // XXX perhaps, we may try to use other LabelModelFacets (e.g. FeatureLabelModelFacet) to generate
+ // extra support (i.e. handle notification changes based on #features)
}
/////////////
@@ -1588,11 +1589,19 @@ class PredefinedParser extends GenParserImplementation {
op String getQualifiedClassName();
}
-@genmodel(documentation="")
+@genmodel(documentation="Parser implementation that uses expressions to produce string values")
class ExpressionLabelParser extends GenParserImplementation {
@genmodel(documentation="Provides means to alter name of parser implementation class")
attr String[?] className;
op String getQualifiedClassName();
+ ref genmodel.GenClass[1] expressionContext;
+ //
+ @genmodel(documentation="Expression to calculate user-readable label value; facet's owner type is evaluation context.")
+ ref ValueExpression[1] viewExpression;
+ @genmodel(documentation="Optional expression to represent value for editing")
+ ref ValueExpression[?] editExpression;
+ @genmodel(documentation="Optional expression to answer whether user input is ok for further parsing. Note, context here is string, not facet's owner type")
+ ref GenConstraint[?] validateExpression;
}
@genmodel(documentation="Handwritten or otherwise available IParser implementation")

Back to the top