Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Re-enabling Direct Editing Mode
Re-enabling Direct Editing Mode [message #849950] Thu, 19 April 2012 11:55 Go to previous message
Craig Petre is currently offline Craig Petre
Messages: 24
Registered: April 2011
Junior Member
Hey, so I followed the tutorial for adding a DirectEditingFeature and it works fine. I add the pictogram element which can be direct edited and I'm able to edit the name, etc. I was wondering if there is an easy way to re-enable direct editing at some point after creation (like if the user double clicks on text, I'd like to enable direct editing again). I noticed there is a function in IFeatureProviderWithPatterns called "activateDirectEditingForPatterns". So what I did was create a ICustomFeature which calls, in its execute method, that function and I return the custom feature from the ToolBehaviorProvider "getDoubleClickFeature". So all of that works fine, I double click on the pictogram element I want to re-enable direct editing on and "activateDirectEditingForPatterns" is called and everything seems to be working as designed with one small problem, I need to move the pictogram element after calling "activateDirectEditingForPatterns" before the editable text box will show up and allow me to edit.. which I can of course get around by overriding the function and moving the PE after direct editing mode is enabled.. but that is definitely a hack.

Does the procedure described above sound like how one would go about doing this? Or am I missing some simpler method? Seems like "activateDirectEditingForPatterns" shouldn't require me to move or otherwise update the PE in order to get direct editing turned on right?

Thanks,
Craig

[Updated on: Thu, 19 April 2012 13:44]

Report message to a moderator

 
Read Message
Read Message
Read Message
Previous Topic:Possible to add a source tab?
Next Topic:Layering of figures
Goto Forum:
  


Current Time: Sat May 25 18:00:41 EDT 2013

Powered by FUDForum. Page generated in 0.03024 seconds