Problem with editor refreshing (continuation after pressing a wrong key...) [message #313643] |
Wed, 21 March 2007 08:47 |
Eclipse User |
|
|
|
Originally posted by: nathalie.lepy.inria.fr
Hi,
I have a problem when I want to refresh the content of files modified
outside Eclipse (I launch an external command which modify the files). I
have just changed my machine (from Tx under Linux, to a Sun Raye under
Solaris 10). Before changing, the following code works well :
<code>
// call the external command
contextualConfig.launch("run", null, false, true);
// refreshing opened files (some files could be modified)
FileToolSet.refreshFiles(fileList, LotosEditor.LOTOS_EDITOR_ID);
</code>
Where 'refreshFiles' is defined as follow:
<code>
public static boolean refreshFiles(ArrayList<String> fileNameList,
String EditorID)
{
IWorkbenchWindow[] wins = getWorkbenchWindows();
if (wins == null) {
MessageToolSet.displayErrorMessage("Refresh failure",
"The workbench can't be refreshed");
return false;
}
ArrayList<IEditorPart> editors = ToolSet.searchEditors(
wins,
EditorID);
for (IEditorPart edPart : editors)
{
if (edPart instanceof TextEditor)
{
IFile file = ((IFileEditorInput) edPart.getEditorInput()).getFile();
if (fileNameList.contains(file.getLocation().toString()))
{
LotosDocumentProvider doc = (LotosDocumentProvider)
((TextEditor)edPart).getDocumentProvider();
doc.refreshFile(file);
}
}
}
return true;
}
After changing, the code doesn't refresh anymore and if I try to open
again a supposed modified file, it doesn't do anything, the file content
remains the same.
If I launch the same command from a xterm window, when I come back under
Eclipse workspace, a change is detected and I'm warn to reload the file.
Finally, I don't know why, but if I add an instruction to wait for 2
seconde before launching instruction, it works again ! But of course, I
can't let it in this state, because may be for other machine, with other
system, it should have to wait for 4 secondes !
I'm stuck on this problem for two days now, so if somebody know what can I
do to solve it, please tell me,
Thanks,
Nath.
|
|
|
Powered by
FUDForum. Page generated in 0.04335 seconds