This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 116994 - Removing an imported element in a package also removes the original element
Summary: Removing an imported element in a package also removes the original element
Status: VERIFIED FIXED
Alias: None
Product: uml
Classification: Unclassified
Component: General (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Yang Su
URL:
Keywords: UI
Depends on:
Blocks:
 
Reported: 2007-09-27 23:30 UTC by Joanne Lau
Modified: 2007-10-25 19:07 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joanne Lau 2007-09-27 23:30:04 UTC
NB: 200709270227


Steps to reproduce:

1) Create 2 UML Java Platform projects (Proj1, Proj2)
2) In Proj2, create a package (Pack1)
3) In Proj2, create 2 class elements in Pack1(C1, C2)
4) DnD Pack1 from Proj2 to Proj1, select No to the "Moving Elements in Different Project" dialog
5) In Proj1, Expand Imported Elements node -> Proj1 -> Pack1 (C1 and C2 are listed under Pack1)
6) In Proj2, also expand Model -> Pack1 (C1 and C2 are also listed under Pack1)
6) In Proj1, delete C1 under Pack1 in Imported Elements
   Notice that the original element C1 in Proj2 has also been deleted as well.  This should not happen.

   I also try remove the package Pack1 under Imported Elements in Proj1,  the behavior is correct. The imported 
   package is removed in Proj1. The original package in Proj2 as well as all the elements underneath package 
   still remain.
Comment 1 Yang Su 2007-09-28 18:55:37 UTC
Removing original elements inadvertently results in user data loss, raise it to p2. 
Comment 2 George Vasick 2007-10-10 19:22:21 UTC
Propose to add "Remove from Import" menu item and checkbox to differentiate removing imported itesm from deleting items.
Comment 3 jrojcek 2007-10-11 10:29:42 UTC
I'm not sure that introducing new action is the right solution. Maybe you're proposal is about *replacing* the existing "Delete" action by "Remove from 
Import". The new action would show up a dialog that would ask the user whether to delete the original item or just remove the imported item. Is that correct?

I personally would suggest to just change the behavior of "Delete" action that simple *removes* the imported item and keeps the original item.  My guess is 
that's what majority of users would expect to happen. Maybe you can rename it to "Remove" to make it clear what's going on.
Comment 4 Yang Su 2007-10-12 21:50:05 UTC
The decision was made to retain 'Delete' menu item for both imported element and all its sub nodes, but the 'Delete' on
imported element will remove the element from imported list, but offer user an option to also delete it from original
model, while 'Delete' on imported element sub nodes will actually delete those nodes from original model with the
default object delete confirmation dialog.

Comment 5 Joanne Lau 2007-10-25 19:07:02 UTC
Fix verified in build 200710232304