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

Bug 447675

Summary: Completion in a CreateLineTool does not display the correct context type.
Product: [Modeling] Sirius Reporter: Maxime Porhel <maxime.porhel>
Component: TableAssignee: Project Inbox <sirius.table-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: belqassim.djafer, laurent.redor, mickael.lanoe, pierre-charles.david
Version: 1.0.1Keywords: triaged
Target Milestone: 3.0.0M5   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Attachments:
Description Flags
Sample VSM to reproduce the issue none

Description Maxime Porhel CLA 2014-10-17 05:57:52 EDT
Create a CreateLineMapping in a Line Mapping
Set the mapping reference to the line to create.
Type [/] in the precondition field and call the completion. 

thisEObject will be typed by the referenced line to create. 
It should be the type of the clicked line, ie. the type of the parent mapping (see DeleteLineTool).
Comment 1 Maxime Porhel CLA 2014-10-17 05:58:47 EDT
A pass on other tool and corresponding Tree tools could be done to find other similar errors.
Comment 2 Maxime Porhel CLA 2014-11-06 09:11:59 EST
TableInterpretedTargetSwitch:
  public Option<Collection<String>> caseCreateLineTool(CreateLineTool object) {
      return globalSwitch.doSwitch(object.getMapping(), false);
  }

We should not get the DomainClass of the mapping 'to create', but the domain class of the 'selected' element's mapping, i.e. object.eContainer().

See the other case methods to handle the precondition with the eContainer and decide what to do for other cases (operation done in the tools, ...)

the other tools in table, tree (and also Diagram) will have to be checked.
Comment 3 Mickael LANOE CLA 2014-12-03 04:39:24 EST
currently working on it
Comment 4 Mickael LANOE CLA 2014-12-03 04:39:45 EST
https://git.eclipse.org/r/#/c/37462/
Comment 5 Pierre-Charles David CLA 2014-12-29 10:58:02 EST
Created attachment 249649 [details]
Sample VSM to reproduce the issue

Steps to reproduce using the attached VSM:
1. Open the VSM and go to the (only) line creation tool.
2. In the tool's precondition field, enter "[/]" and trigger the completion.
3. In the completion proposal, thisEObject appears to be typed as an EAttribute, which is the domain class of the line the tool will (maybe) create. It should be EClass, the domain class of the line mapping on which the tool will be invoked: testing a precondition only makes sense depending on the context (the EClass), not the on result (EAttribute), which does not even exist at pre-condition check time.
Comment 6 Pierre-Charles David CLA 2015-01-05 03:40:42 EST
Fixed by fb742c840f580d48e27c07db11bc06b49a4a67ee.
Comment 7 Belqassim Djafer CLA 2015-04-09 09:53:13 EDT
Verified on Sirius 3.0.0M6
Comment 8 Pierre-Charles David CLA 2015-06-24 11:16:25 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.