Eclipse: Show different files in each perspective?

I use Eclipse to work with several file types such as Python, Javascript and PHP. When working with Python files, I use the PyDev perspective, and also for PHP, I move on to the PHP perspective, etc.

It seems inconvenient to me that when I switch from one point of view to another, I still see that all types of files open in the main workspace.

I would prefer that when switching to Python all files other than Python are hidden and only .py files are shown. When switching to Javascript, I would like to see all hidden (open) .js files and open open .py files. Is this an existing function in Eclipse or is it what I expect to see? :) How can I implement this functionality?

+6
source share
2 answers

If you are interested in implementing this function yourself, you can use the new API that we introduced in 3.5. https://bugs.eclipse.org/bugs/show_bug.cgi?id=11001

Edit:

For example, here is a handler that hides the active editor, storing the link in the activator of the plugin until it is shown:

public class HideEditorHandler extends AbstractHandler { @Override public Object execute(ExecutionEvent event) throws ExecutionException { IEditorPart activeEditor = HandlerUtil.getActiveEditorChecked(event); IWorkbenchPage page = activeEditor.getSite().getPage(); IEditorReference reference = (IEditorReference) page .getReference(activeEditor); Activator.getDefault().getEditorManager().add(reference); page.hideEditor(reference); return null; } } 
+5
source

The only way to combine a different perspective with a different set of files is to use mylyn contexts .

The context can only show you the resources (and editors) associated with the current task.
If you also specify the mylyn task when switching perspectives, then you must restore the environment for what this task had in mind.

+2
source

Source: https://habr.com/ru/post/887899/


All Articles