Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 459771

Summary: Label Feature Name should be optional
Product: [Modeling] Sirius Reporter: Goulwen Le Fur <goulwen.lefur>
Component: TableAssignee: Maxime Porhel <maxime.porhel>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: belqassim.djafer, florian.barbin, maxime.porhel, pierre-charles.david
Version: 2.0.0Keywords: triaged
Target Milestone: 3.0.0M6   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/42017
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=e830c20cca80b28476a69b7877ecccdcce7c4fb1
Whiteboard: trivial

Description Goulwen Le Fur CLA 2015-02-12 08:15:34 EST
Currently, the label feature name properties of the Feature Column is required. In some use case, this prevent to correctly define "edition" tables. Basically, I want to display two kinds of object in a table (A and B) with any common feature. 

In this case, I'm unable to define a unique column display a given feature for the A's elements and another feature for B's elements. I have to give a label feature name and :
 - either I use a feature from one or another element type and in this case the column's values are displayed only for the correctly configured element
 - or I let the field blank (or invalid) and the column doesn't work at all
Comment 1 Maxime Porhel CLA 2015-02-12 09:08:52 EST
We could add a specific keyword like * which if detected will disable the feature existency for the type of the current line semantic target.

See org.eclipse.sirius.table.metamodel.table.description.FeatureColumnMapping.getFeatureName() line 370:

  if (newCell.getTarget() == null || !accessor.eValid(newCell.getTarget(), cMapping.getFeatureName())) {
   // We don't create a cell in this case.
   newCell = null;
  }
Comment 2 Maxime Porhel CLA 2015-02-17 03:48:39 EST
A fist workaround could be to put in featureName the name of a common (duplicated or from a supertype) EStructuralFeature and use the label expression to display the wanted information. 

A second workaround might be to use the feature parent expression to use an element as cell target but use the label expression and the line variable to compute and display the wanted information, but the properties view will display the target, you might have to use the associated elements expression to add additional elements.
Comment 3 Eclipse Genie CLA 2015-02-17 04:27:40 EST
New Gerrit change created: https://git.eclipse.org/r/42017
Comment 6 Belqassim Djafer CLA 2015-04-14 05:30:53 EDT
Verified on Sirius 3.0.0M6
Comment 7 Pierre-Charles David CLA 2015-06-24 11:12:53 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.