私はEclipse製品を開発しています。エディタにファイル拡張子を関連付ける必要があります。 私はいくつかの例に従いました(thisと thisなど)が、SWT OpenDocumentイベントを受け取りました。 PlatformUI.createAndRunWorkbench()
方法は、製品のファイルでEclipse RCP:ファイルの関連付け(--launcher.openFile)
public Object start(IApplicationContext context) throws Exception {
Object args = context.getArguments().get(IApplicationContext.APPLICATION_ARGS);
OpenDocumentEventProcessor eProc = new OpenDocumentEventProcessor();
Display display = PlatformUI.createDisplay();
display.addListener(SWT.OpenDocument, eProc);
try{
if(!handleWorkspace(display)){
System.exit(0);
return IApplication.EXIT_OK;
}
int returnCode = PlatformUI.createAndRunWorkbench(display, new XVRWorkbenchAdvisor(args, eProc));
呼び出されること前に
関連付け例で説明したように、私はSWT.OpenDocumentイベントを処理するためのEventListenerクラスを作成し、私はディスプレイに私のApplicationクラスでこれを追加しました私は、次のプログラムの引数を追加しました:
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-name
XVR Studio Developer
私はそれが魔法のように動作し、新しい空のRCPプロジェクトで同じコードを使用している場合...
どちらが問題なのかわかりません。
お手伝いできますか?
ありがとうございます!