Eclipse为链接的资源添加标记 [英] Eclipse Add marker for linked resources

查看:148
本文介绍了Eclipse为链接的资源添加标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道只能为IResource添加标记,可以为链接资源添加标记吗?
我已经使用org.eclipse.core.internal.Project.internalGetDescription()getLinks()从.project获得了链接的资源名称. 但是似乎有些东西丢失了,Eclipse在抱怨这个资源不存在的事实.
我正在使用Workspace.newResource([PATH])创建资源,其中PATH是使用.project的链接资源名称以及指向文件名的其余路径正确构建的IPath.

I know that markers can be added only for IResource(s), could they be added for linked resources ?
I've got the linked resource name from .project, using org.eclipse.core.internal.Project.internalGetDescription() and getLinks(). But it seems that something is missing, Eclipse is complaining about the fact that the resource does not exist.
I'm creating the resource using Workspace.newResource([PATH]), where the PATH is an IPath built correctly using the linked resource name from .project and the rest of path towards the file name.

也许以前有人为此工作过?

Maybe somebody has worked with this before ?

推荐答案

不要直接调用Workspace.newResource([PATH]),请使用其路径和#getFile()#getFolder()从IProject或IWorkspaceRoot获取资源.如果您正在执行此操作,那么这是一个链接的资源无关紧要.如果您仍然遇到问题,请告诉我们确切的投诉内容.

Don't call Workspace.newResource([PATH]) directly, get the resource from the IProject or IWorkspaceRoot using its path and #getFile() or #getFolder(). That it's a linked resource shouldn't matter if you're doing this right. If you're still having problems, tell us exactly what its complaint is.

这篇关于Eclipse为链接的资源添加标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆