當前位置: 首頁>>代碼示例>>Java>>正文


Java IJavaProject.getOutputLocation方法代碼示例

本文整理匯總了Java中org.eclipse.jdt.core.IJavaProject.getOutputLocation方法的典型用法代碼示例。如果您正苦於以下問題:Java IJavaProject.getOutputLocation方法的具體用法?Java IJavaProject.getOutputLocation怎麽用?Java IJavaProject.getOutputLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jdt.core.IJavaProject的用法示例。


在下文中一共展示了IJavaProject.getOutputLocation方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getOutputLocation

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
@SuppressWarnings("unused")
private String getOutputLocation(IJavaProject project) {
	String outputLocation = "";
	IPath path;
	try {
		path = project.getOutputLocation();
		IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
		IFolder folder = root.getFolder(path);
		outputLocation = folder.getLocation().toOSString();
	} catch (JavaModelException e) {
		e.printStackTrace();
	}
	return outputLocation;
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:15,代碼來源:JimpleBuilder.java

示例2: packageChanged

import org.eclipse.jdt.core.IJavaProject; //導入方法依賴的package包/類
protected IStatus packageChanged() {
	StatusInfo status = new StatusInfo();
	IPackageFragmentRoot root = getPackageFragmentRoot();
	IJavaProject project = root != null ? root.getJavaProject() : null;

	String packName = getPackageText().getText();
	if (packName.length() > 0) {
		IStatus val = validatePackageName(packName, project);
		if (val.getSeverity() == IStatus.ERROR) {
			status.setError(Messages.format(NewWizardMessages.NewTypeWizardPage_error_InvalidPackageName, val.getMessage()));
			return status;
		} else if (val.getSeverity() == IStatus.WARNING) {
			status.setWarning(Messages.format(NewWizardMessages.NewTypeWizardPage_warning_DiscouragedPackageName, val.getMessage()));
			// continue
		}
	} else {
		status.setWarning(NewWizardMessages.NewTypeWizardPage_warning_DefaultPackageDiscouraged);
	}

	if (project != null) {
		if (project.exists() && packName.length() > 0) {
			try {
				IPath rootPath = root.getPath();
				IPath outputPath = project.getOutputLocation();
				if (rootPath.isPrefixOf(outputPath) && !rootPath.equals(outputPath)) {
					// if the bin folder is inside of our root, don't allow
					// to name a package
					// like the bin folder
					IPath packagePath = rootPath.append(packName.replace('.', '/'));
					if (outputPath.isPrefixOf(packagePath)) {
						status.setError(NewWizardMessages.NewTypeWizardPage_error_ClashOutputLocation);
						return status;
					}
				}
			} catch (JavaModelException e) {
				JavaPlugin.log(e);
				// let pass
			}
		}

		fCurrPackage = root.getPackageFragment(packName);
		IResource resource = fCurrPackage.getResource();
		if (resource != null) {
			if (resource.isVirtual()) {
				status.setError(NewWizardMessages.NewTypeWizardPage_error_PackageIsVirtual);
				return status;
			}
			if (!ResourcesPlugin.getWorkspace().validateFiltered(resource).isOK()) {
				status.setError(NewWizardMessages.NewTypeWizardPage_error_PackageNameFiltered);
				return status;
			}
		}
	} else {
		status.setError("");
	}
	return status;
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:58,代碼來源:ExportToJavaBeanWizardPage.java


注:本文中的org.eclipse.jdt.core.IJavaProject.getOutputLocation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。