eclips RCP 路径


获得程序未发布之前的Application路径:

FileLocator.resolve(Activator.getDefault().getBundle().getEntry("/")).getFile(); 

 

图片路径获取

    private static ImageDescriptor getImageByName(String imageName){
        return AbstractUIPlugin.imageDescriptorFromPlugin(AppContext.PLUGIN_ID, 
                "src/com/dc/tes/host/ui/image/" + imageName);
        //return ImageDescriptor.createFromURL(ImageManager.class.getResource(imageName));

    } 

 

注意 

AppContext.PLUGIN_ID 一定要是你的项目Plug.xml里的项目ID

参见:http://blog.csdn.net/superbsoftware/article/details/6754022 

路径是从应用根路径算起 

posted on 2011-11-26 23:55  shenfx  阅读(177)  评论(0)    收藏  举报

导航