|
|
|
Re: Default Update Feature and Unresolvable Proxies [message #897669 is a reply to message #897633] |
Wed, 25 July 2012 03:43 |
Ed Merks Messages: 33113 Registered: July 2009 |
Senior Member |
|
|
Rob,
You might want to check for object.eIsProxy() instead of checking a
non-null eContainer(). In general an EObject might have a null
eContainer() but a non-null eResource(), i.e., if it's a root object
contained by a resource resource it won't have a container but it's
still a useable resolved object.
On 24/07/2012 10:17 PM, Rob Cernich wrote:
> I'm working around the problem by adding the following to a customized
> DefaultPersistencyBehavior.loadDiagram():
>
> final Diagram finalDiagram = diagram;
> // clean out unresolvable links
> getEditingDomain().getCommandStack().execute(new
> RecordingCommand(getEditingDomain()) {
> @Override
> protected void doExecute() {
> for (PictogramLink link : finalDiagram.getPictogramLinks()) {
> for (EObject object : new
> ArrayList<EObject>(link.getBusinessObjects())) {
> if (object.eContainer() == null) {
> link.getBusinessObjects().remove(object);
> }
> }
> }
> }
> });
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02779 seconds