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


Java JavaModelUtil.isExcludedPath方法代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.corext.util.JavaModelUtil.isExcludedPath方法的典型用法代码示例。如果您正苦于以下问题:Java JavaModelUtil.isExcludedPath方法的具体用法?Java JavaModelUtil.isExcludedPath怎么用?Java JavaModelUtil.isExcludedPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jdt.internal.corext.util.JavaModelUtil的用法示例。


在下文中一共展示了JavaModelUtil.isExcludedPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addExclusionPatterns

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private void addExclusionPatterns(IClasspathEntry newEntry, List<IClasspathEntry> existing, Set<IClasspathEntry> modifiedEntries) {
	IPath entryPath= newEntry.getPath();
	for (int i= 0; i < existing.size(); i++) {
		IClasspathEntry curr= existing.get(i);
		IPath currPath= curr.getPath();
		if (curr.getEntryKind() == IClasspathEntry.CPE_SOURCE && currPath.isPrefixOf(entryPath)) {
			IPath[] exclusionFilters= curr.getExclusionPatterns();
			if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) {
				IPath pathToExclude= entryPath.removeFirstSegments(currPath.segmentCount()).addTrailingSeparator();
				IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1];
				System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length);
				newExclusionFilters[exclusionFilters.length]= pathToExclude;

				IClasspathEntry updated= JavaCore.newSourceEntry(currPath, newExclusionFilters, curr.getOutputLocation());
				existing.set(i, updated);
				modifiedEntries.add(updated);
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:21,代码来源:NewSourceFolderWizardPage.java

示例2: addExclusionPatterns

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
/**
 * Updates the new classpath with exclusion patterns for the specified path.
 *
 * @param entries
 *            the classpath entries
 * @param path
 *            the path
 */
private static void addExclusionPatterns(final List<IClasspathEntry> entries, final IPath path) {
	for (int index= 0; index < entries.size(); index++) {
		final IClasspathEntry entry= entries.get(index);
		if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE && entry.getPath().isPrefixOf(path)) {
			final IPath[] patterns= entry.getExclusionPatterns();
			if (!JavaModelUtil.isExcludedPath(path, patterns)) {
				final IPath[] filters= new IPath[patterns.length + 1];
				System.arraycopy(patterns, 0, filters, 0, patterns.length);
				filters[patterns.length]= path.removeFirstSegments(entry.getPath().segmentCount()).addTrailingSeparator();
				entries.set(index, JavaCore.newSourceEntry(entry.getPath(), filters, entry.getOutputLocation()));
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:BinaryRefactoringHistoryWizard.java

示例3: addFilter

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private boolean addFilter(IPath path, String key) {
	IPath[] filters= (IPath[]) getAttribute(key);
	if (filters == null)
		return false;

	if (!JavaModelUtil.isExcludedPath(path, filters)) {
		IPath toAdd= path.removeFirstSegments(getPath().segmentCount()).addTrailingSeparator();
		IPath[] newFilters= new IPath[filters.length + 1];
		System.arraycopy(filters, 0, newFilters, 0, filters.length);
		newFilters[filters.length]= toAdd;
		setAttribute(key, newFilters);
		return true;
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:CPListElement.java

示例4: removeFilter

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private boolean removeFilter(IPath path, String key) {
	IPath[] filters= (IPath[]) getAttribute(key);
	if (filters == null)
		return false;

	IPath toRemove= path.removeFirstSegments(getPath().segmentCount()).addTrailingSeparator();
	if (JavaModelUtil.isExcludedPath(toRemove, filters)) {
		List<IPath> l= new ArrayList<IPath>(Arrays.asList(filters));
		l.remove(toRemove);
		IPath[] newFilters= l.toArray(new IPath[l.size()]);
		setAttribute(key, newFilters);
		return true;
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:CPListElement.java

示例5: addToExclusions

import org.eclipse.jdt.internal.corext.util.JavaModelUtil; //导入方法依赖的package包/类
private static boolean addToExclusions(IPath entryPath, CPListElement curr) {
	IPath[] exclusionFilters= (IPath[]) curr.getAttribute(CPListElement.EXCLUSION);
	if (!JavaModelUtil.isExcludedPath(entryPath, exclusionFilters)) {
		IPath pathToExclude= entryPath.removeFirstSegments(curr.getPath().segmentCount()).addTrailingSeparator();
		IPath[] newExclusionFilters= new IPath[exclusionFilters.length + 1];
		System.arraycopy(exclusionFilters, 0, newExclusionFilters, 0, exclusionFilters.length);
		newExclusionFilters[exclusionFilters.length]= pathToExclude;
		curr.setAttribute(CPListElement.EXCLUSION, newExclusionFilters);
		return true;
	}
	return false;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:BuildPathBasePage.java


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