当前位置: 首页>>代码示例>>Java>>正文


Java ClasspathContainerInitializer.canUpdateClasspathContainer方法代码示例

本文整理汇总了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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:19,代码来源:CPListElement.java

示例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
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:JavaModelUtil.java


注:本文中的org.eclipse.jdt.core.ClasspathContainerInitializer.canUpdateClasspathContainer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。