How to open a file

来源:互联网 发布:linux 删除空文件夹 编辑:程序博客网 时间:2024/04/29 10:20
Path path = new Path("sample1-test\\StandardDataDict.xml");
//Path path = new Path("qqq\\plugin.xml");

   IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
   System.out.println(ResourcesPlugin.getWorkspace().getRoot().getLocation());
//    IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("sample1-test");
// try {
// project.create(null);
// project.open(null);
// } catch (CoreException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
   System.out.println(ResourcesPlugin.getWorkspace().getRoot().getFullPath());
getViewSite().getPage().openEditor(new FileEditorInput(file), "ppp.editors.XMLEditor");
原创粉丝点击