|
Re: Using your own ResourceSet with an EditingDomain [message #525273 is a reply to message #525199] |
Tue, 06 April 2010 00:31 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Bryan,
That's the right way. Extend your ResourceSetImpl to implement that
interface directly. Or extend AdapterImpl to write less methods.
Bryan Hunt wrote:
> I have a case where I need to use my own ResourceSet with the
> generated editor. The EditingDomain API supports this just fine, but
> you quickly find out that when you modify a property, the editor
> never goes dirty. It turns out that the item providers get access to
> the EditingDomain through the AdapterFactoryEditingDomainResourceSet
> which does not exist when you use your own ResourceSet. I've hacked
> around this problem as follows:
>
> editingDomain.getResourceSet().eAdapters().add(new
> EditingDomainAdapter());
>
> private class EditingDomainAdapter implements Adapter,
> IEditingDomainProvider
> {
> @Override
> public EditingDomain getEditingDomain()
> {
> return RuntimeEditor.this.getEditingDomain();
> }
>
> @Override
> public void notifyChanged(Notification notification)
> {
> }
>
> @Override
> public Notifier getTarget()
> {
> return null;
> }
>
> @Override
> public void setTarget(Notifier newTarget)
> {
> }
>
> @Override
> public boolean isAdapterForType(Object type)
> {
> if(type == IEditingDomainProvider.class)
> return true;
>
> return false;
> }
> }
>
>
> Is there any better way to deal with this problem?
>
> Bryan
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02926 seconds