Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Cannot set Factory on ConnectionCreationTool
Cannot set Factory on ConnectionCreationTool [message #12239] Mon, 08 July 2002 12:17 Go to next message
Zhu Jun (Joe) is currently offline Zhu Jun (Joe)Friend
Messages: 15
Registered: July 2009
Junior Member
I cannot set Factory on ConnectionCreationTool, my version of GEF is 1.0,
have you added it in GEF 2.0?

If you set the Factory on the ConnectionCreationTool, it should provide the
new Type and instance information to the request.
Someone at IBM requested this about 6 months ago so I believe it should
work.

"Jun Zhu" <zhujun@cn.ibm.com> wrote in message
news:af18ep$8tc$1@rogue.oti.com...
> I want to support 2 kinds of connection, and each kind of connection has
> its own kind of EditPart, and I add the 2 connection tools to the palette
> with the following code
>
> tool = new DefaultPaletteToolEntry(
> new ConnectionTool(),
> "connection1",
> "connection1",
> Image16,
> Image32
> );
> entries.add(tool);
>
> tool = new DefaultPaletteToolEntry(
> new ConnectionTool(),
> "connection2",
> "connection2",
> Image16,
> Image32
> );
> entries.add(tool);
>
> However, in the NodeEditPolicy.getConnectionCreateCommand(request) method,
>
> request.getNewObject and request.getNewObjectType all returns null, so
> that I cannot distinguish which kind of connection to create
>
> The current solution is to keep reference of the two new ConnectionTool in
> the above code as connection1Tool and connection2Tool, and then at the
> NodeEditPolicy.getConnectionCreateCommand(request) method, I can determine
> which kind of connection to create by testing which tool is the current
> active tool get from
> getHost().getRoot().getViewer().getEditDomain().getActiveToo l()
>
> Obvious this is not a good solution because of the more tight coupling
> degree between editpolicies and palettes. So I want to know why
> request.getNewObject and request.getNewObjectType will be null? Is it a
> bug? Or is there any other way of solving this problem
>>
Re: Cannot set Factory on ConnectionCreationTool [message #12489 is a reply to message #12239] Mon, 08 July 2002 17:20 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.ibm.com

What do you mean 1.0? Where did you get 1.0? WSAD?

"Jun Zhu" <zhujun@cn.ibm.com> wrote in message
news:agbvt9$783$1@rogue.oti.com...
> I cannot set Factory on ConnectionCreationTool, my version of GEF is 1.0,
> have you added it in GEF 2.0?
>
> If you set the Factory on the ConnectionCreationTool, it should provide
the
> new Type and instance information to the request.
> Someone at IBM requested this about 6 months ago so I believe it should
> work.
>
> "Jun Zhu" <zhujun@cn.ibm.com> wrote in message
> news:af18ep$8tc$1@rogue.oti.com...
> > I want to support 2 kinds of connection, and each kind of connection has
> > its own kind of EditPart, and I add the 2 connection tools to the
palette
> > with the following code
> >
> > tool = new DefaultPaletteToolEntry(
> > new ConnectionTool(),
> > "connection1",
> > "connection1",
> > Image16,
> > Image32
> > );
> > entries.add(tool);
> >
> > tool = new DefaultPaletteToolEntry(
> > new ConnectionTool(),
> > "connection2",
> > "connection2",
> > Image16,
> > Image32
> > );
> > entries.add(tool);
> >
> > However, in the NodeEditPolicy.getConnectionCreateCommand(request)
method,
> >
> > request.getNewObject and request.getNewObjectType all returns null, so
> > that I cannot distinguish which kind of connection to create
> >
> > The current solution is to keep reference of the two new ConnectionTool
in
> > the above code as connection1Tool and connection2Tool, and then at the
> > NodeEditPolicy.getConnectionCreateCommand(request) method, I can
determine
> > which kind of connection to create by testing which tool is the current
> > active tool get from
> > getHost().getRoot().getViewer().getEditDomain().getActiveToo l()
> >
> > Obvious this is not a good solution because of the more tight coupling
> > degree between editpolicies and palettes. So I want to know why
> > request.getNewObject and request.getNewObjectType will be null? Is it a
> > bug? Or is there any other way of solving this problem
> >>
>
>
Re: Cannot set Factory on ConnectionCreationTool [message #12571 is a reply to message #12489] Tue, 09 July 2002 02:15 Go to previous messageGo to next message
Zhu Jun (Joe) is currently offline Zhu Jun (Joe)Friend
Messages: 15
Registered: July 2009
Junior Member
I mean GEF 1.0 which is embeded in the WSAD 4.11 IE version.
And I get the documents of GEF 1.0 from an internal site of IBM.

Randy Hudson wrote:

> What do you mean 1.0? Where did you get 1.0? WSAD?

> "Jun Zhu" <zhujun@cn.ibm.com> wrote in message
> news:agbvt9$783$1@rogue.oti.com...
> > I cannot set Factory on ConnectionCreationTool, my version of GEF is 1.0,
> > have you added it in GEF 2.0?
> >
> > If you set the Factory on the ConnectionCreationTool, it should provide
> the
> > new Type and instance information to the request.
> > Someone at IBM requested this about 6 months ago so I believe it should
> > work.
> >
> > "Jun Zhu" <zhujun@cn.ibm.com> wrote in message
> > news:af18ep$8tc$1@rogue.oti.com...
> > > I want to support 2 kinds of connection, and each kind of connection has
> > > its own kind of EditPart, and I add the 2 connection tools to the
> palette
> > > with the following code
> > >
> > > tool = new DefaultPaletteToolEntry(
> > > new ConnectionTool(),
> > > "connection1",
> > > "connection1",
> > > Image16,
> > > Image32
> > > );
> > > entries.add(tool);
> > >
> > > tool = new DefaultPaletteToolEntry(
> > > new ConnectionTool(),
> > > "connection2",
> > > "connection2",
> > > Image16,
> > > Image32
> > > );
> > > entries.add(tool);
> > >
> > > However, in the NodeEditPolicy.getConnectionCreateCommand(request)
> method,
> > >
> > > request.getNewObject and request.getNewObjectType all returns null, so
> > > that I cannot distinguish which kind of connection to create
> > >
> > > The current solution is to keep reference of the two new ConnectionTool
> in
> > > the above code as connection1Tool and connection2Tool, and then at the
> > > NodeEditPolicy.getConnectionCreateCommand(request) method, I can
> determine
> > > which kind of connection to create by testing which tool is the current
> > > active tool get from
> > > getHost().getRoot().getViewer().getEditDomain().getActiveToo l()
> > >
> > > Obvious this is not a good solution because of the more tight coupling
> > > degree between editpolicies and palettes. So I want to know why
> > > request.getNewObject and request.getNewObjectType will be null? Is it a
> > > bug? Or is there any other way of solving this problem
> > >>
> >
> >
Re: Cannot set Factory on ConnectionCreationTool [message #12658 is a reply to message #12571] Tue, 09 July 2002 15:28 Go to previous message
Eclipse UserFriend
Originally posted by: none.ibm.com

Ok. this didn't work in 1.0. No one was trying to do this, or if they did,
they were subclassing our tool instead of reporting the bug.

You can probably workaround this in 1.0. You might have to override the
conneciton tool's createRequest method, and set the factory on the request.
Sorry, I don't have 1.0 code installed right now.

"Jun Zhu" <zhujun@cn.ibm.com> wrote in message
news:agdgv5$3vo$1@rogue.oti.com...
> I mean GEF 1.0 which is embeded in the WSAD 4.11 IE version.
> And I get the documents of GEF 1.0 from an internal site of IBM.
>
> Randy Hudson wrote:
>
> > What do you mean 1.0? Where did you get 1.0? WSAD?
>
> > "Jun Zhu" <zhujun@cn.ibm.com> wrote in message
> > news:agbvt9$783$1@rogue.oti.com...
> > > I cannot set Factory on ConnectionCreationTool, my version of GEF is
1.0,
> > > have you added it in GEF 2.0?
> > >
> > > If you set the Factory on the ConnectionCreationTool, it should
provide
> > the
> > > new Type and instance information to the request.
> > > Someone at IBM requested this about 6 months ago so I believe it
should
> > > work.
> > >
> > > "Jun Zhu" <zhujun@cn.ibm.com> wrote in message
> > > news:af18ep$8tc$1@rogue.oti.com...
> > > > I want to support 2 kinds of connection, and each kind of connection
has
> > > > its own kind of EditPart, and I add the 2 connection tools to the
> > palette
> > > > with the following code
> > > >
> > > > tool = new DefaultPaletteToolEntry(
> > > > new ConnectionTool(),
> > > > "connection1",
> > > > "connection1",
> > > > Image16,
> > > > Image32
> > > > );
> > > > entries.add(tool);
> > > >
> > > > tool = new DefaultPaletteToolEntry(
> > > > new ConnectionTool(),
> > > > "connection2",
> > > > "connection2",
> > > > Image16,
> > > > Image32
> > > > );
> > > > entries.add(tool);
> > > >
> > > > However, in the NodeEditPolicy.getConnectionCreateCommand(request)
> > method,
> > > >
> > > > request.getNewObject and request.getNewObjectType all returns null,
so
> > > > that I cannot distinguish which kind of connection to create
> > > >
> > > > The current solution is to keep reference of the two new
ConnectionTool
> > in
> > > > the above code as connection1Tool and connection2Tool, and then at
the
> > > > NodeEditPolicy.getConnectionCreateCommand(request) method, I can
> > determine
> > > > which kind of connection to create by testing which tool is the
current
> > > > active tool get from
> > > > getHost().getRoot().getViewer().getEditDomain().getActiveToo l()
> > > >
> > > > Obvious this is not a good solution because of the more tight
coupling
> > > > degree between editpolicies and palettes. So I want to know why
> > > > request.getNewObject and request.getNewObjectType will be null? Is
it a
> > > > bug? Or is there any other way of solving this problem
> > > >>
> > >
> > >
>
>
>
>
>
Previous Topic:[SWT] Any support or porting projects for OS2?
Next Topic:Shape Example HOWTO
Goto Forum:
  


Current Time: Sat Jul 27 12:47:56 GMT 2024

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

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

Back to the top