老十的专栏

下自己的蛋,让别人说去吧!

用户操作
[即时聊天] [发私信] [加为好友]
老十ID:dollyn
8239次访问,排名13325(1),好友40人,关注者117人。
a
dollyn的文章
原创 17 篇
翻译 0 篇
转载 16 篇
评论 4 篇
老十的公告
  • 主要关注Eclipse插件开发,RCP,GEF,EMF及其他相关技术。
  • 关注:Java脚本引擎。
  • 本博客文章如无特别说明,可以随意转载,但请注明作者和出处。
  • 所有文章仅代表个人观点。
  • 本博客所转载的文章版权归原作者所有。
  • 最近评论
    dollyn:<!--[if !supportLists]-->X、<!--[endif]-->
    拷贝的时候,格式的问题,现在已经去掉了。
    dollyn:不太清楚,也许其他依赖插件自动把它加进去了。查看一下你导出的plugins目录中确实没有tomcat吗?

    确实没有的话,我也没法解释了
    fy_kenny:<!--[if !supportLists]-->X、<!--[endif]--> 你这里这么多的这样的标记是什么东西呀,看不明白
    fy_kenny:我怎么不需要选择tomcat就可以使用呢
    文章分类
    收藏
      相册
      QQ表情
      Test
      链接
      EclipseWorld(中国Eclipse社区)
      八进制的博客
      疯狂的波菜
      存档
      软件项目交易
      订阅我的博客
      XML聚合  FeedSky

      转载 How do I open an editor on a file outside the workspace?收藏

      新一篇: How do I open an editor on something that is not a file? | 旧一篇: 方舟子:IPv9,愚人节笑话当科研依据

      Since 3.3 you can use the new EFS support to open an text editor on a file outside the workspace:

         String name= new FileDialog(aShell, SWT.OPEN).open();
         
      if (name == null)
            
      return;
         IFileStore fileStore
      =  EFS.getLocalFileSystem().getStore(new Path(filterPath));
         fileStore
      =  fileStore.getChild(names[i]);
         
      if (!fileStore.fetchInfo().isDirectory() && fileStore.fetchInfo().exists()) {
           IWorkbenchPage page
      =  window.getActivePage();
           
      try {
             IDE.openEditorOnFileStore(page, fileStore);
           }
       catch (PartInitException e) {
             
      /* some code */
           }



      Alternatively, you can create a linked resource in an existing project, which points to a file elsewhere in the file system. This example snippet creates a project called “External Files,” and then prompts the user to select any file in the file system. The code then creates a linked resource in the project to that external file, allowing the platform to open the file in read/write mode in one of the standard editors:

         IWorkspace ws = ResourcesPlugin.getWorkspace();
         IProject project 
      = ws.getRoot().getProject("External Files");
         
      if (!project.exists())
            project.create(
      null);
         
      if (!project.isOpen())
            project.open(
      null);
         Shell shell 
      = window.getShell();
         String name 
      = new FileDialog(shell, SWT.OPEN).open();
         
      if (name == null)
            
      return;
         IPath location 
      = new Path(name);
         IFile file 
      = project.getFile(location.lastSegment());
         file.createLink(location, IResource.NONE, 
      null);
         IWorkbenchPage page 
      = window.getActivePage();
         
      if (page != null)
            page.openEditor(file);


      发表于 @ 2008年03月03日 10:52:00|评论(loading...)|编辑

      新一篇: How do I open an editor on something that is not a file? | 旧一篇: 方舟子:IPv9,愚人节笑话当科研依据

      评论:没有评论。

      发表评论  


      当前用户设置只有注册用户才能发表评论。如果你没有登录,请点击登录
      Csdn Blog version 3.1a
      Copyright © 老十