java - Add a directory to a Target Platform dynamically on Eclipse -
I was using Eclipse 3.7 (Indigo) and was a plugin that added an active directory to the active target platform having had.
ITargetPlatformService Service = (ITargetPlatformService) PDECore.getDefault (). AcquireService (ITargetPlatformService.class.getName ()); ITargetDefinition target = service.getWorkspaceTargetHandle (). GetTargetDefinition (); IBundleContainer [] Bundle = target.getBundleContainers (); String my directory = "c: \\ directory"; My directory = boolean in boolean; (IBundleContainer bundle: bundle) {if (bundle.toString ()) includes (myDirectory.toString ())) {MyDirectory = true; break; }} If (My directory in it!) {Bundle = Arrays.Copyoff (bundle, bundle.lamp + 1); Bundles [bundle. Length - 1] = service. New directory container (myDirectory.toString ()); Target.setBundleContainers (bundles); Service.saveTargetDefinition (target); LoadTargetDefinitionJob.load (target); }
But now, we are migrating to Eclips 4.4 (Luna) and the code has not been compiled anymore, the following message is showing: Import org.eclipse.pde. Internal.core .target.provisional can not be resolved
Imports that could not be resolved:
import org.eclipse.pde.internal.core. Target.provisional.IBundleContainer; Import org.eclipse.pde.internal.core.target.provisional.ITargetDefinition; Import org.eclipse.pde.internal.core.target.provisional.ITargetPlatformService; Import org.eclipse.pde.internal.core.target.provisional.LoadTargetDefinitionJob;
The jar used in Eclipse 3.7 is org.eclipse.pde.core_3.7.1.v20120103_r372.jar and Eclips 4.4 in org.eclipse.pde.core_3.10.0.v20140519-1409. Jar
I did not find the classes that replaced the old people.
Does anyone know what to do?
These classes were internal , so you should not use them .
Now they are all in the < org.eclipse.pde.target
package org.eclipse.pde.core
, so they no longer have the official API Are part of.
However PDECore
is still internal so should not be used. Since ITargetPlatformService
is an OSGI service that you call it in your code ServiceReference
.
Comments
Post a Comment