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


Java IFolder.getFullPath方法代码示例

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


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

示例1: createProject

import org.eclipse.core.resources.IFolder; //导入方法依赖的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

示例2: createTemprarySourceFolder

import org.eclipse.core.resources.IFolder; //导入方法依赖的package包/类
private IPath createTemprarySourceFolder(){
	IPath tempSrcFolder=new Path(PathConstant.TEMP_BUILD_PATH_SETTINGS_FOLDER);
	IFolder  folder=BuildExpressionEditorDataSturcture.INSTANCE.getCurrentProject().getFolder(tempSrcFolder);
	try {
	if(!folder.exists()){
			folder.create(true, true,null);
		}
	} catch (CoreException e) {
		LOGGER.error("CoreException occurred while creating temporary source folder",e);
		return null;
	}
	LOGGER.debug("Created temporary build path at "+PathConstant.TEMP_BUILD_PATH_SETTINGS_FOLDER);
	return folder.getFullPath();
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:15,代码来源:LaunchExpressionEditor.java

示例3: validatePage

import org.eclipse.core.resources.IFolder; //导入方法依赖的package包/类
public boolean validatePage() {
	setErrorMessage(null);
	if (!displayProjects)
		return true;
	if (createPackageButton != null)
		createPackageButton.setEnabled(false);
	if (fDestinationField != null) {
		ITreeSelection sl = fDestinationField.getStructuredSelection();
		if (sl.isEmpty()) {
			setErrorMessage(MessageUtil.getString("choose_a_target_folder_for_the_graph"));
			return false;	
		}
		if (!(sl.getFirstElement() instanceof IFolder)) {
			setErrorMessage(MessageUtil.getString("choose_a_target_folder_for_the_graph"));
			return false;
		}
		if (sl.getFirstElement() instanceof IFolder) {
			IFolder folder = (IFolder) sl.getFirstElement();
			String[] folders = PreferenceManager.getDefaultAuthorizedFolderForGraphDefinition();
			boolean found = false;
			for (String f : folders) {
				IFolder tmp = (IFolder) folder;
				if (tmp == null)
					return false;
				IProject project = tmp.getProject();
				IPath p = new Path(project.getFullPath().toString()).append(f);
				IPath tmpPath = tmp.getFullPath();
				if (p.isPrefixOf(tmpPath)) {
					createPackageButton.setEnabled(true);
					found = true;
				}
			}
			if (!found) {
				setErrorMessage(MessageUtil.getString("choose_a_target_folder_for_the_graph"));
				return false;
			}
		}
	}
	if (this.provider != null) {
		if (this.provider.getDefaultFileName() != null
				&& ((nameField.getText() == null) || (nameField.getText().trim().length() == 0))) {
			setErrorMessage(MessageUtil.getString("choose_a_valid_filename"));
			return false;
		}
		String value = nameField.getText();
		if (this.provider.getDefaultFileName() != null && !isValidFilename(value)) {
			setErrorMessage(MessageUtil.getString("choose_a_valid_filename"));
			return false;
		}
	}

	return true;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:54,代码来源:TemplateComposite.java


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