Bug 349119 - CanonicalEditPolicy deletes Notes and Text per default
Summary: CanonicalEditPolicy deletes Notes and Text per default
Status: NEW
Alias: None
Product: GMF-Runtime
Classification: Modeling
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-11 08:11 EDT by Andreas Muelder CLA
Modified: 2012-12-03 11:06 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?