Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » What is the best place to set a reference creation Request's factory?
What is the best place to set a reference creation Request's factory? [message #118614] Fri, 20 February 2004 17:17 Go to next message
Eclipse UserFriend
Originally posted by: vgusev.graphlogic.com

Hello,

When a node is dropped on a connection, the connection should receive a new
child. This child is not a node being dropped, but a new reference to that
node - a different type of class. To create this new reference, I would like
to use the same pattern as in creating new objects when dragging from
pallette, using SimpleFactory. So my question is what is the best place to
set the request's factory. Is it in the connection policy's
getTargetEditPart(request), method, or should I go somewhere deeper like
TargetingTool.createTargetRequest()?

Thanks a lot.

Vladimir
Re: What is the best place to set a reference creation Request's factory? [message #118745 is a reply to message #118614] Fri, 20 February 2004 22:12 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vgusev.graphlogic.com

Well, Vladimir,

TargetingTool.createTargetRequest() method is called when the drag starts,
and the Target is not known yet. If you set the request's SimpleFactory at
that point, you will limit all drags to creating a child's reference, this
is not what you want in all cases, especially when the Target is not a
Connection, do you?

In Policy.getTargetEditPart(request) it maybe too late, because your request
will be ChangeBoundsRequest, which does not have the factory field and
thereby
is not intended for instance creation.

Sounds like you'll have to create your reference instance in without
ressorting to
request.getNewObject(), since your request is not CreateRequest anyway?

See if this canbe done using ChangeBoundsRequest in the Policy.getCommand(),
without actually using it although it maybe not the best solution, at least
you'll limit
this behaviour to your edit part.

Vladimir

"Vladimir" <vgusev@graphlogic.com> wrote in message
news:c15f99$cpc$1@eclipse.org...
> Hello,
>
> When a node is dropped on a connection, the connection should receive a
new
> child. This child is not a node being dropped, but a new reference to that
> node - a different type of class. To create this new reference, I would
like
> to use the same pattern as in creating new objects when dragging from
> pallette, using SimpleFactory. So my question is what is the best place to
> set the request's factory. Is it in the connection policy's
> getTargetEditPart(request), method, or should I go somewhere deeper like
> TargetingTool.createTargetRequest()?
>
> Thanks a lot.
>
> Vladimir
>
>
Re: What is the best place to set a reference creation Request's factory? [message #118758 is a reply to message #118745] Fri, 20 February 2004 22:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vgusev.graphlogic.com

Hey Vladimir,

Go check DND paper by Bordeau - this may give you the freedom to do exactly
what you need, although within GraphicalEditor. All you need to do is to
extend AbstractTransferDropTargetListener and other small parts.

Vladimir
"Vladimir" <vgusev@graphlogic.com> wrote in message
news:c160il$25l$1@eclipse.org...
> Well, Vladimir,
>
> TargetingTool.createTargetRequest() method is called when the drag starts,
> and the Target is not known yet. If you set the request's SimpleFactory at
> that point, you will limit all drags to creating a child's reference, this
> is not what you want in all cases, especially when the Target is not a
> Connection, do you?
>
> In Policy.getTargetEditPart(request) it maybe too late, because your
request
> will be ChangeBoundsRequest, which does not have the factory field and
> thereby
> is not intended for instance creation.
>
> Sounds like you'll have to create your reference instance in without
> ressorting to
> request.getNewObject(), since your request is not CreateRequest anyway?
>
> See if this canbe done using ChangeBoundsRequest in the
Policy.getCommand(),
> without actually using it although it maybe not the best solution, at
least
> you'll limit
> this behaviour to your edit part.
>
> Vladimir
>
> "Vladimir" <vgusev@graphlogic.com> wrote in message
> news:c15f99$cpc$1@eclipse.org...
> > Hello,
> >
> > When a node is dropped on a connection, the connection should receive a
> new
> > child. This child is not a node being dropped, but a new reference to
that
> > node - a different type of class. To create this new reference, I would
> like
> > to use the same pattern as in creating new objects when dragging from
> > pallette, using SimpleFactory. So my question is what is the best place
to
> > set the request's factory. Is it in the connection policy's
> > getTargetEditPart(request), method, or should I go somewhere deeper
like
> > TargetingTool.createTargetRequest()?
> >
> > Thanks a lot.
> >
> > Vladimir
> >
> >
>
>
>
>
>
>
Re: What is the best place to set a reference creation Request's factory? [message #118914 is a reply to message #118758] Mon, 23 February 2004 15:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Wow, our first schizophrenic posting! ;-)

Are you talking about native DND of an existing object in your model? Or
just straight creation tool stuff from the palette? Please use concrete
terms in your description. For example, are you dragging a class from a
"model explorer" view into another class, and trying to create an attribute
of that type in the class.

Thanks.

"Vladimir" <vgusev@graphlogic.com> wrote in message
news:c161u7$3ou$1@eclipse.org...
> Hey Vladimir,
>
> Go check DND paper by Bordeau - this may give you the freedom to do
exactly
> what you need, although within GraphicalEditor. All you need to do is to
> extend AbstractTransferDropTargetListener and other small parts.
>
> Vladimir
> "Vladimir" <vgusev@graphlogic.com> wrote in message
> news:c160il$25l$1@eclipse.org...
> > Well, Vladimir,
> >
> > TargetingTool.createTargetRequest() method is called when the drag
starts,
> > and the Target is not known yet. If you set the request's SimpleFactory
at
> > that point, you will limit all drags to creating a child's reference,
this
> > is not what you want in all cases, especially when the Target is not a
> > Connection, do you?
> >
> > In Policy.getTargetEditPart(request) it maybe too late, because your
> request
> > will be ChangeBoundsRequest, which does not have the factory field and
> > thereby
> > is not intended for instance creation.
> >
> > Sounds like you'll have to create your reference instance in without
> > ressorting to
> > request.getNewObject(), since your request is not CreateRequest anyway?
> >
> > See if this canbe done using ChangeBoundsRequest in the
> Policy.getCommand(),
> > without actually using it although it maybe not the best solution, at
> least
> > you'll limit
> > this behaviour to your edit part.
> >
> > Vladimir
> >
> > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > news:c15f99$cpc$1@eclipse.org...
> > > Hello,
> > >
> > > When a node is dropped on a connection, the connection should receive
a
> > new
> > > child. This child is not a node being dropped, but a new reference to
> that
> > > node - a different type of class. To create this new reference, I
would
> > like
> > > to use the same pattern as in creating new objects when dragging from
> > > pallette, using SimpleFactory. So my question is what is the best
place
> to
> > > set the request's factory. Is it in the connection policy's
> > > getTargetEditPart(request), method, or should I go somewhere deeper
> like
> > > TargetingTool.createTargetRequest()?
> > >
> > > Thanks a lot.
> > >
> > > Vladimir
Re: What is the best place to set a reference creation Request's factory? [message #118939 is a reply to message #118914] Mon, 23 February 2004 16:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vgusev.graphlogic.com

Finally, somebody noticed ;-)
I have a graphical node (editpart, model etc.) and a connection between two
other graphical nodes. I am dragging the first node on a connection. When
this node is dropped, I need to set an attribute of the connection's model
to a special class, representing a reference to the first node's model.
After drop is finished, the first node should remain where it was in the
beginning.

Vladimir
"Randy Hudson" <none@us.ibm.com> wrote in message
news:c1d6fs$7p5$1@eclipse.org...
> Wow, our first schizophrenic posting! ;-)
>
> Are you talking about native DND of an existing object in your model? Or
> just straight creation tool stuff from the palette? Please use concrete
> terms in your description. For example, are you dragging a class from a
> "model explorer" view into another class, and trying to create an
attribute
> of that type in the class.
>
> Thanks.
>
> "Vladimir" <vgusev@graphlogic.com> wrote in message
> news:c161u7$3ou$1@eclipse.org...
> > Hey Vladimir,
> >
> > Go check DND paper by Bordeau - this may give you the freedom to do
> exactly
> > what you need, although within GraphicalEditor. All you need to do is to
> > extend AbstractTransferDropTargetListener and other small parts.
> >
> > Vladimir
> > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > news:c160il$25l$1@eclipse.org...
> > > Well, Vladimir,
> > >
> > > TargetingTool.createTargetRequest() method is called when the drag
> starts,
> > > and the Target is not known yet. If you set the request's
SimpleFactory
> at
> > > that point, you will limit all drags to creating a child's reference,
> this
> > > is not what you want in all cases, especially when the Target is not a
> > > Connection, do you?
> > >
> > > In Policy.getTargetEditPart(request) it maybe too late, because your
> > request
> > > will be ChangeBoundsRequest, which does not have the factory field and
> > > thereby
> > > is not intended for instance creation.
> > >
> > > Sounds like you'll have to create your reference instance in without
> > > ressorting to
> > > request.getNewObject(), since your request is not CreateRequest
anyway?
> > >
> > > See if this canbe done using ChangeBoundsRequest in the
> > Policy.getCommand(),
> > > without actually using it although it maybe not the best solution, at
> > least
> > > you'll limit
> > > this behaviour to your edit part.
> > >
> > > Vladimir
> > >
> > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > news:c15f99$cpc$1@eclipse.org...
> > > > Hello,
> > > >
> > > > When a node is dropped on a connection, the connection should
receive
> a
> > > new
> > > > child. This child is not a node being dropped, but a new reference
to
> > that
> > > > node - a different type of class. To create this new reference, I
> would
> > > like
> > > > to use the same pattern as in creating new objects when dragging
from
> > > > pallette, using SimpleFactory. So my question is what is the best
> place
> > to
> > > > set the request's factory. Is it in the connection policy's
> > > > getTargetEditPart(request), method, or should I go somewhere deeper
> > like
> > > > TargetingTool.createTargetRequest()?
> > > >
> > > > Thanks a lot.
> > > >
> > > > Vladimir
>
>
Re: What is the best place to set a reference creation Request's factory? [message #119004 is a reply to message #118939] Mon, 23 February 2004 16:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Consider me a user, and describe what is happening to the user. My guess is
you should just handle everything in your command, and not think about
reusing CreationFactory simply because you are instantiating an object in
your model.

"Vladimir" <vgusev@graphlogic.com> wrote in message
news:c1d83l$a1e$1@eclipse.org...
> Finally, somebody noticed ;-)
> I have a graphical node (editpart, model etc.) and a connection between
two
> other graphical nodes. I am dragging the first node on a connection. When
> this node is dropped, I need to set an attribute of the connection's model
> to a special class, representing a reference to the first node's model.
> After drop is finished, the first node should remain where it was in the
> beginning.
>
> Vladimir
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:c1d6fs$7p5$1@eclipse.org...
> > Wow, our first schizophrenic posting! ;-)
> >
> > Are you talking about native DND of an existing object in your model? Or
> > just straight creation tool stuff from the palette? Please use concrete
> > terms in your description. For example, are you dragging a class from a
> > "model explorer" view into another class, and trying to create an
> attribute
> > of that type in the class.
> >
> > Thanks.
> >
> > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > news:c161u7$3ou$1@eclipse.org...
> > > Hey Vladimir,
> > >
> > > Go check DND paper by Bordeau - this may give you the freedom to do
> > exactly
> > > what you need, although within GraphicalEditor. All you need to do is
to
> > > extend AbstractTransferDropTargetListener and other small parts.
> > >
> > > Vladimir
> > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > news:c160il$25l$1@eclipse.org...
> > > > Well, Vladimir,
> > > >
> > > > TargetingTool.createTargetRequest() method is called when the drag
> > starts,
> > > > and the Target is not known yet. If you set the request's
> SimpleFactory
> > at
> > > > that point, you will limit all drags to creating a child's
reference,
> > this
> > > > is not what you want in all cases, especially when the Target is not
a
> > > > Connection, do you?
> > > >
> > > > In Policy.getTargetEditPart(request) it maybe too late, because your
> > > request
> > > > will be ChangeBoundsRequest, which does not have the factory field
and
> > > > thereby
> > > > is not intended for instance creation.
> > > >
> > > > Sounds like you'll have to create your reference instance in without
> > > > ressorting to
> > > > request.getNewObject(), since your request is not CreateRequest
> anyway?
> > > >
> > > > See if this canbe done using ChangeBoundsRequest in the
> > > Policy.getCommand(),
> > > > without actually using it although it maybe not the best solution,
at
> > > least
> > > > you'll limit
> > > > this behaviour to your edit part.
> > > >
> > > > Vladimir
> > > >
> > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > news:c15f99$cpc$1@eclipse.org...
> > > > > Hello,
> > > > >
> > > > > When a node is dropped on a connection, the connection should
> receive
> > a
> > > > new
> > > > > child. This child is not a node being dropped, but a new reference
> to
> > > that
> > > > > node - a different type of class. To create this new reference, I
> > would
> > > > like
> > > > > to use the same pattern as in creating new objects when dragging
> from
> > > > > pallette, using SimpleFactory. So my question is what is the best
> > place
> > > to
> > > > > set the request's factory. Is it in the connection policy's
> > > > > getTargetEditPart(request), method, or should I go somewhere
deeper
> > > like
> > > > > TargetingTool.createTargetRequest()?
> > > > >
> > > > > Thanks a lot.
> > > > >
> > > > > Vladimir
> >
> >
>
>
Re: What is the best place to set a reference creation Request's factory? [message #119069 is a reply to message #119004] Mon, 23 February 2004 16:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vgusev.graphlogic.com

User has three nodes defined before in the editor pallete. Two nodes are
connected with a Connection.
User needs to create a reference to the third node in the Connection. To do
that, the user drags and drops this third node on the Connection. However,
this is not a usual move or copy drop - because nothing happens to the node
being dragged.
"Randy Hudson" <none@us.ibm.com> wrote in message
news:c1da11$cv2$1@eclipse.org...
> Consider me a user, and describe what is happening to the user. My guess
is
> you should just handle everything in your command, and not think about
> reusing CreationFactory simply because you are instantiating an object in
> your model.
>
> "Vladimir" <vgusev@graphlogic.com> wrote in message
> news:c1d83l$a1e$1@eclipse.org...
> > Finally, somebody noticed ;-)
> > I have a graphical node (editpart, model etc.) and a connection between
> two
> > other graphical nodes. I am dragging the first node on a connection.
When
> > this node is dropped, I need to set an attribute of the connection's
model
> > to a special class, representing a reference to the first node's model.
> > After drop is finished, the first node should remain where it was in the
> > beginning.
> >
> > Vladimir
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:c1d6fs$7p5$1@eclipse.org...
> > > Wow, our first schizophrenic posting! ;-)
> > >
> > > Are you talking about native DND of an existing object in your model?
Or
> > > just straight creation tool stuff from the palette? Please use
concrete
> > > terms in your description. For example, are you dragging a class from
a
> > > "model explorer" view into another class, and trying to create an
> > attribute
> > > of that type in the class.
> > >
> > > Thanks.
> > >
> > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > news:c161u7$3ou$1@eclipse.org...
> > > > Hey Vladimir,
> > > >
> > > > Go check DND paper by Bordeau - this may give you the freedom to do
> > > exactly
> > > > what you need, although within GraphicalEditor. All you need to do
is
> to
> > > > extend AbstractTransferDropTargetListener and other small parts.
> > > >
> > > > Vladimir
> > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > news:c160il$25l$1@eclipse.org...
> > > > > Well, Vladimir,
> > > > >
> > > > > TargetingTool.createTargetRequest() method is called when the drag
> > > starts,
> > > > > and the Target is not known yet. If you set the request's
> > SimpleFactory
> > > at
> > > > > that point, you will limit all drags to creating a child's
> reference,
> > > this
> > > > > is not what you want in all cases, especially when the Target is
not
> a
> > > > > Connection, do you?
> > > > >
> > > > > In Policy.getTargetEditPart(request) it maybe too late, because
your
> > > > request
> > > > > will be ChangeBoundsRequest, which does not have the factory field
> and
> > > > > thereby
> > > > > is not intended for instance creation.
> > > > >
> > > > > Sounds like you'll have to create your reference instance in
without
> > > > > ressorting to
> > > > > request.getNewObject(), since your request is not CreateRequest
> > anyway?
> > > > >
> > > > > See if this canbe done using ChangeBoundsRequest in the
> > > > Policy.getCommand(),
> > > > > without actually using it although it maybe not the best solution,
> at
> > > > least
> > > > > you'll limit
> > > > > this behaviour to your edit part.
> > > > >
> > > > > Vladimir
> > > > >
> > > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > > news:c15f99$cpc$1@eclipse.org...
> > > > > > Hello,
> > > > > >
> > > > > > When a node is dropped on a connection, the connection should
> > receive
> > > a
> > > > > new
> > > > > > child. This child is not a node being dropped, but a new
reference
> > to
> > > > that
> > > > > > node - a different type of class. To create this new reference,
I
> > > would
> > > > > like
> > > > > > to use the same pattern as in creating new objects when dragging
> > from
> > > > > > pallette, using SimpleFactory. So my question is what is the
best
> > > place
> > > > to
> > > > > > set the request's factory. Is it in the connection policy's
> > > > > > getTargetEditPart(request), method, or should I go somewhere
> deeper
> > > > like
> > > > > > TargetingTool.createTargetRequest()?
> > > > > >
> > > > > > Thanks a lot.
> > > > > >
> > > > > > Vladimir
> > >
> > >
> >
> >
>
>
Re: What is the best place to set a reference creation Request's factory? [message #119134 is a reply to message #119069] Mon, 23 February 2004 19:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

In GEF as soon as the target is different than the parent, in this it is the
connection, then the default drag tracker will interpret this as an
ORPHAN+ADD. You can probably live with this, all you have to do is check
who is the new parent, and act accordingly. You can also extend the tool
and add your own LINK_TO_CONNECTION request type, and change the tool to use
this when conncetions are targeted.

"Vladimir" <vgusev@graphlogic.com> wrote in message
news:c1danl$dv9$1@eclipse.org...
> User has three nodes defined before in the editor pallete. Two nodes are
> connected with a Connection.
> User needs to create a reference to the third node in the Connection. To
do
> that, the user drags and drops this third node on the Connection. However,
> this is not a usual move or copy drop - because nothing happens to the
node
> being dragged.
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:c1da11$cv2$1@eclipse.org...
> > Consider me a user, and describe what is happening to the user. My
guess
> is
> > you should just handle everything in your command, and not think about
> > reusing CreationFactory simply because you are instantiating an object
in
> > your model.
> >
> > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > news:c1d83l$a1e$1@eclipse.org...
> > > Finally, somebody noticed ;-)
> > > I have a graphical node (editpart, model etc.) and a connection
between
> > two
> > > other graphical nodes. I am dragging the first node on a connection.
> When
> > > this node is dropped, I need to set an attribute of the connection's
> model
> > > to a special class, representing a reference to the first node's
model.
> > > After drop is finished, the first node should remain where it was in
the
> > > beginning.
> > >
> > > Vladimir
> > > "Randy Hudson" <none@us.ibm
..zl6wroteinmessagenewsc1d6fs$7p5$1@eclipse.org...Wow,ourfirstschizophrenicpo
sting!;-)
> > > >
> > > > Are you talking about native DND of an existing object in your
model?
> Or
> > > > just straight creation tool stuff from the palette? Please use
> concrete
> > > > terms in your description. For example, are you dragging a class
from
> a
> > > > "model explorer" view into another class, and trying to create an
> > > attribute
> > > > of that type in the class.
> > > >
> > > > Thanks.
> > > >
> > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > news:c161u7$3ou$1@eclipse.org...
> > > > > Hey Vladimir,
> > > > >
> > > > > Go check DND paper by Bordeau - this may give you the freedom to
do
> > > > exactly
> > > > > what you need, although within GraphicalEditor. All you need to do
> is
> > to
> > > > > extend AbstractTransferDropTargetListener and other small parts.
> > > > >
> > > > > Vladimir
> > > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > > news:c160il$25l$1@eclipse.org...
> > > > > > Well, Vladimir,
> > > > > >
> > > > > > TargetingTool.createTargetRequest() method is called when the
drag
> > > > starts,
> > > > > > and the Target is not known yet. If you set the request's
> > > SimpleFactory
> > > > at
> > > > > > that point, you will limit all drags to creating a child's
> > reference,
> > > > this
> > > > > > is not what you want in all cases, especially when the Target is
> not
> > a
> > > > > > Connection, do you?
> > > > > >
> > > > > > In Policy.getTargetEditPart(request) it maybe too late, because
> your
> > > > > request
> > > > > > will be ChangeBoundsRequest, which does not have the factory
field
> > and
> > > > > > thereby
> > > > > > is not intended for instance creation.
> > > > > >
> > > > > > Sounds like you'll have to create your reference instance in
> without
> > > > > > ressorting to
> > > > > > request.getNewObject(), since your request is not CreateRequest
> > > anyway?
> > > > > >
> > > > > > See if this canbe done using ChangeBoundsRequest in the
> > > > > Policy.getCommand(),
> > > > > > without actually using it although it maybe not the best
solution,
> > at
> > > > > least
> > > > > > you'll limit
> > > > > > this behaviour to your edit part.
> > > > > >
> > > > > > Vladimir
> > > > > >
> > > > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > > > news:c15f99$cpc$1@eclipse.org...
> > > > > > > Hello,
> > > > > > >
> > > > > > > When a node is dropped on a connection, the connection should
> > > receive
> > > > a
> > > > > > new
> > > > > > > child. This child is not a node being dropped, but a new
> reference
> > > to
> > > > > that
> > > > > > > node - a different type of class. To create this new
reference,
> I
> > > > would
> > > > > > like
> > > > > > > to use the same pattern as in creating new objects when
dragging
> > > from
> > > > > > > pallette, using SimpleFactory. So my question is what is the
> best
> > > > place
> > > > > to
> > > > > > > set the request's factory. Is it in the connection policy's
> > > > > > > getTargetEditPart(request), method, or should I go somewhere
> > deeper
> > > > > like
> > > > > > > TargetingTool.createTargetRequest()?
> > > > > > >
> > > > > > > Thanks a lot.
> > > > > > >
> > > > > > > Vladimir
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: What is the best place to set a reference creation Request's factory? [message #119148 is a reply to message #119134] Mon, 23 February 2004 22:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vgusev.graphlogic.com

In the meantime, I have implemented this using native DND. Could you please
let me know what would be the negative implications of using native DND
within one viewer?

Thanks.

Vladimir
"Randy Hudson" <none@us.ibm.com> wrote in message
news:c1dko7$s1s$1@eclipse.org...
> In GEF as soon as the target is different than the parent, in this it is
the
> connection, then the default drag tracker will interpret this as an
> ORPHAN+ADD. You can probably live with this, all you have to do is check
> who is the new parent, and act accordingly. You can also extend the tool
> and add your own LINK_TO_CONNECTION request type, and change the tool to
use
> this when conncetions are targeted.
>
> "Vladimir" <vgusev@graphlogic.com> wrote in message
> news:c1danl$dv9$1@eclipse.org...
> > User has three nodes defined before in the editor pallete. Two nodes are
> > connected with a Connection.
> > User needs to create a reference to the third node in the Connection. To
> do
> > that, the user drags and drops this third node on the Connection.
However,
> > this is not a usual move or copy drop - because nothing happens to the
> node
> > being dragged.
> > "Randy Hudson" <none@us.ibm.com> wrote in message
> > news:c1da11$cv2$1@eclipse.org...
> > > Consider me a user, and describe what is happening to the user. My
> guess
> > is
> > > you should just handle everything in your command, and not think about
> > > reusing CreationFactory simply because you are instantiating an object
> in
> > > your model.
> > >
> > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > news:c1d83l$a1e$1@eclipse.org...
> > > > Finally, somebody noticed ;-)
> > > > I have a graphical node (editpart, model etc.) and a connection
> between
> > > two
> > > > other graphical nodes. I am dragging the first node on a connection.
> > When
> > > > this node is dropped, I need to set an attribute of the connection's
> > model
> > > > to a special class, representing a reference to the first node's
> model.
> > > > After drop is finished, the first node should remain where it was in
> the
> > > > beginning.
> > > >
> > > > Vladimir
> > > > "Randy Hudson" <none@us.ibm
>
..zl6wroteinmessagenewsc1d6fs$7p5$1@eclipse.org...Wow,ourfirstschizophrenicpo
> sting!;-)
> > > > >
> > > > > Are you talking about native DND of an existing object in your
> model?
> > Or
> > > > > just straight creation tool stuff from the palette? Please use
> > concrete
> > > > > terms in your description. For example, are you dragging a class
> from
> > a
> > > > > "model explorer" view into another class, and trying to create an
> > > > attribute
> > > > > of that type in the class.
> > > > >
> > > > > Thanks.
> > > > >
> > > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > > news:c161u7$3ou$1@eclipse.org...
> > > > > > Hey Vladimir,
> > > > > >
> > > > > > Go check DND paper by Bordeau - this may give you the freedom to
> do
> > > > > exactly
> > > > > > what you need, although within GraphicalEditor. All you need to
do
> > is
> > > to
> > > > > > extend AbstractTransferDropTargetListener and other small parts.
> > > > > >
> > > > > > Vladimir
> > > > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > > > news:c160il$25l$1@eclipse.org...
> > > > > > > Well, Vladimir,
> > > > > > >
> > > > > > > TargetingTool.createTargetRequest() method is called when the
> drag
> > > > > starts,
> > > > > > > and the Target is not known yet. If you set the request's
> > > > SimpleFactory
> > > > > at
> > > > > > > that point, you will limit all drags to creating a child's
> > > reference,
> > > > > this
> > > > > > > is not what you want in all cases, especially when the Target
is
> > not
> > > a
> > > > > > > Connection, do you?
> > > > > > >
> > > > > > > In Policy.getTargetEditPart(request) it maybe too late,
because
> > your
> > > > > > request
> > > > > > > will be ChangeBoundsRequest, which does not have the factory
> field
> > > and
> > > > > > > thereby
> > > > > > > is not intended for instance creation.
> > > > > > >
> > > > > > > Sounds like you'll have to create your reference instance in
> > without
> > > > > > > ressorting to
> > > > > > > request.getNewObject(), since your request is not
CreateRequest
> > > > anyway?
> > > > > > >
> > > > > > > See if this canbe done using ChangeBoundsRequest in the
> > > > > > Policy.getCommand(),
> > > > > > > without actually using it although it maybe not the best
> solution,
> > > at
> > > > > > least
> > > > > > > you'll limit
> > > > > > > this behaviour to your edit part.
> > > > > > >
> > > > > > > Vladimir
> > > > > > >
> > > > > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > > > > news:c15f99$cpc$1@eclipse.org...
> > > > > > > > Hello,
> > > > > > > >
> > > > > > > > When a node is dropped on a connection, the connection
should
> > > > receive
> > > > > a
> > > > > > > new
> > > > > > > > child. This child is not a node being dropped, but a new
> > reference
> > > > to
> > > > > > that
> > > > > > > > node - a different type of class. To create this new
> reference,
> > I
> > > > > would
> > > > > > > like
> > > > > > > > to use the same pattern as in creating new objects when
> dragging
> > > > from
> > > > > > > > pallette, using SimpleFactory. So my question is what is the
> > best
> > > > > place
> > > > > > to
> > > > > > > > set the request's factory. Is it in the connection policy's
> > > > > > > > getTargetEditPart(request), method, or should I go
somewhere
> > > deeper
> > > > > > like
> > > > > > > > TargetingTool.createTargetRequest()?
> > > > > > > >
> > > > > > > > Thanks a lot.
> > > > > > > >
> > > > > > > > Vladimir
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Re: What is the best place to set a reference creation Request's factory? [message #119346 is a reply to message #119148] Tue, 24 February 2004 19:51 Go to previous message
Eclipse UserFriend
Originally posted by: vgusev.graphlogic.com

There is no negative implications whatsoever, Vladimir.

Vladimir
"Vladimir" <vgusev@graphlogic.com> wrote in message
news:c1e040$av7$1@eclipse.org...
> In the meantime, I have implemented this using native DND. Could you
please
> let me know what would be the negative implications of using native DND
> within one viewer?
>
> Thanks.
>
> Vladimir
> "Randy Hudson" <none@us.ibm.com> wrote in message
> news:c1dko7$s1s$1@eclipse.org...
> > In GEF as soon as the target is different than the parent, in this it is
> the
> > connection, then the default drag tracker will interpret this as an
> > ORPHAN+ADD. You can probably live with this, all you have to do is
check
> > who is the new parent, and act accordingly. You can also extend the
tool
> > and add your own LINK_TO_CONNECTION request type, and change the tool to
> use
> > this when conncetions are targeted.
> >
> > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > news:c1danl$dv9$1@eclipse.org...
> > > User has three nodes defined before in the editor pallete. Two nodes
are
> > > connected with a Connection.
> > > User needs to create a reference to the third node in the Connection.
To
> > do
> > > that, the user drags and drops this third node on the Connection.
> However,
> > > this is not a usual move or copy drop - because nothing happens to the
> > node
> > > being dragged.
> > > "Randy Hudson" <none@us.ibm.com> wrote in message
> > > news:c1da11$cv2$1@eclipse.org...
> > > > Consider me a user, and describe what is happening to the user. My
> > guess
> > > is
> > > > you should just handle everything in your command, and not think
about
> > > > reusing CreationFactory simply because you are instantiating an
object
> > in
> > > > your model.
> > > >
> > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > news:c1d83l$a1e$1@eclipse.org...
> > > > > Finally, somebody noticed ;-)
> > > > > I have a graphical node (editpart, model etc.) and a connection
> > between
> > > > two
> > > > > other graphical nodes. I am dragging the first node on a
connection.
> > > When
> > > > > this node is dropped, I need to set an attribute of the
connection's
> > > model
> > > > > to a special class, representing a reference to the first node's
> > model.
> > > > > After drop is finished, the first node should remain where it was
in
> > the
> > > > > beginning.
> > > > >
> > > > > Vladimir
> > > > > "Randy Hudson" <none@us.ibm
> >
>
..zl6wroteinmessagenewsc1d6fs$7p5$1@eclipse.org...Wow,ourfirstschizophrenicpo
> > sting!;-)
> > > > > >
> > > > > > Are you talking about native DND of an existing object in your
> > model?
> > > Or
> > > > > > just straight creation tool stuff from the palette? Please use
> > > concrete
> > > > > > terms in your description. For example, are you dragging a
class
> > from
> > > a
> > > > > > "model explorer" view into another class, and trying to create
an
> > > > > attribute
> > > > > > of that type in the class.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > > > news:c161u7$3ou$1@eclipse.org...
> > > > > > > Hey Vladimir,
> > > > > > >
> > > > > > > Go check DND paper by Bordeau - this may give you the freedom
to
> > do
> > > > > > exactly
> > > > > > > what you need, although within GraphicalEditor. All you need
to
> do
> > > is
> > > > to
> > > > > > > extend AbstractTransferDropTargetListener and other small
parts.
> > > > > > >
> > > > > > > Vladimir
> > > > > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > > > > news:c160il$25l$1@eclipse.org...
> > > > > > > > Well, Vladimir,
> > > > > > > >
> > > > > > > > TargetingTool.createTargetRequest() method is called when
the
> > drag
> > > > > > starts,
> > > > > > > > and the Target is not known yet. If you set the request's
> > > > > SimpleFactory
> > > > > > at
> > > > > > > > that point, you will limit all drags to creating a child's
> > > > reference,
> > > > > > this
> > > > > > > > is not what you want in all cases, especially when the
Target
> is
> > > not
> > > > a
> > > > > > > > Connection, do you?
> > > > > > > >
> > > > > > > > In Policy.getTargetEditPart(request) it maybe too late,
> because
> > > your
> > > > > > > request
> > > > > > > > will be ChangeBoundsRequest, which does not have the factory
> > field
> > > > and
> > > > > > > > thereby
> > > > > > > > is not intended for instance creation.
> > > > > > > >
> > > > > > > > Sounds like you'll have to create your reference instance in
> > > without
> > > > > > > > ressorting to
> > > > > > > > request.getNewObject(), since your request is not
> CreateRequest
> > > > > anyway?
> > > > > > > >
> > > > > > > > See if this canbe done using ChangeBoundsRequest in the
> > > > > > > Policy.getCommand(),
> > > > > > > > without actually using it although it maybe not the best
> > solution,
> > > > at
> > > > > > > least
> > > > > > > > you'll limit
> > > > > > > > this behaviour to your edit part.
> > > > > > > >
> > > > > > > > Vladimir
> > > > > > > >
> > > > > > > > "Vladimir" <vgusev@graphlogic.com> wrote in message
> > > > > > > > news:c15f99$cpc$1@eclipse.org...
> > > > > > > > > Hello,
> > > > > > > > >
> > > > > > > > > When a node is dropped on a connection, the connection
> should
> > > > > receive
> > > > > > a
> > > > > > > > new
> > > > > > > > > child. This child is not a node being dropped, but a new
> > > reference
> > > > > to
> > > > > > > that
> > > > > > > > > node - a different type of class. To create this new
> > reference,
> > > I
> > > > > > would
> > > > > > > > like
> > > > > > > > > to use the same pattern as in creating new objects when
> > dragging
> > > > > from
> > > > > > > > > pallette, using SimpleFactory. So my question is what is
the
> > > best
> > > > > > place
> > > > > > > to
> > > > > > > > > set the request's factory. Is it in the connection
policy's
> > > > > > > > > getTargetEditPart(request), method, or should I go
> somewhere
> > > > deeper
> > > > > > > like
> > > > > > > > > TargetingTool.createTargetRequest()?
> > > > > > > > >
> > > > > > > > > Thanks a lot.
> > > > > > > > >
> > > > > > > > > Vladimir
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>
Previous Topic:I'm missing something obvious with this whole EditPolicy/Request architecture...
Next Topic:DND Problems with j2sdk-1.4.*
Goto Forum:
  


Current Time: Sun Jul 21 17:22:39 GMT 2024

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

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

Back to the top