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


Java PreferenceConstants.getDefaultJRELibrary方法代码示例

本文整理汇总了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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:21,代码来源:ProjectUtil.java

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

示例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;
	}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:32,代码来源:ProjectHelper.java

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

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


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