Eclipse 3.7 (Indigo)을 사용 중이며 활성 대상 플랫폼에 정의 된 디렉토리를 추가하는 플러그인이 있습니다. 다음과 같은 메시지를 보여주는, 더 이상Eclipse에서 대상 플랫폼에 동적으로 디렉토리 추가
ITargetPlatformService service = (ITargetPlatformService) PDECore.getDefault().acquireService(ITargetPlatformService.class.getName());
ITargetDefinition target = service.getWorkspaceTargetHandle().getTargetDefinition();
IBundleContainer[] bundles = target.getBundleContainers();
String myDirectory = "C:\\directory";
boolean containsMyDirectory = false;
for (IBundleContainer bundle : bundles) {
if (bundle.toString().contains(myDirectory.toString())) {
containsMyDirectory = true;
break;
}
}
if (!containsMyDirectory) {
bundles = Arrays.copyOf(bundles, bundles.length + 1);
bundles[bundles.length - 1] = service.newDirectoryContainer(myDirectory.toString());
target.setBundleContainers(bundles);
service.saveTargetDefinition(target);
LoadTargetDefinitionJob.load(target);
}
하지만 지금, 우리는 4.4 (루나) 이클립스 마이그레이션하고 있고 코드가 컴파일되지 않습니다 : 가져 오기 org.eclipse.pde.internal.core.target.provisional 확인할 수 없습니다
수입품를 해결할 수없는했다 :
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;
이클립스 3.7에 사용 된 항아리 org.eclipse.pde.core_3.7.1.v20120103_r372.jar이며, 이클립스 4.4은 조직 .eclipse.pde.core_3.10.0.v20140519-1409.jar
이전 클래스를 대체 할 클래스를 찾을 수 없습니다.
아무도 모르는가요?
그리고 더 이상 존재하지 않는 ITargetDefinition.getBundleContainers() 및 ITargetPlatformService.newDirectoryContainer (String) 메서드는 어떻습니까? – hbelmiro
죄송합니다. 기존 API를 최종 API로 변경 한 방법을 확인하려면 이전 소스 및 새 소스를 살펴 봐야 할 것입니다. –