Home » Modeling » EMF » AbstractFactoryEditingDomain#createCommand() cannot get parent for RemoveCommand
| | |
Re: AbstractFactoryEditingDomain#createCommand() cannot get parent for RemoveCommand [message #413985 is a reply to message #413981] |
Fri, 19 October 2007 07:41   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------080608030001070307050708
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Kengkaj,
Because this is a hook you could use to set up delegation to some other
factory (by deriving a new class and specializing this method), but by
default here isn't any such delegation.
Kengkaj wrote:
> And why ComposedAdapterFactory#delegatedGetFactoryForTypes(Collectio n <?>
> types) code always return null.
>
> "Kengkaj" <kengkaj_s@nomagicasia.com> wrote in message
> news:ff9ube$r1v$1@build.eclipse.org...
>
>> getParent() return nulll, adapterFactory.adapt(object,
>> IEditingDomainItemProvider.class) return null
>> and ComposedAdapterFactory#adapt(Notifier target, Object type, boolean
>> isNew) return null.
>>
>> How to solve this problem?
>>
>>
>
>
>
--------------080608030001070307050708
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Kengkaj,<br>
<br>
Because this is a hook you could use to set up delegation to some other
factory (by deriving a new class and specializing this method), but by
default here isn't any such delegation.<br>
<br>
Kengkaj wrote:
<blockquote cite="mid:ff9v72$tbl$1@build.eclipse.org" type="cite">
<pre wrap="">And why ComposedAdapterFactory#delegatedGetFactoryForTypes(Collectio n<?>
types) code always return null.
"Kengkaj" <a class="moz-txt-link-rfc2396E" href="mailto:kengkaj_s@nomagicasia.com"><kengkaj_s@nomagicasia.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:ff9ube$r1v$1@build.eclipse.org">news:ff9ube$r1v$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">getParent() return nulll, adapterFactory.adapt(object,
IEditingDomainItemProvider.class) return null
and ComposedAdapterFactory#adapt(Notifier target, Object type, boolean
isNew) return null.
How to solve this problem?
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------080608030001070307050708--
|
|
| |
Re: AbstractFactoryEditingDomain#createCommand() cannot get parent for RemoveCommand [message #413989 is a reply to message #413987] |
Fri, 19 October 2007 09:26   |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Kengkaj,
It sounds like you need to be able to create a TransactionalEditingDomain
with your own adapter factory? The TransactionalEditingDomain.Factory
interface doesn't support that. Perhaps you can raise an enhancement
request to introduce a Factory2 interface that has a create(...) method
with an AdapterFactory parameter?
Thanks,
Christian
Kengkaj wrote:
> Thank you Ed Merks,
> But how I add factory to AdapterFactory of AdapterFactoryEditingDomain?
>
> I create editing domain by using
> TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain().
>
> "Ed Merks" <merks@ca.ibm.com> wrote in message
> news:ffa53l$hes$2@build.eclipse.org...
>> Kengkaj,
>>
>> You really need to provide a little more context. The getParent can
>> return null if there is no parent, the adapter factory could return null
>> if there is no factory that can handle "object" and the same for the
>> latter.
>>
>>
>> Kengkaj wrote:
>>> getParent() return nulll, adapterFactory.adapt(object,
>>> IEditingDomainItemProvider.class) return null
>>> and ComposedAdapterFactory#adapt(Notifier target, Object type, boolean
>>> isNew) return null.
>>>
>>> How to solve this problem?
>>>
>>>
|
|
|
Re: AbstractFactoryEditingDomain#createCommand() cannot get parent for RemoveCommand [message #413990 is a reply to message #413989] |
Fri, 19 October 2007 09:38   |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
--------------030505000800000104090908
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Christian,
In the meantime, he could cast the getAdapterFactory to
ComposedAdapterFactory and add factories to it that way or cast the
editing domain to AdapterFactoryEditingDomain to call setAdapterFactory
or even new up a TransactionalEditingDomainImpl and use the constructor...
Christian W. Damus wrote:
> Hi, Kengkaj,
>
> It sounds like you need to be able to create a TransactionalEditingDomain
> with your own adapter factory? The TransactionalEditingDomain.Factory
> interface doesn't support that. Perhaps you can raise an enhancement
> request to introduce a Factory2 interface that has a create(...) method
> with an AdapterFactory parameter?
>
> Thanks,
>
> Christian
>
>
> Kengkaj wrote:
>
>
>> Thank you Ed Merks,
>> But how I add factory to AdapterFactory of AdapterFactoryEditingDomain?
>>
>> I create editing domain by using
>> TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain().
>>
>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>> news:ffa53l$hes$2@build.eclipse.org...
>>
>>> Kengkaj,
>>>
>>> You really need to provide a little more context. The getParent can
>>> return null if there is no parent, the adapter factory could return null
>>> if there is no factory that can handle "object" and the same for the
>>> latter.
>>>
>>>
>>> Kengkaj wrote:
>>>
>>>> getParent() return nulll, adapterFactory.adapt(object,
>>>> IEditingDomainItemProvider.class) return null
>>>> and ComposedAdapterFactory#adapt(Notifier target, Object type, boolean
>>>> isNew) return null.
>>>>
>>>> How to solve this problem?
>>>>
>>>>
>>>>
>
>
--------------030505000800000104090908
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Christian,<br>
<br>
In the meantime, he could cast the getAdapterFactory to
ComposedAdapterFactory and add factories to it that way or cast the
editing domain to AdapterFactoryEditingDomain to call setAdapterFactory
or even new up a TransactionalEditingDomainImpl and use the
constructor...<br>
<br>
<br>
Christian W. Damus wrote:
<blockquote cite="mid:ffaba5$506$2@build.eclipse.org" type="cite">
<pre wrap="">Hi, Kengkaj,
It sounds like you need to be able to create a TransactionalEditingDomain
with your own adapter factory? The TransactionalEditingDomain.Factory
interface doesn't support that. Perhaps you can raise an enhancement
request to introduce a Factory2 interface that has a create(...) method
with an AdapterFactory parameter?
Thanks,
Christian
Kengkaj wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Thank you Ed Merks,
But how I add factory to AdapterFactory of AdapterFactoryEditingDomain?
I create editing domain by using
TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain().
"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:merks@ca.ibm.com"><merks@ca.ibm.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:ffa53l$hes$2@build.eclipse.org">news:ffa53l$hes$2@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Kengkaj,
You really need to provide a little more context. The getParent can
return null if there is no parent, the adapter factory could return null
if there is no factory that can handle "object" and the same for the
latter.
Kengkaj wrote:
</pre>
<blockquote type="cite">
<pre wrap="">getParent() return nulll, adapterFactory.adapt(object,
IEditingDomainItemProvider.class) return null
and ComposedAdapterFactory#adapt(Notifier target, Object type, boolean
isNew) return null.
How to solve this problem?
</pre>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------030505000800000104090908--
|
|
| |
Re: AbstractFactoryEditingDomain#createCommand() cannot get parent for RemoveCommand [message #414068 is a reply to message #413989] |
Wed, 24 October 2007 02:50   |
Eclipse User |
|
|
|
Originally posted by: kengkaj_s.nomagicasia.com
Thank you Christian. I will raise a request.
Does that means if I want a editing domain deduces parent for RemoveCommand,
or deduces all the children for CopyCommand I must set a AdapterFactory to
editing domain manually?
Before that I thought that after I create a editing domain with
TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain(), a
AdapterFactory for adapting IEditingDomainItemProvider will be created
automatically.
BTW, I am very appreciate for you help, thank you very much Christian.
"Christian W. Damus" <cdamus@ca.ibm.com> wrote in message
news:ffaba5$506$2@build.eclipse.org...
> Hi, Kengkaj,
>
> It sounds like you need to be able to create a TransactionalEditingDomain
> with your own adapter factory? The TransactionalEditingDomain.Factory
> interface doesn't support that. Perhaps you can raise an enhancement
> request to introduce a Factory2 interface that has a create(...) method
> with an AdapterFactory parameter?
>
> Thanks,
>
> Christian
>
>
> Kengkaj wrote:
>
>> Thank you Ed Merks,
>> But how I add factory to AdapterFactory of AdapterFactoryEditingDomain?
>>
>> I create editing domain by using
>> TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain().
>>
>> "Ed Merks" <merks@ca.ibm.com> wrote in message
>> news:ffa53l$hes$2@build.eclipse.org...
>>> Kengkaj,
>>>
>>> You really need to provide a little more context. The getParent can
>>> return null if there is no parent, the adapter factory could return null
>>> if there is no factory that can handle "object" and the same for the
>>> latter.
>>>
>>>
>>> Kengkaj wrote:
>>>> getParent() return nulll, adapterFactory.adapt(object,
>>>> IEditingDomainItemProvider.class) return null
>>>> and ComposedAdapterFactory#adapt(Notifier target, Object type, boolean
>>>> isNew) return null.
>>>>
>>>> How to solve this problem?
>>>>
>>>>
>
|
|
|
Re: AbstractFactoryEditingDomain#createCommand() cannot get parent for RemoveCommand [message #414079 is a reply to message #414068] |
Wed, 24 October 2007 08:17  |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Kengkaj,
Ordinarily, you wouldn't need to set your own adapter factory, anyway,
because the editing domain is currently constructed with the
ComposedAdapterFactory that uses EMF's registry to find all available
adapter factories for metamodels that have registered them.
The most common reason, I suppose, why you might need to set your own
factory would be if you are using a metamodel that hasn't been regenerated
since EMF introduced the adapter factory registry.
Cheers,
Christian
Kengkaj wrote:
> Thank you Christian. I will raise a request.
>
> Does that means if I want a editing domain deduces parent for
> RemoveCommand, or deduces all the children for CopyCommand I must set a
> AdapterFactory to editing domain manually?
>
> Before that I thought that after I create a editing domain with
> TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain(), a
> AdapterFactory for adapting IEditingDomainItemProvider will be created
> automatically.
>
> BTW, I am very appreciate for you help, thank you very much Christian.
>
-----8<-----
|
|
|
Goto Forum:
Current Time: Tue Sep 09 18:46:40 EDT 2025
Powered by FUDForum. Page generated in 0.05269 seconds
|