back to default 'Select' tool after creating a connection [message #204012] |
Tue, 29 November 2005 13:04  |
Eclipse User |
|
|
|
Originally posted by: pbeagan.yahoo_dontspamme_.com
Hi, In my editor, a user can create a connection between to objects. When
the second node of the connection is clicked, the connection is created.
At this point GEF still has the Connection tool selected for the user to
create another connection. What do I need to do to make it so the user has
the 'Select' tool after a connection is created? Thanks.
|
|
|
|
|
|
|
|
Re: back to default 'Select' tool after creating a connection [message #204848 is a reply to message #204832] |
Thu, 08 December 2005 04:14   |
Eclipse User |
|
|
|
Hi again!
"Randy Hudson" <none@us.ibm.com> wrote in message
news:dn89ta$btf$1@news.eclipse.org...
>> But now I get a somewhat odd behaviour, that I can't explain:
>> ...
>
> Perhaps the tool is staying active? Can you create a second
> connection? Try setting the property "unload when finished" to true
> using similar technique. Otherwise, it could be a bug like a lingering
> mouse cursor or something.
It's a strange combination:
The tool is NOT staying active - regardless of whether I add the "unload
when finished" property or not.
But the "plug"-cursor always stays, also regardless of whether "unload
when finished" is there or not. Until one leaves the drawing area by
when the cursor disappears.
I also tested/verified this by adding the line
-----------%<-----------%<-----------
tool.setToolClass(ConnectionDragCreationTool.class);
-----------%<-----------%<-----------
to the GEF example "Shapes" (class: ShapesEditorPaletteFactory, method:
createToolsGroup):
-----------%<-----------%<-----------
...
// Add (solid-line) connection tool
tool = new ConnectionCreationToolEntry("Solid connection",
"Create a solid-line
connection",
new CreationFactory()
{
public Object getNewObject() {
return null;
}
// see
// ShapeEditPart#createEditPolicies()
// this is abused to
// transmit the desired line
// style
public Object getObjectType() {
return Connection.SOLID_CONNECTION;
}
},
ImageDescriptor.createFromFile(ShapesPlugin.class,
"icons/connection_s16.gif"),
ImageDescriptor.createFromFile(ShapesPlugin.class,
"icons/connection_s24.gif"));
// added by MMO:
tool.setToolClass(ConnectionDragCreationTool.class); // <<<<<
// the odd behaviour stays with and without this:
// tool.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_FINIS HED,
Boolean.TRUE);
toolGroup.add(tool);
...
-----------%<-----------%<-----------
Summarizing: I'ld say this is a bug! Can you reproduce this? If so I'll
enter it in bugzilla...
Michael
|
|
|
Re: back to default 'Select' tool after creating a connection [message #204944 is a reply to message #204848] |
Thu, 08 December 2005 17:02   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
Go ahead and open it so you'll be CC'ed on the bugzilla.
>
> It's a strange combination:
> The tool is NOT staying active - regardless of whether I add the "unload
> when finished" property or not.
> But the "plug"-cursor always stays, also regardless of whether "unload
> when finished" is there or not. Until one leaves the drawing area by when
> the cursor disappears.
>
> I also tested/verified this by adding the line
> -----------%<-----------%<-----------
> tool.setToolClass(ConnectionDragCreationTool.class);
> -----------%<-----------%<-----------
>
> to the GEF example "Shapes" (class: ShapesEditorPaletteFactory, method:
> createToolsGroup):
> -----------%<-----------%<-----------
> ...
> // Add (solid-line) connection tool
> tool = new ConnectionCreationToolEntry("Solid connection",
> "Create a solid-line connection",
> new CreationFactory()
> {
> public Object getNewObject() {
> return null;
> }
>
> // see
> // ShapeEditPart#createEditPolicies()
> // this is abused to
> // transmit the desired line
> // style
> public Object getObjectType() {
> return Connection.SOLID_CONNECTION;
> }
> },
> ImageDescriptor.createFromFile(ShapesPlugin.class,
> "icons/connection_s16.gif"),
> ImageDescriptor.createFromFile(ShapesPlugin.class,
> "icons/connection_s24.gif"));
>
> // added by MMO:
> tool.setToolClass(ConnectionDragCreationTool.class); // <<<<<
> // the odd behaviour stays with and without this:
> // tool.setToolProperty(AbstractTool.PROPERTY_UNLOAD_WHEN_FINIS HED,
> Boolean.TRUE);
> toolGroup.add(tool);
> ...
> -----------%<-----------%<-----------
>
> Summarizing: I'ld say this is a bug! Can you reproduce this? If so I'll
> enter it in bugzilla...
>
> Michael
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.09742 seconds