Abhishek Choudhary
Abhishek Choudhary

Reputation: 8395

How to control a View on selecting particular File Type in Eclipse Editor

I want to control a view , like if I select a .js type of file , a particular view should be visible else for all other type it shouldn't. I dont want to use perspective as for just a single selection, it will be an overhead. Please suggest me any way to achieve the same through Eclipse plug-in Development.

Upvotes: 0

Views: 244

Answers (1)

Paul Webster
Paul Webster

Reputation: 10654

When you contribute the view, you either don't mention a perspective (in which case when the view is shown it defaults to the bottom right) or you use the org.eclipse.ui.perspectiveExtensions extension point to contribute it to a specific location. You can make it visible or invisible by default.

You make the view visible/invisible at runtime using the org.eclipse.ui.IWorkbenchCommandConstants.VIEWS_SHOW_VIEW command and the view ID parameter, or by using the showView()/hideView() API in org.eclipse.ui.IWorkbenchPage

See Plugging into the Workbench for more information.

Upvotes: 1

Related Questions