本文整理汇总了Java中org.eclipse.jdt.core.ClasspathContainerInitializer.canUpdateClasspathContainer方法的典型用法代码示例。如果您正苦于以下问题:Java ClasspathContainerInitializer.canUpdateClasspathContainer方法的具体用法?Java ClasspathContainerInitializer.canUpdateClasspathContainer怎么用?Java ClasspathContainerInitializer.canUpdateClasspathContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.core.ClasspathContainerInitializer
的用法示例。
在下文中一共展示了ClasspathContainerInitializer.canUpdateClasspathContainer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: evaluateContainerChildStatus
import org.eclipse.jdt.core.ClasspathContainerInitializer; //导入方法依赖的package包/类
private IStatus evaluateContainerChildStatus(CPListElementAttribute attrib) {
if (fProject != null) {
ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(fPath.segment(0));
if (initializer != null && initializer.canUpdateClasspathContainer(fPath, fProject)) {
if (attrib.isBuiltIn()) {
if (CPListElement.SOURCEATTACHMENT.equals(attrib.getKey())) {
return initializer.getSourceAttachmentStatus(fPath, fProject);
} else if (CPListElement.ACCESSRULES.equals(attrib.getKey())) {
return initializer.getAccessRulesStatus(fPath, fProject);
}
} else {
return initializer.getAttributeStatus(fPath, fProject, attrib.getKey());
}
}
return new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, ClasspathContainerInitializer.ATTRIBUTE_READ_ONLY, "", null); //$NON-NLS-1$
}
return null;
}
示例2: getClasspathEntryToEdit
import org.eclipse.jdt.core.ClasspathContainerInitializer; //导入方法依赖的package包/类
/**
* Helper method that tests if an classpath entry can be found in a
* container. <code>null</code> is returned if the entry can not be found
* or if the container does not allows the configuration of source
* attachments
* @param jproject The container's parent project
* @param containerPath The path of the container
* @param libPath The path of the library to be found
* @return IClasspathEntry A classpath entry from the container of
* <code>null</code> if the container can not be modified.
* @throws JavaModelException thrown if accessing the container failed
*/
public static IClasspathEntry getClasspathEntryToEdit(IJavaProject jproject, IPath containerPath, IPath libPath) throws JavaModelException {
IClasspathContainer container= JavaCore.getClasspathContainer(containerPath, jproject);
ClasspathContainerInitializer initializer= JavaCore.getClasspathContainerInitializer(containerPath.segment(0));
if (container != null && initializer != null && initializer.canUpdateClasspathContainer(containerPath, jproject)) {
return findEntryInContainer(container, libPath);
}
return null; // attachment not possible
}