Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 07:33 Go to next message
Oleg Vazhnev is currently offline Oleg Vazhnev
Messages: 42
Registered: July 2009
Member
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 15:49 Go to previous messageGo to next message
Eclipse User
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 20:16 Go to previous messageGo to next message
Oleg Vazhnev is currently offline Oleg Vazhnev
Messages: 42
Registered: July 2009
Member
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 20:17 Go to previous messageGo to next message
Eclipse User
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 19:26 Go to previous messageGo to next message
Oleg Vazhnev is currently offline Oleg Vazhnev
Messages: 42
Registered: July 2009
Member
Thanks!
Re: How to update GEF editor if file renamed? [message #671848 is a reply to message #665767] Thu, 19 May 2011 07:28 Go to previous message
Girish Kumar is currently offline Girish Kumar
Messages: 23
Registered: May 2011
Junior Member
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: Wed Sep 17 17:40:54 GMT 2014

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

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