本文整理汇总了Java中org.eclipse.pde.internal.core.util.CoreUtility类的典型用法代码示例。如果您正苦于以下问题:Java CoreUtility类的具体用法?Java CoreUtility怎么用?Java CoreUtility使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CoreUtility类属于org.eclipse.pde.internal.core.util包,在下文中一共展示了CoreUtility类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: removeContexts
import org.eclipse.pde.internal.core.util.CoreUtility; //导入依赖的package包/类
/**
* Removes the contexts for all checks of a deleted catalog.
*
* @param delta
* the delta
* @throws CoreException
* the core exception
*/
@SuppressWarnings("unchecked")
public void removeContexts(final Delta delta) throws CoreException {
final IProject project = RuntimeProjectUtil.getProject(delta.getUri(), mapper);
if (project != null) {
IFile file = projectHelper.getHelpFile(project, CheckContextsExtensionHelper.CONTEXTS_FILE_NAME);
CtxHelpModel model = new CtxHelpModel(CoreUtility.getTextDocument(file.getContents()), false);
model.setUnderlyingResource(file);
model.load();
CtxHelpRoot root = model.getCtxHelpRoot();
Iterable<CtxHelpContext> contexts = Iterables.filter(Lists.newArrayList(root.getChildren()), CtxHelpContext.class);
for (CtxHelpContext context : contexts) {
Iterable<IEObjectDescription> catalogs = delta.getOld().getExportedObjectsByType(CheckPackage.Literals.CHECK_CATALOG);
for (IEObjectDescription catalog : catalogs) {
if (context.getId().startsWith(catalog.getName().getLastSegment().toLowerCase() + "_")) {
root.removeChild(context);
}
}
}
model.save();
model.dispose();
}
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:33,代码来源:CheckContextsGenerator.java
示例2: run
import org.eclipse.pde.internal.core.util.CoreUtility; //导入依赖的package包/类
@Override
public void run() {
try {
for (IProject project : getRelevantProjects()) {
CoreUtility.addNatureToProject(project, ProductNature.ID, new NullProgressMonitor());
}
} catch (CoreException e) {
throw new RuntimeException("Failed to add nature", e);
}
}
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:11,代码来源:ProductNatureAddAction.java
示例3: createInclude
import org.eclipse.pde.internal.core.util.CoreUtility; //导入依赖的package包/类
private static IFeaturePlugin createInclude(final IFeatureModel parentModel,
final IPluginModelBase pluginModelToInclude) throws CoreException {
FeaturePlugin plugin = (FeaturePlugin) parentModel.getFactory().createPlugin();
plugin.setId(pluginModelToInclude.getPluginBase().getId());
plugin.setVersion("0.0.0");
plugin.setFragment(pluginModelToInclude.isFragmentModel());
plugin.setUnpack(CoreUtility.guessUnpack(pluginModelToInclude.getBundleDescription()));
return plugin;
}
开发者ID:secondfiddle,项目名称:pep-tools,代码行数:10,代码来源:RefactoringSupport.java
示例4: loadTocModel
import org.eclipse.pde.internal.core.util.CoreUtility; //导入依赖的package包/类
/**
* Loads toc model and sets toc.xml as underlying resource.
*
* @param uri
* the uri
* @return the toc model
* @throws CoreException
* the core exception if model could not be loaded
*/
private TocModel loadTocModel(final URI uri) throws CoreException {
IFile file = projectHelper.getHelpFile(uri, CheckTocExtensionHelper.TOC_FILE_NAME);
TocModel model = new TocModel(CoreUtility.getTextDocument(file.getContents()), false);
model.setUnderlyingResource(file);
model.load(file.getContents(), false);
return model;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:17,代码来源:CheckTocGenerator.java
注:本文中的org.eclipse.pde.internal.core.util.CoreUtility类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论