Problems with GraphicalEditorWithFlyoutPalette [message #177223] |
Wed, 13 April 2005 08:22 |
Eclipse User |
|
|
|
Originally posted by: jdelgad.correo.ugr.es
Hi,
I have a class named JCLECEditor which extends to
GraphicalEditorWithFlyoutPalette class. The problem is that in this class
I need to get the name of the file being opened. So, I have tried to use
the following:
1.- this.getTitle() --> it gives me an empty string
2.- PlatformUI.getWorkbench().getActiveWorkbenchWindow().
getActivePage().getActiveEditor().getTitle() --> using this, I
get a
CoreException
I think this problem is due to the editor isn't opened yet, but it is
getting opened. How can I get the name of the file being opened?
Thank you very much.
--Jose
|
|
|
|
Re: Problems with GraphicalEditorWithFlyoutPalette [message #177353 is a reply to message #177249] |
Wed, 13 April 2005 19:47 |
Eclipse User |
|
|
|
Originally posted by: jdelgad.correo.ugr.es
Hi Pratik,
I have studied the examples and in the class that extends
GraphicalEditorWithFlyoutPalette I can't find a call to the method
getTitle(). All I want to know is how I can get the name of the file being
opened, and this must be done inside the class that extends to
GraphicalEditorWithFlyoutPalette. Please, help me. I need to do this.
Thank you.
--Jose
|
|
|
|
Re: Problems with GraphicalEditorWithFlyoutPalette [message #177385 is a reply to message #177353] |
Wed, 13 April 2005 20:59 |
Eclipse User |
|
|
|
Originally posted by: gslade.no.spam.us.ibm.com
Hi Jose
You need to stop and think for a while. Create a new logic example file
( fred.logic ) and open it. Take a look at the title of the logic
editor.... see, it has the name of the file that was opened in it.
Your mission, should you choose to accept it is to find out how the name
of the file got into the title of the editor...... if you are successful
in this mission then you will have the answer to your question.... that
is to say that:
1. You will discover the code that placed the name into the title.
2. You will then know what code to use.
3. You will know when in the lifecycle of the editor that you can get
hold of the name.
4. You will gain some invaluable experience in tracing a GEF application
running.
good luck and may the force be with you
Guy
Jose wrote:
> Hi Pratik,
>
> I have studied the examples and in the class that extends
> GraphicalEditorWithFlyoutPalette I can't find a call to the method
> getTitle(). All I want to know is how I can get the name of the file
> being opened, and this must be done inside the class that extends to
> GraphicalEditorWithFlyoutPalette. Please, help me. I need to do this.
>
> Thank you.
>
> --Jose
>
|
|
|
Re: Problems with GraphicalEditorWithFlyoutPalette [message #177463 is a reply to message #177385] |
Thu, 14 April 2005 08:18 |
Eclipse User |
|
|
|
Originally posted by: jdelgad.correo.ugr.es
Hi again,
I am so sorry because I didn't explain well at all. Please, excuse me.
What I wanted to say is that I need to get the name of the file being
opened IN THE getPaletteRoot() METHOD or even in the constructor. At this
point, the setInput() method haven't been called yet. I want to do this
because the creation of the palette depends on some information stored in
a file called the same as the file name ended with .dat. I hope that I
have explained well.
Thank you very much for your interest in helping me.
--Jose.
|
|
|
Re: Problems with GraphicalEditorWithFlyoutPalette [message #177506 is a reply to message #177463] |
Thu, 14 April 2005 14:04 |
Eclipse User |
|
|
|
Originally posted by: gslade.no.spam.us.ibm.com
Hi Jose
I guess we will have to spoon feed it to you. You should spend more time
tracing through code so you get a better understanding of what is going
on before giving up.
EditorManager.createSite(...) calls the init method of the GEF editor.
One of the parms passed in is the IEditorInput.
Currently the init method is implemented in the GraphicalEditor class.
Override this method in your editor and you can get the file name from
the IEditorInput. Then call super.
Guy
Jose wrote:
> Hi again,
>
> I am so sorry because I didn't explain well at all. Please, excuse me.
> What I wanted to say is that I need to get the name of the file being
> opened IN THE getPaletteRoot() METHOD or even in the constructor. At
> this point, the setInput() method haven't been called yet. I want to do
> this because the creation of the palette depends on some information
> stored in a file called the same as the file name ended with .dat. I
> hope that I have explained well.
>
> Thank you very much for your interest in helping me.
>
> --Jose.
>
|
|
|
Powered by
FUDForum. Page generated in 0.02764 seconds