Skip to main content



      Home
Home » Eclipse Projects » GEF » How to update GEF editor if file renamed?
How to update GEF editor if file renamed? [message #664807] Tue, 12 April 2011 03:33 Go to next message
Eclipse UserFriend
How to update GEF editor if file renamed?

This works fine for text editors. For example in Eclipse go to Navigator, open file HelloWorld.java in editor, rename HelloWorld.java to HelloWorld2.java in Navigator. Note that editor is now updated and it titled "HelloWorld2.java".

To do that Eclipse creates listener and adds it to ITextEditor: IElementStateListener fElementStateListener= new ElementStateListener() (handles elementMoved and calles setInput((IEditorInput) movedElement)) ITextEditor.getDocumentProvider().addElementStateListener(fE lementStateListener);

I guess I need to do the same thing for in org.eclipse.gef.ui.parts.GraphicalEditor but I don't know how cause graphicalEditor, doesn't have documentProvider
Re: How to update GEF editor if file renamed? [message #664966 is a reply to message #664807] Tue, 12 April 2011 11:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tmicko.gmail.com

Have a look at logic example. In the LogicEditor class, there is inner
class ResourceTracker which is the key.
Re: How to update GEF editor if file renamed? [message #665015 is a reply to message #664966] Tue, 12 April 2011 16:16 Go to previous messageGo to next message
Eclipse UserFriend
Sorry I don't have such classes as LogicEditor or ResourceTracker, could you please provide more information? Thanks.
Re: How to update GEF editor if file renamed? [message #665244 is a reply to message #665015] Wed, 13 April 2011 16:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tmicko.gmail.com

There are three examples provided with GEF. One of them is Logic
example:
http://wiki.eclipse.org/GEF_Developer_FAQ#How_do_I_Run_the_L ogic_Example.3F

Download and try it. It does exactly what you need. You can check the
sources for the mentioned classes.
Re: How to update GEF editor if file renamed? [message #665767 is a reply to message #664807] Fri, 15 April 2011 15:26 Go to previous messageGo to next message
Eclipse UserFriend
Thanks!
Re: How to update GEF editor if file renamed? [message #671848 is a reply to message #665767] Thu, 19 May 2011 03:28 Go to previous message
Eclipse UserFriend
you need to set the name on the Editors setPartName(String)
Previous Topic:draw2d - setBackgroundPattern
Next Topic:PDE Incubator Dependency Visualization Download Link
Goto Forum:
  


Current Time: Tue Jul 22 19:41:51 EDT 2025

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

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

Back to the top