Community
Participate
Working Groups
Currently, the generated editor does not handle containment proxies very well. For example, there is no way to save changes if an element in a referenced resource (not the first resource in the resource set) is modified. Also, the editor does not respond well in scenarios where an element has been removed from a child resource (only) but is attached to the parent resource (the element is removed entirely from the tree viewer).
The fix is in CVS. I've added an override for fixInstanceClass() to the PackageClass.javajet template, with the interface package name hard-coded.
Oops. It seems I attached that comment to the wrong bug. :( This one should be done quite soon...
The enhancement is in CVS. When an object can be moved into another resource, a "Control..." item will appear in the pop-up and pull-down menu for the editor. When an object has already been controlled, the text changes to "Uncontrol". This menu item is backed by ControlAction, which simply uses a wrapped AddCommand or RemoveCommand to add or remove the object to or from the contents of another resource. Objects are only shown in their usual place in the containment tree: one icon overlay will be used to indicate that an object has been controlled, and another will appear on the resource to which it has been added, indicating that the resource is a control target. Until those icons are ready, " [c]" and " [t]" are being added to the label text. ItemProviderAdapter.annotateText() is doing the former and will go away when the new icons are ready. ResourceDialog was created, based on the LoadResourceDialog inner class from LoadResourceAction, as a reusable base specifying one or more resource URIs with file system and workspace browsing. It is now extended by dialogs in both LoadResourceAction and ControlAction. EditingDomain was extended by adding isControllable(), allowing the domain to specify whether a given object can be controlled. The default base implementation, AdapterFactoryEditingDomain, implements this method to check the object's container feature for isResolveProxies() and ensures that the resources are not read-only. ResourceItemProvider was changed to suppress controlled objects from appearing beneath the resource, and to cause a notification from the resource's contents to fully refresh the viewer. This is necessary because the text (later the icon) of the controlled object will have to change at this point. Typically, a containment proxy will be resolved as a result of the viewer's hasChildren() or getChildren() request to an item provider. At this point, the viewer is not in a state where it can be refreshed. Previously, if the notification was fired from on the UI thread, the viewer refresh would be done immediately. This has been changed so that viewer refreshes are always done asynchronously. To minimize the performance impact, these notifications are now combined (to avoid redundancy) and queued until the refresh has been done. The implementation of doSave() in the editor template had to change so that all resources in the editor's resource set are saved (if non-empty). The Ecore editor was regened to take advantage of this support.
*** Bug 97436 has been marked as a duplicate of this bug. ***
Fixed in 2.2.0 I200601260027
Move to verified as per bug 206558.