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


Java TargetBundle类代码示例

本文整理汇总了Java中org.eclipse.pde.core.target.TargetBundle的典型用法代码示例。如果您正苦于以下问题:Java TargetBundle类的具体用法?Java TargetBundle怎么用?Java TargetBundle使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TargetBundle类属于org.eclipse.pde.core.target包,在下文中一共展示了TargetBundle类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: searchFileFromBundleInfo

import org.eclipse.pde.core.target.TargetBundle; //导入依赖的package包/类
private File searchFileFromBundleInfo(ITargetDefinition def, String bundleSymbolicName, IProgressMonitor monitor)
		throws CoreException {
	File found = null;
	for (TargetBundle bundle : def.getAllBundles()) {
		if (bundleSymbolicName.equals(bundle.getBundleInfo().getSymbolicName())) {
			URI bundlePhysicalLocation = bundle.getBundleInfo().getLocation();
			if (bundlePhysicalLocation != null) {
				found = new File(bundlePhysicalLocation.getPath());
				break;
			}
		}
	}
	return found;
}
 
开发者ID:cbrun,项目名称:baseliner,代码行数:15,代码来源:PDEBaselineJarProvider.java

示例2: addComponents

import org.eclipse.pde.core.target.TargetBundle; //导入依赖的package包/类
private static IApiComponent[] addComponents(IApiBaseline baseline, ITargetDefinition targetDefinition, IProgressMonitor monitor) throws CoreException {
	SubMonitor subMonitor = SubMonitor.convert(monitor, Messages.configuring_baseline, 50);
	IApiComponent[] result = null;
	try {
		// Acquire the service
		ITargetPlatformService service = (ITargetPlatformService) ApiPlugin.getDefault().acquireService(ITargetPlatformService.class.getName());
		IApiBaselineManager manager = ApiPlugin.getDefault().getApiBaselineManager();

		// Since this method is specific to Target's and the target would have to resolve,
		// if OSGi is not running then the environment is not in a valid state and we cannot 
		// proceed.
		if (service == null || manager == null) {
			return null;
		}

		Util.updateMonitor(subMonitor, 1);
		subMonitor.subTask(Messages.resolving_target_definition);

		ITargetLocation[] containers = targetDefinition.getTargetLocations();
		if (containers == null) {
			return null;
		}

		subMonitor.setWorkRemaining(30 * containers.length);
		List<TargetBundle> targetBundles = new ArrayList<TargetBundle>(79);
		for (int i = 0; i < containers.length; i++) {
			containers[i].resolve(targetDefinition, subMonitor.newChild(15));
			targetBundles.addAll(Arrays.asList(containers[i].getBundles()));
		}

		List<IApiComponent> components = new ArrayList<IApiComponent>(targetBundles.size());
		if (targetBundles.size() > 0) {
			subMonitor.setWorkRemaining(targetBundles.size());
			for (int i = 0; i < targetBundles.size(); i++) {
				Util.updateMonitor(subMonitor, 1);
				TargetBundle bundle = targetBundles.get(i);
				if (!bundle.isSourceBundle()) {
					IApiComponent component = ApiModelFactory.newApiComponent(baseline, URIUtil.toFile(bundle.getBundleInfo().getLocation()).getAbsolutePath());
					if (component != null) {
						subMonitor.subTask(NLS.bind(Messages.adding_component__0, component.getSymbolicName()));
						components.add(component);
					}
				}
			}
		}

		IApiBaseline existing = manager.getApiBaseline(baseline.getName());
		if (existing != null) {
			manager.removeApiBaseline(existing.getName());
		}
		manager.addApiBaseline(baseline);

		result = components.toArray(new IApiComponent[components.size()]);
		if (result != null) {
			baseline.addApiComponents(result);
			return result;
		}
		
		return new IApiComponent[0];
	}
	finally {
		subMonitor.done();
	}
}
 
开发者ID:jd-carroll,项目名称:target-baselines,代码行数:65,代码来源:TargetBaselinePreferencePage.java


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