Eclipse View Open location - eclipse

I have a view that can be opened multiple times containing different data. I added a placeholder for the view in a folder that is below the editor area. The first instance of the view opens in the proper location but if I open a second version of the view it opens to the right of the editor. Is there a way to have all views of this type open in the folder below the editor like the first one does? Do I have to add multiple place holders? Even when I close the first instance of the view and open another instance of it, the new view opens to the right of the editor.
The views differ by the secondary id that populates the view based on that id.

Related

How to toggle between split layout with multiple editors and just one editor using the full screen in vscode?

After working in a multiple column layout it is nice to be able to focus on one file momentarily using the entire application space. Then, returning to a column view.
In Slick-Edit this is Window / Zoom Toggle.
In VSCode, moving between multiple columns to 1, and then back to multiple loses editor groupings.
My approach for this scenario is using CMD+KO to Open Active File in New Window. If you close the window the file will still be present in your editor group.
There are some hiccups: I prefer a maximized window over full screen mode, but that will open a new, non-maximized window. In full screen you can prevent that, but will have to use CMD+W twice to get back to original view.

How to prevent VSCode from opening same file multiple times?

Assume you have index.js and service.ts in the side explorer. When I click on index.js, it opens in a view A. Then I open service.ts in a separate view B right to the first one and keep the focus in B and then click on index.js in the sidebar, it also opens in B. Can VS Code be configured such that instead of opening the file again, it switches to the already open one?
Additionally, if I really want the file open twice, I could open it a second time by double clicking it or dragging it to the view where it isnt present already.
If I understand correctly, try this setting set to true:
"workbench.editor.revealIfOpen": true,

Adding a view to a folder in perspective - runtime

I want to achieve something during run time.
I have a customized editor plugin. Now, what I want is whenever someone opens this editor, there should be a view displayed in bottom folder no matter what the current perspective is.
What I meant from above is, say currently "Java" perspective is shown on active page , so whenever someone opens my custom editor, I want to add a view in bottom folder(where we see "Problems" tab). Similarly, for any current perspective, my view should get rendered as soon as my custom editor is opened.
I know about initial layout and adding a place holder view, but I can not add place holder to each and every perspective. I want this to work for any perspective opened.
Can someone please suggest workaround for this ?
Thanks in Advance !

Programmatically open a view eclipse view

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?
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.

How to open an eclipse view to Right Side Only

I have an eclipse view and whenever I open that view, I want it to default open in Right Side of the eclipse.
How to make this possible
while being in an eclipse perspective place the views in the locations you want. After exiting and reopening eclipse the views will remain in the positions you placed them in the respective perspective.
If you want to programatically position your view, right away when it is opened for the first time, you can create your own perspective, adn in that perspective you either include the view in the desired location, or you include a placeholder to define where the view should appear as soon as it's opened. See API for org.eclipse.ui.IPageLayout, method addPlaceholder.
If you don't create your own perspective, you may not be able to influence where your view is initially positioned. You can only manually position the view after it had been opened, and Eclipse will then remember this location in the workspace.