當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。