質問

for example my View has an id

public static final String ID = "examplePlugin.views.SampleView"

How do I get an instance of this View (or any other thing in eclipse ) by id ?

役に立ちましたか?

解決

For views you use methods on the current workbench page IWorkbenchPage. You can find the page with:

IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();

(this must be called from a plugin with the workbench running).

You can find an existing view with:

page.findView(id);

and create and show a view with:

page.showView(id);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top