2017-01-19 2 views
0

이클립스 3.8에서 4.6으로 마이 그 레이션해야합니다. 제 문제는 4.6 (또는 이전 버전)의 Platform.getPlugin()이 사용 중지되었으며 항상 null을 반환한다는 것입니다. 플러그인 대신에 번들을 사용한다고해서 공개 API가 손상 될 수 있습니다. 번들에서 플러그인을 가져 오는 방법이 있는지 알고 있습니까?Eclipse 3.8에서 4.6으로 마이그레이션 Platform.getPlugin()이 null을 반환합니다.

/** 
* As the org.eclipse.core.runtime.compatibility plug-in has been removed in 
* Eclipse 4.6 this method is not supported anymore. 
* 
*/ 
@Deprecated 
public static Plugin getPlugin(String id) { 
    return null; 
} 
+0

음'Plugin'은'BundleActivator'를 확장합니다. 번들의 'BundleContext'는 BundleActivator에 대한 참조를 포함하지만 액세스 할 인터페이스가없는 것처럼 보입니다. –

답변

0

물어해야 할 문제는 Platform#getPlugin(String)이되지 않는 동안, Plugin 자체가 하지 것을 지적 다음 위해 그것을 사용하고 있었는지 입니다. 번들 액티베이터 클래스가 Plugin으로 확장되는 경우 생성자 자체에 대한 참조 (ala http://git.eclipse.org/c/sourceediting/webtools.sourceediting.git/tree/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/JSPCorePlugin.java#n54)를 저장하면됩니다. 그런 다음 필요할 때 액세스 할 수 있습니다.