Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF in RCP
GEF in RCP [message #218789] Sat, 01 July 2006 11:33 Go to next message
Eclipse UserFriend
Originally posted by: vedgunjan.yahoo.com

Hi Experts,

Im trying to lauch a GEF graphical editor in a RCP application.

I went thruough the link about GEF implementation adapted to RCP at:
http://www.eclipse.org/articles/Article-GEF-EMF/gef-emf.html



I downloaded the example and was able to run the application.

When i tried to open the editor it opened a dialog box and was loking for
*.shapes file in the file system.

When i looked in to the code , i found that it was using the following
approach ....


IWorkbenchPage page =window.get page().openEditor()
Now this method of the page object to open an editor take two inputs one
the EditorInput object and second the string object of HelloWorldEditor.

The editor input has to be some file on the local file system.



But in my case i dont have an input for the editor in the local file
system.

Is it possible to open the gef editor without the input path( IPath).

or the other scenario is can this path be initialised from DB value coming
from the backend.





I will be glad if any of the experts can guide me through this.



Thanks

Ved
Re: GEF in RCP [message #218797 is a reply to message #218789] Sat, 01 July 2006 20:08 Go to previous messageGo to next message
Josh Reed is currently offline Josh ReedFriend
Messages: 38
Registered: July 2009
Member
You need to pass the Editor something that implements the IEditorInput
interface but it doesn't necessarily need to be tied to the local file
system. I have an application that reads a bunch of data from a
database, then converts that data into classes (my model), and then adds
those classes to a custom implementation of the IEditorInput interface.

HTH,
Josh

Ved Gunjan wrote:
> Hi Experts,
>
> Im trying to lauch a GEF graphical editor in a RCP application.
>
> I went thruough the link about GEF implementation adapted to RCP at:
> http://www.eclipse.org/articles/Article-GEF-EMF/gef-emf.html
>
>
>
> I downloaded the example and was able to run the application.
>
> When i tried to open the editor it opened a dialog box and was loking
> for *.shapes file in the file system.
>
> When i looked in to the code , i found that it was using the following
> approach ....
>
> IWorkbenchPage page =window.get page().openEditor()
> Now this method of the page object to open an editor take two inputs one
> the EditorInput object and second the string object of HelloWorldEditor.
>
> The editor input has to be some file on the local file system.
>
>
>
> But in my case i dont have an input for the editor in the local file
> system.
>
> Is it possible to open the gef editor without the input path( IPath).
>
> or the other scenario is can this path be initialised from DB value
> coming from the backend.
>
>
>
>
>
> I will be glad if any of the experts can guide me through this.
>
>
>
> Thanks
>
> Ved
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Re: GEF in RCP [message #218806 is a reply to message #218797] Sun, 02 July 2006 05:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vedgunjan.yahoo.com

Thanks Josh for the reply.
If possible can u provide with snap shot of your classes, so that i can
take idea from it.
Or else any other example which is doing this...

thanks
ved
Re: GEF in RCP [message #218999 is a reply to message #218806] Wed, 05 July 2006 19:37 Go to previous messageGo to next message
Josh Reed is currently offline Josh ReedFriend
Messages: 38
Registered: July 2009
Member
Ved Gunjan wrote:
>
> Thanks Josh for the reply.
> If possible can u provide with snap shot of your classes, so that i can
> take idea from it.
> Or else any other example which is doing this...
>
> thanks
> ved
>

It's as straightforward as I mentioned before, simply implement the
IEditorInput interface ala
http://test.chronos.org/trac/psicat/browser/trunk/psicat.ui/ src/psicat/ui/editor/ModelDiagramEditorInput.java

And then open your editor with your IEditorInput implementation ala
http://test.chronos.org/trac/psicat/browser/trunk/psicat.ui/ src/psicat/ui/views/ModelTreeViewListener.java

In this case, I am opening the editor from a IDoubleClickListener on a
view. So when the user double clicks on an object in the view, I
construct a new ModelDiagramEditorInput and then open the editor with
that input.

Thanks,
Josh
Re: GEF in RCP [message #219023 is a reply to message #218789] Thu, 06 July 2006 12:39 Go to previous message
Eclipse UserFriend
Originally posted by: lamont_gilbert.rigidsoftware.com

Ved Gunjan wrote:

> Hi Experts,
>
> Im trying to lauch a GEF graphical editor in a RCP application.
>
> I went thruough the link about GEF implementation adapted to RCP at:
> http://www.eclipse.org/articles/Article-GEF-EMF/gef-emf.html
>
>
>
> I downloaded the example and was able to run the application.
>
> When i tried to open the editor it opened a dialog box and was loking for
> *.shapes file in the file system.
>
> When i looked in to the code , i found that it was using the following
> approach ....
>
>
> IWorkbenchPage page =window.get page().openEditor()
> Now this method of the page object to open an editor take two inputs one
> the EditorInput object and second the string object of HelloWorldEditor.
>
> The editor input has to be some file on the local file system.
>
>
>
> But in my case i dont have an input for the editor in the local file
> system.
>
> Is it possible to open the gef editor without the input path( IPath).
>

If you are talking about the example editors then the answer is no. But you
can modify the example editor so it takes the type of input you want once
you understand how they work. OR you can make your own editor based on
what you learn from looking at the example editors and reading the
documentation.

I have an application that takes a custom IEditorInput I created that
actually holds a type of soft reference to a database that the editor uses
to get its contents. I havent put it on the web yet. Been playing games
too much to clean up my website...

> or the other scenario is can this path be initialised from DB value coming
> from the backend.
>
>
>
>
>
> I will be glad if any of the experts can guide me through this.
>
>
>
> Thanks
>
> Ved

--
Respectfully,

CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into the
sheepfold{}, but climbeth up some other *way, the same is a thief and a
robber."
Previous Topic:Infinite loop in DeferredUpdateManager strikes back
Next Topic:How to synchronize the two scrollbar movements of two graphical viewers
Goto Forum:
  


Current Time: Tue Apr 16 17:31:58 GMT 2024

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

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

Back to the top