本文整理汇总了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;
}
示例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;
}
示例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);
}