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


Java IExecutionEnvironment.getId方法代码示例

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


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

示例1: getExecutionEnvironmentCompliance

import org.eclipse.jdt.launching.environments.IExecutionEnvironment; //导入方法依赖的package包/类
public static String getExecutionEnvironmentCompliance(IExecutionEnvironment executionEnvironment) {
	Map<String, String> complianceOptions= executionEnvironment.getComplianceOptions();
	if (complianceOptions != null) {
		Object compliance= complianceOptions.get(JavaCore.COMPILER_COMPLIANCE);
		if (compliance instanceof String)
			return (String)compliance;
	}
	
	// fallback:
	String desc= executionEnvironment.getId();
	if (desc.indexOf(JavaCore.VERSION_1_8) != -1) {
		return JavaCore.VERSION_1_8;
	} else if (desc.indexOf(JavaCore.VERSION_1_7) != -1) {
		return JavaCore.VERSION_1_7;
	} else if (desc.indexOf(JavaCore.VERSION_1_6) != -1) {
		return JavaCore.VERSION_1_6;
	} else if (desc.indexOf(JavaCore.VERSION_1_5) != -1) {
		return JavaCore.VERSION_1_5;
	} else if (desc.indexOf(JavaCore.VERSION_1_4) != -1) {
		return JavaCore.VERSION_1_4;
	}
	return JavaCore.VERSION_1_3;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:24,代码来源:JavaModelUtil.java

示例2: getExecutionEnvironmentCompliance

import org.eclipse.jdt.launching.environments.IExecutionEnvironment; //导入方法依赖的package包/类
public static String getExecutionEnvironmentCompliance(IExecutionEnvironment executionEnvironment) {
	Map<String, String> complianceOptions= executionEnvironment.getComplianceOptions();
	if (complianceOptions != null) {
		Object compliance= complianceOptions.get(JavaCore.COMPILER_COMPLIANCE);
		if (compliance instanceof String)
			return (String)compliance;
	}
	
	// fallback:
	String desc= executionEnvironment.getId();
	if (desc.indexOf(JavaCore.VERSION_1_7) != -1) {
		return JavaCore.VERSION_1_7;
	} else if (desc.indexOf(JavaCore.VERSION_1_6) != -1) {
		return JavaCore.VERSION_1_6;
	} else if (desc.indexOf(JavaCore.VERSION_1_5) != -1) {
		return JavaCore.VERSION_1_5;
	} else if (desc.indexOf(JavaCore.VERSION_1_4) != -1) {
		return JavaCore.VERSION_1_4;
	}
	return JavaCore.VERSION_1_3;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:22,代码来源:JavaModelUtil.java

示例3: findBestMatchingEE

import org.eclipse.jdt.launching.environments.IExecutionEnvironment; //导入方法依赖的package包/类
private IExecutionEnvironment findBestMatchingEE() {
	IExecutionEnvironmentsManager eeManager= JavaRuntime.getExecutionEnvironmentsManager();
	IExecutionEnvironment[] ees= eeManager.getExecutionEnvironments();
	IExecutionEnvironment bestEE= null;
	String bestEECompliance= null;
	
	for (int i= 0; i < ees.length; i++) {
		IExecutionEnvironment ee= ees[i];
		String eeCompliance= JavaModelUtil.getExecutionEnvironmentCompliance(ee);
		String eeId= ee.getId();
		
		if (fRequiredVersion.equals(eeCompliance)) {
			if (eeId.startsWith("J") && eeId.endsWith(fRequiredVersion)) { //$NON-NLS-1$
				bestEE= ee;
				break; // perfect match
			}
			
		} else if (JavaModelUtil.isVersionLessThan(eeCompliance, fRequiredVersion)) {
			continue; // no match
			
		} else { // possible match
			if (bestEE != null) {
				if (! eeId.startsWith("J")) { //$NON-NLS-1$
					continue; // avoid taking e.g. OSGi profile if a Java profile is available
				}
				if (JavaModelUtil.isVersionLessThan(bestEECompliance, eeCompliance)) {
					continue; // the other one is the least matching
				}
			}
		}
		// found a new best
		bestEE= ee;
		bestEECompliance= eeCompliance;
	}
	return bestEE;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:37,代码来源:ReorgCorrectionsSubProcessor.java


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