Skip to main content



      Home
Home » Eclipse Projects » GEF » Trouble launching TextEditor from GEF
Trouble launching TextEditor from GEF [message #171233] Thu, 10 March 2005 11:08 Go to next message
Eclipse UserFriend
Originally posted by: a.morgan.pilz.ie

Hi,

I have a figure and it can be programmed using a simple low level language.
What I am trying to do is launch a TextEditor when I double click on the
figure.
In the performRequest method of the relevant EditPart when I receive a
REQ_OPEN I try to open a textEditor.
I use the following code to launch the Editor :

IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage().openEditor(input, "main.FBTextEditor");

FBTextEditor is a subclass of TextEditor.
The first problem I got was that I had no document provider. I overrode the
getDocumentProvider() method to return a new FilDocumentProvider.
Next I had to figure out what IEditorInput to pass.
I tried to pass a FileEditorInput with an IFile created as follows :

IFile newFile = ResourcesPlugin.getWorkspace().getRoot().getFile(path);

I tried passing both the path a file that doesn't exist and one that does.
When the Editor launched all that appeared was a blank editor space
containing the word "ERROR".
Any ideas guys cause this is wrecking my head.

Thanks,
Alan.
Re: Trouble launching TextEditor from GEF [message #171315 is a reply to message #171233] Fri, 11 March 2005 00:20 Go to previous message
Eclipse UserFriend
What was in the error log?

BTW, you'll probably get a better answer on the platform newsgroup.

"Alan Morgan" <a.morgan@pilz.ie> wrote in message
news:d0preu$6is$1@www.eclipse.org...
> Hi,
>
> I have a figure and it can be programmed using a simple low level
language.
> What I am trying to do is launch a TextEditor when I double click on the
> figure.
> In the performRequest method of the relevant EditPart when I receive a
> REQ_OPEN I try to open a textEditor.
> I use the following code to launch the Editor :
>
> IEditorPart part =
PlatformUI.getWorkbench().getActiveWorkbenchWindow()
> .getActivePage().openEditor(input, "main.FBTextEditor");
>
> FBTextEditor is a subclass of TextEditor.
> The first problem I got was that I had no document provider. I overrode
the
> getDocumentProvider() method to return a new FilDocumentProvider.
> Next I had to figure out what IEditorInput to pass.
> I tried to pass a FileEditorInput with an IFile created as follows :
>
> IFile newFile =
ResourcesPlugin.getWorkspace().getRoot().getFile(path);
>
> I tried passing both the path a file that doesn't exist and one that does.
> When the Editor launched all that appeared was a blank editor space
> containing the word "ERROR".
> Any ideas guys cause this is wrecking my head.
>
> Thanks,
> Alan.
>
>
>
>
Previous Topic:How can i make my editor read-only?
Next Topic:removal of toolbar from logic example
Goto Forum:
  


Current Time: Sat May 10 15:47:10 EDT 2025

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

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

Back to the top