Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » refreshLocal of Folder doesn't work as expected
refreshLocal of Folder doesn't work as expected [message #61630] Thu, 19 June 2003 06:11 Go to next message
Eclipse UserFriend
Hi..
I've written an action working on a compilationUnit which generates a
derive java file, in the same directory as the selection CU.
e.g If I select 'myClass.java' (in package org.soft.module) and perform my
'FancyAction' on it, the result is that a new file 'myClassFancy.java' is
created in the same directory where myClass.java resides.
Since Eclipse is not synchronized with the local filesystem, i need to
refresh the parent folder of the selected resource.
I used parentFolder.refreshLocal(...) but i still have to call the core
"RefreshAction" manually to see the new file. But.. if I put a breakpoint
in the run-method of my FancyAction. The folder is actually refresh and i
see the new file. Why is that??

below a snippet of my code,the actual code is much larger but i only show
relevant source

****
public void run(IAction action) {
ICompilationUnit cu = (ICompilationUnit) sel.iterator().first();
String FancyArg = cu.getTypes()[0].getFullyQualifiedName();
FancyPlugin.getDefault().doit(fancyArg);

try {
IResource parentResource = cu.getParent().getResource();
parentResource.refreshLocal(IResource.DEPTH_ONE, null);
} catch (CoreException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
Re: refreshLocal of Folder doesn't work as expected [message #61964 is a reply to message #61630] Thu, 19 June 2003 12:21 Go to previous message
Eclipse UserFriend
The refreshLocal does work, but the problem is that the files that i
create in that directory are created after i do the refresh.


> ****
> public void run(IAction action) {
> ICompilationUnit cu = (ICompilationUnit) sel.iterator().first();
> String FancyArg = cu.getTypes()[0].getFullyQualifiedName();
> FancyPlugin.getDefault().doit(fancyArg);

> try {
> IResource parentResource = cu.getParent().getResource();
> parentResource.refreshLocal(IResource.DEPTH_ONE, null);
> } catch (CoreException e1) {
> // TODO Auto-generated catch block
> e1.printStackTrace();
> }
> }
Previous Topic:[ANN] Implementors plugin updated (version 0.0.8)
Next Topic:console to show log file
Goto Forum:
  


Current Time: Fri May 09 18:15:45 EDT 2025

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

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

Back to the top