本文整理汇总了Java中org.eclipse.jdt.ui.PreferenceConstants.getDefaultJRELibrary方法的典型用法代码示例。如果您正苦于以下问题:Java PreferenceConstants.getDefaultJRELibrary方法的具体用法?Java PreferenceConstants.getDefaultJRELibrary怎么用?Java PreferenceConstants.getDefaultJRELibrary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.ui.PreferenceConstants
的用法示例。
在下文中一共展示了PreferenceConstants.getDefaultJRELibrary方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createJRProject
import org.eclipse.jdt.ui.PreferenceConstants; //导入方法依赖的package包/类
public static void createJRProject(IProgressMonitor monitor, IProject prj) throws CoreException, JavaModelException {
addNature(prj, JavaCore.NATURE_ID, monitor);
List<IClasspathEntry> centries = new ArrayList<IClasspathEntry>();
IJavaProject javaProject = JavaCore.create(prj);
IClasspathEntry[] jreClasspath = PreferenceConstants.getDefaultJRELibrary();
IFolder folder = prj.getFolder(PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME));
folder.create(IResource.FORCE | IResource.DERIVED, true, monitor);
folder.setDerived(true, monitor);
prj.refreshLocal(IResource.DEPTH_INFINITE, monitor);
centries.addAll(Arrays.asList(jreClasspath));
addNature(prj, JasperReportsNature.NATURE_ID, monitor);
// Path to all libraries needed
createJRClasspathContainer(monitor, centries, javaProject);
}
示例2: getDefaultClassPath
import org.eclipse.jdt.ui.PreferenceConstants; //导入方法依赖的package包/类
private List<CPListElement> getDefaultClassPath(IJavaProject jproj) {
List<CPListElement> list= new ArrayList<CPListElement>();
IResource srcFolder;
IPreferenceStore store= PreferenceConstants.getPreferenceStore();
String sourceFolderName= store.getString(PreferenceConstants.SRCBIN_SRCNAME);
if (store.getBoolean(PreferenceConstants.SRCBIN_FOLDERS_IN_NEWPROJ) && sourceFolderName.length() > 0) {
srcFolder= jproj.getProject().getFolder(sourceFolderName);
} else {
srcFolder= jproj.getProject();
}
list.add(new CPListElement(jproj, IClasspathEntry.CPE_SOURCE, srcFolder.getFullPath(), srcFolder));
IClasspathEntry[] jreEntries= PreferenceConstants.getDefaultJRELibrary();
list.addAll(getCPListElements(jreEntries, null));
return list;
}
示例3: createProject
import org.eclipse.jdt.ui.PreferenceConstants; //导入方法依赖的package包/类
public static IJavaProject createProject(String name) throws CoreException {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject project = root.getProject(name);
if (!project.exists()) {
project.create(new NullProgressMonitor());
} else {
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
}
if (!project.isOpen()) {
project.open(new NullProgressMonitor());
}
IFolder binFolder = project.getFolder("bin");
if (!binFolder.exists()) {
createFolder(binFolder, false, true, new NullProgressMonitor());
}
IPath outputLocation = binFolder.getFullPath();
addNatureToProject(project, JavaCore.NATURE_ID, new NullProgressMonitor());
IJavaProject jproject = JavaCore.create(project);
jproject.setOutputLocation(outputLocation, new NullProgressMonitor());
IClasspathEntry[] entries = PreferenceConstants.getDefaultJRELibrary();
jproject.setRawClasspath(entries, new NullProgressMonitor());
return jproject;
}
示例4: getDefaultClasspathEntries
import org.eclipse.jdt.ui.PreferenceConstants; //导入方法依赖的package包/类
/**
* Returns the default class path entries to be added on new projects. By default this is the JRE container as
* selected by the user.
*
* @return returns the default class path entries
*/
public IClasspathEntry[] getDefaultClasspathEntries() {
IPath newPath= fJREGroup.getJREContainerPath();
if (newPath != null) {
return new IClasspathEntry[] { JavaCore.newContainerEntry(newPath) };
}
return PreferenceConstants.getDefaultJRELibrary();
}
示例5: detectClasspath
import org.eclipse.jdt.ui.PreferenceConstants; //导入方法依赖的package包/类
/**
* Method detectClasspath.
*
* @param monitor The progress monitor (not null)
* @throws CoreException in case of any failure
*/
private void detectClasspath(IProgressMonitor monitor) throws CoreException {
try {
monitor.beginTask(NewWizardMessages.ClassPathDetector_operation_description, 4);
fMonitor= monitor;
fProject.accept(this, IResource.NONE);
monitor.worked(1);
ArrayList<IClasspathEntry> cpEntries= new ArrayList<IClasspathEntry>();
detectSourceFolders(cpEntries);
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
monitor.worked(1);
IPath outputLocation= detectOutputFolder();
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
monitor.worked(1);
detectLibraries(cpEntries, outputLocation);
if (monitor.isCanceled()) {
throw new OperationCanceledException();
}
monitor.worked(1);
if (cpEntries.isEmpty() && fClassFiles.isEmpty()) {
return;
}
IClasspathEntry[] jreEntries= PreferenceConstants.getDefaultJRELibrary();
for (int i= 0; i < jreEntries.length; i++) {
cpEntries.add(jreEntries[i]);
}
IClasspathEntry[] entries= cpEntries.toArray(new IClasspathEntry[cpEntries.size()]);
if (!JavaConventions.validateClasspath(JavaCore.create(fProject), entries, outputLocation).isOK()) {
return;
}
fResultClasspath= entries;
fResultOutputFolder= outputLocation;
} finally {
monitor.done();
}
}