Eclipse - Can't View or Open Java files in Package Explorer to Editor - eclipse

I clicked something or accidentally drug a file that was open in the editor and now it is no longer displayed.
If I double click on the file in Package Explorer it doesn't show in the editor like it used to. I have looked all over and can't figure out how to get this file back in the editor.
I thought clicking File - Open File would do it but that displays an open file dialog.
Another way to simulate this is to put the cursor in the editor for an open file and select File - Close. This closes the file but then if you double click on the file in the Package Explorer it doesn't open it in the editor anymore. How do I get these files to display in the editor again?
I also tried right clicking on the file and selecting "Open". This does not display in editor either.
I also tried right clicking and selecting "Open With Java Editor". This does not work either.
If I clicke "File" and then the name of the file in the MRU list . This does not work either.
Also, double clicking a file in Package Explorer fails to open any file. The file shows in the File MRU list but does not display in editor. Can not figure this out.
Also, if I select "Back to" or "Forward to" arrows on toolbar, it tracks the file in the Package Explorer by highlighting it but the file does not display in an editor like it used to.
Also, I have tried "File Open" browsing to the physical location and selecting it but that does not display in the editor either.

I had to open a new window (Window - New Window) and then Reset Perspective (Window - Reset Perspective) to get the editor back. Not sure why but I lost some of my perspective settings doing this.

In Package Explorer, instead of double-clicking on the file, try to right-click it and you should get several "Open with..." options; choose the one that matches the editor in which you want the file to open.
Your choice will also be saved as the default, so the next times you can just double-click and it will open in that same editor.

If you are customizing the perspective, then saving perspective could be a safer option to avoid such glitches.
PFB the link on how to save a perspective:
http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2FgettingStarted%2Fqs-43e.htm

Related

save search on visual studio code

I am having a trouble with VS code. I would like to save the search results so I can get back to it again. specially since there is a lot of results and I do delete/filter them manually by clicking on x dismiss button.
I used the Open in editor, which open new tab with all results however it's not useful since I can browse the results quickly or reopen it again in the search pane.
Regards,
From I believe version 1.41 of VSCode you have a separate search editor which I guess will do what you're looking for.
Just open you command palette and search for "Open search editor". You will be presented with a couple options (open and open to the side).
When you have some search results which you want to save, you can click on the "Open in Editor" link shown next to the results summary.
This will open a text file with the similar search bar on top, and your current search results will be loaded in a text file format. You can press Ctrl-S or use File > Save to save it in a .code-search file.
You can close and re-open this file any time to view the results. You can click "Search Again" to refresh the results (note, this will lose any customization and bring back dismissed results). You can use Ctrl-click to jump to files or lines mentioned in the search results.
Unfortunately you cannot reload this back into the search pane (AFAIK). However, since Editor pane can be split, you can split this file's editor to a separate pane on the side, and close the Search pane.

VS Code editor, unlinking explorer pane and editor tabs

When I click on an editor tab the focus in the explorer pane shifts to the file in question. This seems pointless to me. Can I stop this from happening? Obviously I want to continue being able to click on a file in the explorer pane and for the relevant tab to open or come up in the editor.
You may be wondering why I want this. It's because one of my open files is way down the explorer pane list and the files I want to see in the pane are up at the top of the list.

Sourcetree - open javascript file

I try to open a javascript file from sourcetree, but it tries to execute it instead of opening the script in my editor:
Is there a way to change this behaviour?
I found a workaround. Create a javascript dummy file somewhere, then right click and select "open with..." and select your favorite editor. Then click on the checkbox so that program is always going to be used.

In RubyMine, how to preview a file's contents by selecting it like in Sublime Text?

I'm new to RubyMine 7 on Mac.
I used to use Sublime Text 3 and I love RubyMine so far except its lack of file previewing.
In Sublime Text, when clicking a file in the sidebar (file explorer), the selected file content shows in an editor tab for temporary viewing.
If I select another file, then the same tab changes to the content of the newly selected file.
I've been searching for this preference setting in RubyMine, or in a plugin, but I've had no luck.
A similar feature is "Autoscroll to source" but this feature opens files rather than previewing them.
If anyone knows how to do Sublime Text-like file content previewing in RubyMine, I'd appreciate it.
RubyMine doesn't have a feature exactly like Sublime Text file previewing.
The Quick Definition action can sometimes meet the same need. When invoked on a file, it opens a popup with the file's contents. You can invoke it on a file in the Project or Find pane and probably other panes, dialogs, popups, etc. that list files. (You can also invoke it in an editor on an identifier such as a class, module, or variable; it will show the code that defines the identifier.) Invoke Quick Definition with ⌥-space or ⌘Y in the Mac OS X 10.5+ keymap; use ^⇧I on Windows or check Preferences → Keymap for other keymaps, or use ⇧⌘A qd ⏎. Hit Escape or click outside the popup to close it.
When you invoke Quick Definition on a file in the Project pane and navigate to other files in that pane (with down and up arrows to move between files, and right and left arrows or Enter to open and close directories), the Quick Definition popup will stay open and update to the currently selected file, which is relatively close to Sublime Text file previewing. You can also hit Enter to open a file, F4 to open a file and move focus to the editor, edit the file, ⌘1 to jump back to the Project pane, etc., all with the Quick Definition popup still open, until you choose to close it.
If that isn't close enough, there are two feature requests for Sublime Text-like file previewing in JetBrains IDEs which you can vote for:
Preview currently selected file in project window
File Preview features from Sublime

Eclipse open all files in project

How can I open all source code files in a eclipse project at once? It takes too long to open all files in large projects by expanding out the packages and clicking on all the files.
I would like to know how to do this so I can ctrl+e to classes quickly.
It is not a good way to keep open all source files in a project because a project may have hundreds of source files. There is NO direct way to open all source files in eclipse.
However you can do it in two ways:
Using open resource dialog:
Create a working set which includes your project. Refer this.
Press Ctrl+Shift+R and select the your working set(Click on the downward pointed triangle button)
Type *.java in the text box. Dialog will list all java files in your project. Press Ctrl+A to select all files. Click on open button.
Using search dialog:
Select your project in Package explorer/Navigator/Projects view.
Press Ctrl+H. Go to File search tab. Leave "Containing text:" as blank. In File name patterns text box enter *.java. In scope section choose Selected resource option. Press search button. All source files will be displayed in search view.
Change the view layout of Search view to Show as list(In search view toolbar click on the downward pointed triangle button)
Press Ctrl+A to select all results. Right click and select open option.