Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Intercepting
Intercepting [message #452253] Wed, 16 March 2005 01:31 Go to next message
Eclipse UserFriend
Originally posted by: sabell.txesystems.com

I'm using EMF to generate a model and the associated simple UI.
When I use the right-click menu to create a new child of an item in a tree,
I need to intercept that object before it is added to its parent and make
some modifications.
Where can one get ahold of this child just before it is added?

Thanks,

Steve
Re: Intercepting [message #452263 is a reply to message #452253] Wed, 16 March 2005 13:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080608090704040402020305
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Steve,

You can modify the generated method:

protected void collectNewChildDescriptors(Collection
newChildDescriptors, Object object)

to initialize the new instance however you like.


Steven T Abell wrote:

>I'm using EMF to generate a model and the associated simple UI.
>When I use the right-click menu to create a new child of an item in a tree,
>I need to intercept that object before it is added to its parent and make
>some modifications.
>Where can one get ahold of this child just before it is added?
>
>Thanks,
>
>Steve
>
>
>
>


--------------080608090704040402020305
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">
Steve,<br>
<br>
You can modify the generated method:<br>
<blockquote>protected void collectNewChildDescriptors(Collection
newChildDescriptors, Object object)<br>
</blockquote>
to initialize the new instance however you like.<br>
<br>
<br>
Steven T Abell wrote:
<blockquote cite="midd1826g$7pl$1@www.eclipse.org" type="cite">
<pre wrap="">I'm using EMF to generate a model and the associated simple UI.
When I use the right-click menu to create a new child of an item in a tree,
I need to intercept that object before it is added to its parent and make
some modifications.
Where can one get ahold of this child just before it is added?

Thanks,

Steve


</pre>
</blockquote>
<br>
</body>
</html>

--------------080608090704040402020305--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Intercepting [message #452273 is a reply to message #452263] Wed, 16 March 2005 16:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sabell.txesystems.com

This is a multi-part message in MIME format.

------=_NextPart_000_004E_01C52A05.970FB800
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Unfortunately, that won't work here.
I need to get the single object that is actually selected.
Modifying all objects that are created in collectNewChildDescriptors()
will create an unrecoverable mess in this situation.
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:d19b26$6bv$1@www.eclipse.org...
Steve,

You can modify the generated method:

protected void collectNewChildDescriptors(Collection =
newChildDescriptors, Object object)

to initialize the new instance however you like.


Steven T Abell wrote:=20
I'm using EMF to generate a model and the associated simple UI.
When I use the right-click menu to create a new child of an item in a =
tree,
I need to intercept that object before it is added to its parent and =
make=20
some modifications.
Where can one get ahold of this child just before it is added?

Thanks,

Steve


=20

------=_NextPart_000_004E_01C52A05.970FB800
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.2900.2604" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Unfortunately, that won't work =
here.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I need to get the single object that is =
actually=20
selected.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Modifying all objects that are created =
in=20
collectNewChildDescriptors()</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>will create an unrecoverable mess in =
this=20
situation.</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:d19b26$6bv$1@www.eclipse.org">news:d19b26$6bv$1@www.eclipse.=
org</A>...</DIV>Steve,<BR><BR>You=20
can modify the generated method:<BR>
<BLOCKQUOTE>protected void collectNewChildDescriptors(Collection=20
newChildDescriptors, Object object)<BR></BLOCKQUOTE>to initialize =
the new=20
instance however you like.<BR><BR><BR>Steven T Abell wrote:=20
<BLOCKQUOTE cite=3Dmidd1826g$7pl$1@www.eclipse.org type=3D"cite"><PRE =
wrap=3D"">I'm using EMF to generate a model and the associated simple =
UI.
When I use the right-click menu to create a new child of an item in a =
tree,
I need to intercept that object before it is added to its parent and =
make=20
some modifications.
Where can one get ahold of this child just before it is added?

Thanks,

Steve


</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_004E_01C52A05.970FB800--
Re: Intercepting [message #452281 is a reply to message #452273] Wed, 16 March 2005 21:04 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080307060006080006090505
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Steve,

Your comment seems to imply that the initialization of the new child
will depend on where you add it. Is that true? If so, Marcos comment
about overriding the create child command behavior is the way to go...
(This question is asked in so many newsgroups, where EMF seems the only
place you should ask this.)


Steven T Abell wrote:

> Unfortunately, that won't work here.
> I need to get the single object that is actually selected.
> Modifying all objects that are created in collectNewChildDescriptors()
> will create an unrecoverable mess in this situation.
>
> "Ed Merks" <merks@ca.ibm.com <mailto:merks@ca.ibm.com>> wrote in
> message news:d19b26$6bv$1@www.eclipse.org...
> Steve,
>
> You can modify the generated method:
>
> protected void collectNewChildDescriptors(Collection
> newChildDescriptors, Object object)
>
> to initialize the new instance however you like.
>
>
> Steven T Abell wrote:
>
>>I'm using EMF to generate a model and the associated simple UI.
>>When I use the right-click menu to create a new child of an item in a tree,
>>I need to intercept that object before it is added to its parent and make
>>some modifications.
>>Where can one get ahold of this child just before it is added?
>>
>>Thanks,
>>
>>Steve
>>
>>
>>
>>
>


--------------080307060006080006090505
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">
Steve,<br>
<br>
Your comment seems to imply that the initialization of the new child
will depend on where you add it.&nbsp; Is that true?&nbsp; If so, Marcos comment
about overriding the create child command behavior is the way to go...&nbsp;
(This question is asked in so many newsgroups, where EMF seems the only
place you should ask this.)<br>
<br>
<br>
Steven T Abell wrote:
<blockquote cite="midd19o5v$jka$1@www.eclipse.org" type="cite">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<meta content="MSHTML 6.00.2900.2604" name="GENERATOR">
<style></style>
<div><font face="Arial" size="2">Unfortunately, that won't work here.</font></div>
<div><font face="Arial" size="2">I need to get the single object that
is actually selected.</font></div>
<div><font face="Arial" size="2">Modifying all objects that are
created in collectNewChildDescriptors()</font></div>
<div><font face="Arial" size="2">will create an unrecoverable mess in
this situation.</font></div>
<blockquote
style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
<div>"Ed Merks" &lt;<a href="mailto:merks@ca.ibm.com">merks@ca.ibm.com</a>&gt;
wrote in message <a href="news:d19b26$6bv$1@www.eclipse.org">news:d19b26$6bv$1@www.eclipse.org</a>...</div>
Steve,<br>
<br>
You can modify the generated method:<br>
<blockquote>protected void collectNewChildDescriptors(Collection
newChildDescriptors, Object object)<br>
</blockquote>
to initialize the new instance however you like.<br>
<br>
<br>
Steven T Abell wrote:
<blockquote cite="midd1826g$7pl$1@www.eclipse.org" type="cite">
<pre wrap="">I'm using EMF to generate a model and the associated simple UI.
When I use the right-click menu to create a new child of an item in a tree,
I need to intercept that object before it is added to its parent and make
some modifications.
Where can one get ahold of this child just before it is added?

Thanks,

Steve


</pre>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
</body>
</html>

--------------080307060006080006090505--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Toggle Toolbar button
Next Topic:CTabItem doesn't show in SashForm until clicked
Goto Forum:
  


Current Time: Wed Apr 24 15:06:50 GMT 2024

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

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

Back to the top