Question

I want to programmatically open an eclipse view, I tried this code:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(view.ID);

It opens the view but it only instantiate it once.. I need to open a view on a double click on a file in the package explorer, the only way I found so far is opening it in the editor constructor ( a custom editor, btw if anybody knows how to open a view on double click on a file in the package explorer I'm all ears). To populate the view (tree view) I use data from a file, it works fine the first time I open it but then it does not refresh its content.

Can I perhaps access the view class object and manipulate somehow (get the tree viewer object maybe)? The perfect way to do this would be to open the view on a double click directly in the file that I need to render but I didn't find how, can anybody help?

Était-ce utile?

La solution

What you are describing is really a read-only editor. There shouldn't be any reason that you couldn't implement an editor with dummy save() and saveAs() implementations. You'd get the double-click support you want in any navigation view.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top