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


Java CPListElement.getPath方法代码示例

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


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

示例1: doOpenInternalJarFileDialog

import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement; //导入方法依赖的package包/类
private CPListElement[] doOpenInternalJarFileDialog(CPListElement existing, Object parent) {
	IPath path = existing.getPath();
	IPath selectedPaths[] = BuildPathDialogAccess.chooseJAREntries(this.getShell(), path, new IPath[0]);
	
	if (selectedPaths != null) {
		List<CPListElement> elements = new ArrayList<CPListElement>();
		for (int i= 0; i < selectedPaths.length; i++) {
			CPListElement cpElement = new CPListElement(parent, fDummyProject, IClasspathEntry.CPE_LIBRARY, selectedPaths[i], null);
			cpElement.setAttribute(CPListElement.SOURCEATTACHMENT, BuildPathSupport.guessSourceAttachment(cpElement));
			cpElement.setAttribute(CPListElement.JAVADOC, BuildPathSupport.guessJavadocLocation(cpElement));
			
			elements.add(cpElement);
		}
		return elements.toArray(new CPListElement[0]);
	}
	return null;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:18,代码来源:UserLibraryPreferencePage.java

示例2: removeFromBuildpath

import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement; //导入方法依赖的package包/类
public static BuildpathDelta removeFromBuildpath(CPListElement[] toRemove, CPJavaProject cpProject) {

        IJavaProject javaProject= cpProject.getJavaProject();
		IPath projectPath= javaProject.getPath();
        IWorkspaceRoot workspaceRoot= javaProject.getProject().getWorkspace().getRoot();

    	List<CPListElement> existingEntries= cpProject.getCPListElements();
		BuildpathDelta result= new BuildpathDelta(NewWizardMessages.NewSourceContainerWorkbookPage_ToolBar_RemoveFromCP_tooltip);

		for (int i= 0; i < toRemove.length; i++) {
	        CPListElement element= toRemove[i];
	        existingEntries.remove(element);
	        result.removeEntry(element);
	        IPath path= element.getPath();
			removeFilters(path, javaProject, existingEntries);
			if (!path.equals(projectPath)) {
	            IResource member= workspaceRoot.findMember(path);
	            if (member != null)
	            	result.addDeletedResource(member);
            } else if (cpProject.getDefaultOutputLocation().equals(projectPath) && containsSourceFolders(cpProject)) {
            	String outputFolderName= PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME);
    			cpProject.setDefaultOutputLocation(cpProject.getDefaultOutputLocation().append(outputFolderName));
            }
        }

		result.setDefaultOutputLocation(cpProject.getDefaultOutputLocation());
    	result.setNewEntries(existingEntries.toArray(new CPListElement[existingEntries.size()]));

	    return result;
    }
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:31,代码来源:ClasspathModifier.java

示例3: openJarFileDialog

import org.eclipse.jdt.internal.ui.wizards.buildpaths.CPListElement; //导入方法依赖的package包/类
private CPListElement[] openJarFileDialog(CPListElement existing, Object parent) {
	if (existing == null) {
		return doOpenExternalJarFileDialog(existing, parent);
	}
	
	IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
	IPath path = existing.getPath();
	
	if (root.exists(path)) {
		return doOpenInternalJarFileDialog(existing, parent);
	}
	return doOpenExternalJarFileDialog(existing, parent);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:14,代码来源:UserLibraryPreferencePage.java


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