Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » CreationTool not firing after change of Perspective
CreationTool not firing after change of Perspective [message #245971] Tue, 28 October 2008 22:30 Go to next message
No real name is currently offline No real nameFriend
Messages: 38
Registered: July 2009
Member
I'm integrating a GEF-based editor tool into my existing RCP
application. This is my first foray into GEF/Draw2D.

The original editor tool was implemented in a viewer and I changed it to
work in an EditorPart. I created a Perspective to hold the editor of
this tool. A perspective listener loads the editor when the
perspective is activated and closes the editor when the new Perspective
is deactivated.

The viewer is a ScrollingGraphicalViewer.

When the application launches I can create n edit new objects all day
long. However, when I exit my Perspective with my editor and then
re-enter it and try to create new objects with the CreationTool, the
CreationTool doesn't seem to fire.

The cursor doesn't change to the add cursor and then I can't rubber-band
an area which creates the object.

I've debugged this and found that the CreateTool is indeed the active
tool on the EditDomain of my viewer, but no such luck in creating objects.

I've set the CreationTool property to not unload after it creates an
object, but it still doesn't work...

Ideas?
Re: CreationTool not firing after change of Perspective [message #245992 is a reply to message #245971] Wed, 29 October 2008 15:36 Go to previous message
No real name is currently offline No real nameFriend
Messages: 38
Registered: July 2009
Member
I seem to have solved this problem, but the solution was one of these
stab-in-the-dark chances.....

The main editor tool extends Composite. The various viewers are created
w/in that structure. In my EditorPart.dispose() method, I call various
'remove...Listener()' methods as par for the course, but I added a
editorTool = null; ... That does the trick.

Now when I switch perspectives and return to my new one with the editor
tool in an editor window, I can create/edit/delete objects all day long.

I'm not sure but I can only guess that there are some other cleanup
(dispose()?) methods getting called in the various viewer structures
that are triggered when I set the editorTool to null.

RacerNewbie wrote:
> I'm integrating a GEF-based editor tool into my existing RCP
> application. This is my first foray into GEF/Draw2D.
>
> The original editor tool was implemented in a viewer and I changed it to
> work in an EditorPart. I created a Perspective to hold the editor of
> this tool. A perspective listener loads the editor when the
> perspective is activated and closes the editor when the new Perspective
> is deactivated.
>
> The viewer is a ScrollingGraphicalViewer.
>
> When the application launches I can create n edit new objects all day
> long. However, when I exit my Perspective with my editor and then
> re-enter it and try to create new objects with the CreationTool, the
> CreationTool doesn't seem to fire.
>
> The cursor doesn't change to the add cursor and then I can't rubber-band
> an area which creates the object.
>
> I've debugged this and found that the CreateTool is indeed the active
> tool on the EditDomain of my viewer, but no such luck in creating objects.
>
> I've set the CreationTool property to not unload after it creates an
> object, but it still doesn't work...
>
> Ideas?
Previous Topic:how to control DND enablement with DropTarget and Graphicalviewer
Next Topic:Input to GEF Editor - PLEASE HELP
Goto Forum:
  


Current Time: Mon Sep 23 23:57:11 GMT 2024

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

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

Back to the top