Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Renaming resource file
Renaming resource file [message #297235] Tue, 10 January 2006 19:39 Go to next message
Eclipse UserFriend
Originally posted by: maxime.cailloux.cea.fr

Hi,

I want to rename a resource file programmatically. I don't find method
which allows that.Is there such a method?

Else,I tried file.move(new_path,true,null) ,it works (the file is
correctly moved in the navigator), but the editor part is not updated(so,
for example, I don't rename again the file, the file must be closed
manually and reopened so that it works).
How do you do that programmatically?

Thanks in advance,
Maxime
Re: Renaming resource file [message #297238 is a reply to message #297235] Tue, 10 January 2006 20:57 Go to previous messageGo to next message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
M.Cailloux wrote:

> Hi,
>
> I want to rename a resource file programmatically. I don't find method
> which allows that.Is there such a method?
>
> Else,I tried file.move(new_path,true,null) ,it works (the file is
> correctly moved in the navigator), but the editor part is not updated(so,
> for example, I don't rename again the file, the file must be closed
> manually and reopened so that it works).
> How do you do that programmatically?
>
> Thanks in advance,
> Maxime
do refresh porject after move
Re: Renaming resource file [message #297243 is a reply to message #297238] Tue, 10 January 2006 21:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: spotlight07.free.fr

Although the original file is deleted, the editor corresponding to the
original file (before the renaming)remains opened.
By refreshing the project, it does not change anything.
I want that the renaming acts directly on the editor.
Please, help me.

Maxime
Re: Renaming resource file [message #297245 is a reply to message #297235] Tue, 10 January 2006 21:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: john.eclipsefaq.org

IResource#move is the correct method. The editor should be listening
for resource changes and react accordingly. This sounds like a bug in
the particular editor you are using. Refresh local is NOT required.
--

M.Cailloux wrote:
> Hi,
>
> I want to rename a resource file programmatically. I don't find method
> which allows that.Is there such a method?
>
> Else,I tried file.move(new_path,true,null) ,it works (the file is
> correctly moved in the navigator), but the editor part is not
> updated(so, for example, I don't rename again the file, the file must be
> closed manually and reopened so that it works).
> How do you do that programmatically?
>
> Thanks in advance,
> Maxime
>
Re: Renaming resource file [message #297250 is a reply to message #297245] Tue, 10 January 2006 21:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: maxime.cailloux.cea.fr

So, I will try to close and reopen() the file.
How do you close and open a file programatically?
Manually, this corrects the problem.

Thanks,
Maxime
Re: Renaming resource file [message #297269 is a reply to message #297243] Wed, 11 January 2006 00:52 Go to previous messageGo to next message
Haris Peco is currently offline Haris PecoFriend
Messages: 1072
Registered: July 2009
Senior Member
M.Cailloux wrote:

> Although the original file is deleted, the editor corresponding to the
> original file (before the renaming)remains opened.
> By refreshing the project, it does not change anything.
> I want that the renaming acts directly on the editor.
> Please, help me.
>
> Maxime
Maxime,
try inspect open editors
Re: Renaming resource file [message #1695024 is a reply to message #297235] Mon, 11 May 2015 13:08 Go to previous message
Ashfaqur Rahman is currently offline Ashfaqur RahmanFriend
Messages: 4
Registered: May 2014
Junior Member
So how did you solve the problem finally?
Previous Topic:Saving java file fires two IResourceChangeEvent
Next Topic:date format of date variable
Goto Forum:
  


Current Time: Mon Jan 20 07:23:47 GMT 2025

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

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

Back to the top