Skip to main content



      Home
Home » Modeling » EMF » AbstractFactoryEditingDomain#createCommand() cannot get parent for RemoveCommand
AbstractFactoryEditingDomain#createCommand() cannot get parent for RemoveCommand [message #413980] Fri, 19 October 2007 05:46 Go to next message
Eclipse UserFriend
Originally posted by: kengkaj_s.nomagicasia.com

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 #413981 is a reply to message #413980] Fri, 19 October 2007 06:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kengkaj_s.nomagicasia.com

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?
>
Re: AbstractFactoryEditingDomain#createCommand() cannot get parent for RemoveCommand [message #413984 is a reply to message #413980] Fri, 19 October 2007 07:40 Go to previous messageGo to next message
Eclipse UserFriend
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 #413985 is a reply to message #413981] Fri, 19 October 2007 07:41 Go to previous messageGo to next message
Eclipse UserFriend
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&lt;?&gt;
types) code always return null.

"Kengkaj" <a class="moz-txt-link-rfc2396E" href="mailto:kengkaj_s@nomagicasia.com">&lt;kengkaj_s@nomagicasia.com&gt;</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 #413987 is a reply to message #413984] Fri, 19 October 2007 08:03 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kengkaj_s.nomagicasia.com

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 #413989 is a reply to message #413987] Fri, 19 October 2007 09:26 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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">&lt;merks@ca.ibm.com&gt;</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 #414067 is a reply to message #413990] Wed, 24 October 2007 02:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kengkaj_s.nomagicasia.com

This is a multi-part message in MIME format.

------=_NextPart_000_009A_01C81641.3F2BF5B0
Content-Type: text/plain;
charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

Very thanks, Ed Merks.

I cast editing domain to AdapterFactoryEditingDomain and =
setAdapterFactory, it's working now.

I am very appreciate your help.
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:ffabvs$c23$1@build.eclipse.org...
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...



------=_NextPart_000_009A_01C81641.3F2BF5B0
Content-Type: text/html;
charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16544" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Very thanks, Ed Merks.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I cast editing domain =
to&nbsp;&nbsp;<FONT=20
face=3D"Times New Roman" size=3D3>AdapterFactoryEditingDomain and =
setAdapterFactory,=20
it's working now.</FONT></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>I am very appreciate your =
help.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" &lt;<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:ffabvs$c23$1@build.eclipse.org">news:ffabvs$c23$1@build.ecli=
pse.org</A>...</DIV>Christian,<BR><BR>In=20
the meantime, he could cast the getAdapterFactory to =
ComposedAdapterFactory=20
and add factories to it that way or cast the editing domain to=20
AdapterFactoryEditingDomain to call setAdapterFactory or even new up a =

TransactionalEditingDomainImpl and use the=20
constructor...<BR><BR><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_009A_01C81641.3F2BF5B0--
Re: AbstractFactoryEditingDomain#createCommand() cannot get parent for RemoveCommand [message #414068 is a reply to message #413989] Wed, 24 October 2007 02:50 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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<-----
Previous Topic:Semantic isSuperTypeOf
Next Topic:generics
Goto Forum:
  


Current Time: Tue Sep 09 18:46:40 EDT 2025

Powered by FUDForum. Page generated in 0.05269 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top