Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » IFile and FileEditorInput problem
IFile and FileEditorInput problem [message #460087] Wed, 13 December 2006 07:34 Go to next message
Eclipse UserFriend
Originally posted by: buloup.laps.univ-mrs.fr

Hello,

I extend FileEditorInput to create my own editor using an instance of IFile.
The user wants to rename this file and actually he can do that : the move
method
handles that kind of change. I mean that the project which owns that file
knows
that its name has changed :
project.refreshLocal(depth, null);

The problem is that I don't know how to tell the editorInput that its file
has
changed ?

Do I have to implement a ResourceChangeListener ? How ?

thanks,
frank
Re: IFile and FileEditorInput problem [message #460109 is a reply to message #460087] Thu, 14 December 2006 02:31 Go to previous messageGo to next message
Eclipse UserFriend
frank Buloup wrote:

>Hello,
>
>I extend FileEditorInput to create my own editor using an instance of IFile.
>
>
What kind of editor (iherits from which class)?

Dani

>The user wants to rename this file and actually he can do that : the move
>method
>handles that kind of change. I mean that the project which owns that file
>knows
>that its name has changed :
>project.refreshLocal(depth, null);
>
>The problem is that I don't know how to tell the editorInput that its file
>has
>changed ?
>
>Do I have to implement a ResourceChangeListener ? How ?
>
>thanks,
>frank
>
>
>
>
Re: IFile and FileEditorInput problem [message #460112 is a reply to message #460109] Thu, 14 December 2006 04:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: buloup.laps.univ-mrs.fr

> What kind of editor (iherits from which class)?
>
> Dani
>
The editor extends the EditorPart and the unput is a FileEditorInput.

I've found a way to solve my problem, I dont really know if it is the best
one...

I have overloaded the protected method "setInput" in the EditorPart class,
changing its visibility to public. By this way, I can create a knew input
editor
and assign it to the part...

frank
Re: IFile and FileEditorInput problem [message #460113 is a reply to message #460112] Thu, 14 December 2006 04:21 Go to previous message
Eclipse UserFriend
frank Buloup wrote:

>>What kind of editor (iherits from which class)?
>>
>>Dani
>>
>>
>>
>The editor extends the EditorPart and the unput is a FileEditorInput.
>
>I've found a way to solve my problem, I dont really know if it is the best
>one...
>
>I have overloaded the protected method "setInput" in the EditorPart class,
>changing its visibility to public. By this way, I can create a knew input
>editor
>and assign it to the part...
>
>
Hi Frank,

normally either the editor or some other component (for the text editors
it is an IElementStateListener which is connected to a document
provider) listens to changes and then updates the editor input (by
calling setInput). Since this is done inside the editor it is normally
not need to make that method public and call it from outside.

Dani

>frank
>
>
>
>
Previous Topic:Custom StatusBar
Next Topic:Applying TreeViewer Filter for a specific node
Goto Forum:
  


Current Time: Tue Mar 25 17:52:57 EDT 2025

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

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

Back to the top