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


Java PDEProject.getManifest方法代码示例

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


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

示例1: GenerateExtensions

import org.eclipse.pde.internal.core.project.PDEProject; //导入方法依赖的package包/类
public GenerateExtensions(final IProject p) {
  try {
    this.project = p;
    final IFile pluginXml = PDEProject.getPluginXml(this.project);
    final IFile manifest = PDEProject.getManifest(this.project);
    WorkspaceBundlePluginModel _workspaceBundlePluginModel = new WorkspaceBundlePluginModel(manifest, pluginXml);
    this.fModel = _workspaceBundlePluginModel;
    IPluginModelBase sourceModel = null;
    IPluginModelBase[] _workspaceModels = PluginRegistry.getWorkspaceModels();
    for (final IPluginModelBase m : _workspaceModels) {
      if (((m.getBundleDescription() != null) && this.project.getName().equals(m.getBundleDescription().getSymbolicName()))) {
        sourceModel = m;
      }
    }
    IPluginExtensionPoint[] _extensionPoints = sourceModel.getExtensions().getExtensionPoints();
    for (final IPluginExtensionPoint ept : _extensionPoints) {
      this.fModel.getPluginBase().add(this.copyExtensionPoint(ept));
    }
    IPluginExtension[] _extensions = sourceModel.getExtensions().getExtensions();
    for (final IPluginExtension e : _extensions) {
      this.fModel.getPluginBase().add(this.copyExtension(e));
    }
    PDECore.getDefault().getModelManager().bundleRootChanged(this.project);
  } catch (Throwable _e) {
    throw Exceptions.sneakyThrow(_e);
  }
}
 
开发者ID:opcoach,项目名称:genModelAddon,代码行数:28,代码来源:GenerateExtensions.java

示例2: configureOCCIEExtension

import org.eclipse.pde.internal.core.project.PDEProject; //导入方法依赖的package包/类
private void configureOCCIEExtension(IProgressMonitor monitor) throws CoreException {
	IFile manifest = PDEProject.getManifest(project);
	String manifestContent = "Manifest-Version: 1.0\n" + "Bundle-ManifestVersion: 2\n" + "Bundle-Name: "
			+ project.getName() + "\n" + "Bundle-SymbolicName: " + project.getName() + ";singleton:=true\n"
			+ "Bundle-Version: 1.0.0.qualifier\n" + "Bundle-ClassPath: .\n" + "Bundle-Vendor: OCCIware\n" +
			// "Bundle-Localization: plugin\n" + // FIXME: require to
			// generate plugin.properties
			"Bundle-RequiredExecutionEnvironment: JavaSE-1.8\n" + "Bundle-ActivationPolicy: lazy\n"
			+ "Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport,\n"
			+ " org.eclipse.cmf.occi.core;visibility:=reexport,\n" + " org.eclipse.cmf.occi.core.ui,\n"
			+ " org.eclipse.cmf.occi.core.gen.emf.ui\n";
	manifest.setContents(new ByteArrayInputStream(manifestContent.getBytes()), true, false, monitor);

	IFile pluginXML = PDEProject.getPluginXml(project);
	String pluginContent = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<?eclipse version=\"3.0\"?>\n"
			+ "<!--\n" + " Copyright (c) 2015-2017 Obeo, Inria\n"
			+ " All rights reserved. This program and the accompanying materials\n"
			+ " are made available under the terms of the Eclipse Public License v1.0\n"
			+ " which accompanies this distribution, and is available at\n"
			+ " http://www.eclipse.org/legal/epl-v10.html\n" + "\n" + " Contributors:\n"
			+ " - William Piers <[email protected]>\n" + " - Philippe Merle <[email protected]>\n"
			+ " - Faiez Zalila <[email protected]>\n"
			+ "-->\n" + "<plugin>\n" + "\n" + "   <!-- Register the " + extensionName + " extension. -->\n"
			+ "   <extension point=\"org.eclipse.cmf.occi.core.occie\">\n" + "      <occie scheme=\""
			+ extensionScheme + "\" file=\"model/" + extensionName + ".occie\"/>\n" + "   </extension>\n" + "\n"
			+ "   <!-- Define URI mapping. -->\n" + "   <extension point=\"org.eclipse.emf.ecore.uri_mapping\">\n"
			+ "      <mapping source=\"" + extensionScheme.substring(0, extensionScheme.length() - 1)
			+ "\" target=\"platform:/plugin/" + project.getName() + "/model/" + extensionName + ".occie\"/>\n"
			+ "   </extension>\n" + "\n" + "   <!-- Register the parser for ." + extensionName + " files. -->\n"
			+ "   <extension point=\"org.eclipse.emf.ecore.extension_parser\">\n" + "      <parser type=\""
			+ extensionName + "\" class=\"org.eclipse.cmf.occi.core.util.OCCIResourceFactoryImpl\"/>\n"
			+ "   </extension>\n" + "\n" + "   <!-- Popup menu for converting to an OCCI Configuration file. -->\n"
			+ "   <extension point=\"org.eclipse.ui.popupMenus\">\n" + "      <objectContribution\n"
			+ "            id=\"" + newProjectPage.getProjectName() + ".contribution\"\n"
			+ "            nameFilter=\"*." + extensionName + "\"\n"
			+ "            objectClass=\"org.eclipse.core.resources.IFile\">\n" + "         <menu\n"
			+ "               id=\"org.eclipse.cmf.occi.core.occi-studio.ui.menu\"\n"
			+ "               label=\"OCCI Studio\"\n" + "               path=\"additionsOCCIStudio\">\n"
			+ "            <separator name=\"group\"/>\n" + "         </menu>\n" + "         <action\n"
			+ "               class=\"org.eclipse.cmf.occi.core.ui.popup.actions.ExtensionConfiguration2OCCICAction\"\n"
			+ "               enablesFor=\"1\"\n" + "               id=\"" + newProjectPage.getProjectName()
			+ ".ecore2occi\"\n" + "               label=\"Convert to an OCCI Configuration File\"\n"
			+ "               menubarPath=\"org.eclipse.cmf.occi.core.occi-studio.ui.menu/group\">\n"
			+ "         </action>\n" + "      </objectContribution>\n" + "   </extension>\n" + "</plugin>\n";
	pluginXML.create(new ByteArrayInputStream(pluginContent.getBytes()), true, monitor);

	IFile build = PDEProject.getBuildProperties(project);
	String buildContent = "# Copyright (c) 2015-2017 Obeo, Inria\n"
			+ "# All rights reserved. This program and the accompanying materials\n"
			+ "# are made available under the terms of the Eclipse Public License v1.0\n"
			+ "# which accompanies this distribution, and is available at\n"
			+ "# http://www.eclipse.org/legal/epl-v10.html\n" + "#\n" + "# Contributors:\n"
			+ "# - William Piers <[email protected]>\n" + "# - Philippe Merle <[email protected]>\n"
			+ "# - Faiez Zalila <[email protected]>\n"
			+ "\n" + "source.. = src-gen/\n" + "jars.compile.order = .\n" + "output.. = bin/\n"
			+ "bin.includes = .,\\\n" + "				model/,\\\n" + "				META-INF/,\\\n"
			+ "				plugin.xml,\\\n" + "				plugin.properties\n";
	build.setContents(new ByteArrayInputStream(buildContent.getBytes()), true, false, monitor);
}
 
开发者ID:occiware,项目名称:OCCI-Studio,代码行数:60,代码来源:NewExtensionWizard.java


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