2017-01-19 6 views
0

Eclipse 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に自身への参照を保存してください。次に、必要なときにアクセスするだけです。

関連する問題