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

Bug 349119

Summary: CanonicalEditPolicy deletes Notes and Text per default
Product: [Modeling] GMF-Runtime Reporter: Andreas Muelder <Andreas.Muelder>
Component: GeneralAssignee: Project Inbox <gmf-runtime-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: markus.muehlbrandt
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Andreas Muelder CLA 2011-06-11 08:11:38 EDT
Build Identifier: 

When I use a CanonicalEditPolicy or a ConnectionCanonicalEditPolicy, Notes and Text elements are deleted, because the default behaviour is to delete all views where the semantic model element is null.

I think it would be better to check for these view types in the #shouldDeleteView() method, instead of simply returning true as the default.

Possible default implementation could be someting like this:

protected boolean shouldDeleteView(View view) {
  if (ViewType.NOTE.equals(view.getType())
      | ViewType.NOTEATTACHMENT.equals(view.getType())
       || ViewType.TEXT.equals(view.getType())) {
    return false;
   }
   return true;
}


Reproducible: Always
Comment 1 Andreas Muelder CLA 2012-12-03 11:06:13 EST
shall I provide a patch for this?