Created
May 9, 2009 18:12
-
-
Save aqubi/109364 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void resourceChanged(final IResourceChangeEvent event) { | |
if (event.getType() == IResourceChangeEvent.POST_CHANGE) { | |
Display.getDefault().asyncExec(new Runnable() { | |
public void run() { | |
IFile file = ((IFileEditorInput) input).getFile(); | |
if (!file.exists()) { | |
// ファイル名が変更されていたら、EditorをCloseする | |
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); | |
page.closeEditor(VisualMXMLEditor.this, false); | |
} else { | |
if (!getPartName().equals(file.getName())) { | |
//ファイル名が変わっていたらEditorPartの名前も変更する | |
setPartName(file.getName()); | |
} | |
// GraphicalEditorをファイルの情報から読込み直し | |
refreshGraphicalEditor(); | |
} | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment