Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problems with GraphicalEditorWithFlyoutPalette
Problems with GraphicalEditorWithFlyoutPalette [message #177223] Wed, 13 April 2005 08:22 Go to next message
Eclipse UserFriend
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 #177249 is a reply to message #177223] Wed, 13 April 2005 13:08 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
All of our examples do this. Let's see if you can figure it out.

"Jose" <jdelgad@correo.ugr.es> wrote in message
news:ebf0b47d3ddd2353f359c5a08dff18c0$1@www.eclipse.org...
> 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 Go to previous messageGo to next message
Eclipse UserFriend
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 #177379 is a reply to message #177353] Wed, 13 April 2005 20:54 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Okay, clue: look at setInput() in ShapesEditor, EDiagramEditor, LogicEditor
or FlowEditor.

"Jose" <jdelgad@correo.ugr.es> wrote in message
news:8c8b49979c66a7553e62dc3499d30573$1@www.eclipse.org...
> 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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
>
Previous Topic:Fixed Placement of figures
Next Topic:why do we draw connection lines and graph into different layer
Goto Forum:
  


Current Time: Sat Apr 20 00:37:41 GMT 2024

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

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

Back to the top