Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 118688 - Provide generated editor support for containment proxies
Summary: Provide generated editor support for containment proxies
Status: VERIFIED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Tools (show other bugs)
Version: 2.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dave Steinberg CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 97436 (view as bug list)
Depends on:
Blocks: 126808
  Show dependency tree
 
Reported: 2005-11-30 13:55 EST by Kenn Hussey CLA
Modified: 2008-01-28 16:46 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 Kenn Hussey CLA 2005-11-30 13:55:14 EST
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).
Comment 1 Dave Steinberg CLA 2005-12-02 00:17:27 EST
The fix is in CVS.

I've added an override for fixInstanceClass() to the PackageClass.javajet template, with the interface package name hard-coded.
Comment 2 Dave Steinberg CLA 2005-12-02 00:19:24 EST
Oops.  It seems I attached that comment to the wrong bug.  :(

This one should be done quite soon...
Comment 3 Dave Steinberg CLA 2006-01-23 16:18:16 EST
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.
Comment 4 Dave Steinberg CLA 2006-01-24 12:13:28 EST
*** Bug 97436 has been marked as a duplicate of this bug. ***
Comment 5 Nick Boldt CLA 2006-01-26 02:05:33 EST
Fixed in 2.2.0 I200601260027
Comment 6 Nick Boldt CLA 2008-01-28 16:46:04 EST
Move to verified as per bug 206558.