本文整理匯總了Java中org.eclipse.jdt.core.JavaCore.getOption方法的典型用法代碼示例。如果您正苦於以下問題:Java JavaCore.getOption方法的具體用法?Java JavaCore.getOption怎麽用?Java JavaCore.getOption使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jdt.core.JavaCore
的用法示例。
在下文中一共展示了JavaCore.getOption方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createProject
import org.eclipse.jdt.core.JavaCore; //導入方法依賴的package包/類
private synchronized IProject createProject(String projectName) {
final IProject project = this.workspace.getRoot().getProject(projectName);
Object cmpl = JavaCore.getOption(CompilerOptions.OPTION_Compliance);
Object src = JavaCore.getOption(CompilerOptions.OPTION_Source);
Object tgt = JavaCore.getOption(CompilerOptions.OPTION_TargetPlatform);
try {
IWorkspaceRunnable create = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
project.create(null, null);
project.open(null);
}
};
this.workspace.run(create, null);
this.projects.put(projectName, project);
addBuilderSpecs(projectName);
} catch (CoreException e) {
handle(e);
} finally {
// restore workspace settings
Hashtable options = JavaCore.getOptions();
options.put(CompilerOptions.OPTION_Compliance,cmpl);
options.put(CompilerOptions.OPTION_Source,src);
options.put(CompilerOptions.OPTION_TargetPlatform,tgt);
JavaCore.setOptions(options);
}
return project;
}