本文整理汇总了Java中org.eclipse.pde.internal.core.project.PDEProject类的典型用法代码示例。如果您正苦于以下问题:Java PDEProject类的具体用法?Java PDEProject怎么用?Java PDEProject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PDEProject类属于org.eclipse.pde.internal.core.project包,在下文中一共展示了PDEProject类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import org.eclipse.pde.internal.core.project.PDEProject; //导入依赖的package包/类
/**
* @see IActionDelegate#run(IAction)
*/
public void run(IAction action) {
//System.out.println("OcciRegistry" + OcciRegistry.getInstance().getRegisteredExtensions()) ;
//System.out.println(" selection "+selection);
Iterator<?> it = ((IStructuredSelection) selection).iterator();
int i= 0;
String message="\n";
while (it.hasNext()) {
IProject selectedProject = (IProject)it.next();
if(selectedProject instanceof IProject) {
// Generate plugin.xml
IFile pluginXML = PDEProject.getPluginXml(selectedProject);
if(pluginXML.exists()) {
if (!(getExtensionScheme(pluginXML).equals("") || getExtensionURI(pluginXML).equals(""))) {
//System.out.println(" selectedElement "+selectedProject +" "+selectedProject.getClass());
//System.out.println(" selectedElement "+getExtensionScheme(pluginXML));
//System.out.println(" selectedElement "+getExtensionURI(pluginXML));
OcciRegistry.getInstance().registerExtension(getExtensionScheme(pluginXML), getExtensionURI(pluginXML));
closeOtherSessions(selectedProject);
i++;
message = message.concat(getExtensionScheme(pluginXML)).concat("\n");
}
}
}
}
if(i>0)
MessageDialog.openInformation(shell,
Messages.RegisterExtensionAction_ExtRegistration,
Messages.RegisterExtensionAction_RegisteredExtension
+message);
}
示例2: getPluginFile
import org.eclipse.pde.internal.core.project.PDEProject; //导入依赖的package包/类
/**
* Get the plugin.xml file of current project, returns {@code null} if no project is available.
*
* @param catalogUri
* URI of catalog
* @return the plugin.xml file or {@code null}
*/
protected IFile getPluginFile(final URI catalogUri) {
final IProject project = RuntimeProjectUtil.getProject(catalogUri, mapper);
if (project == null) {
return null;
}
String pluginXmlFilename = projectHelper.getProjectPreference(project, PREFERENCE_PLUGIN_XML_FILENAME);
if (pluginXmlFilename != null) {
return project.getFile(pluginXmlFilename);
} else {
return PluginRegistry.findModel(project) instanceof IFragmentModel ? PDEProject.getFragmentXml(project) : PDEProject.getPluginXml(project);
}
}
示例3: 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);
}
}
示例4: 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);
}