Alternate package explorer view - eclipse

I was experimenting with my eclipse setup trying to find a better way to browse through my projects packages and classes and I found the perfect view...then lost it😭.
I've tried every view but I can't get it back. It was like package explorer but it appeared above the code editor and it contained separate views for projects, packages, and classes. You could click on the leftmost box containing the project, then the middle box would populate with the packages within, then you could click on the package and the right most box would populate with the classes within.
My best guess is it's a way to customize the project explorer or package explorer but I can't seem to figure it out.
I want to say when I found it I was experimenting with working sets but I could be wrong.
Thanks for any help in advance!

Related

Why does Eclipse project explorer shows complete path on every level

Directly after the upgrade to the latest version of Eclipse (4.23) the project explorer behaves abnormal. It shows the complete package path on every package hierarchy level.
The first image shows the abnormal view the second the expected view. As you can imagine with many hierarchy levels the view becomes quite confusing.
I've tried to change the package presantation, the project presentation and almost all other options in the project explorer view menu to no avail.
I assume this is a bug and will be fixed. Maybe someone has a workaround?

How to make child packages in packages on Eclipse?

I have recently started coding on Eclipse for Minecraft Bukkit plugins, and I have been going fine with it. Recently, I've been trying to make a child package into a package, but if I try New > Package, then it makes a package separate to my main package. I am a beginner, so please make instructions simple. Is there anything else I can try?
Normally, if you separate each package component with dots (.), it should create intermediate entries.
Try create a new package with the following test case:
com.foobar.example
com.foobar.test
com.foobar.example.a
And Eclipse should do the tricks.
If however, you are stuck with finding those empty packages, perhaps you should simply play with the Package Explorer options: the Java filters is especially useful, and there might be an option enabled by default which would filter/hide empty package.
You also have Package presentations.
Since an image is better than long lines of text:
Click the arrow to open the presentations options (see the Package Explorer on the left)
The Filters options does have filters which might hide empty parent packages.
The hierarchical package presentation behave like the Explorer left pane.
When creating a new package you can create a hierarchy by simply separating your parent folder with child folder with a dot '.'. So if you want to create a sub package of foo.bar you have to create a package with name foo.bar.myfoo. Eclipse will do the rest.
If you instead want to visualize the folder type hierachy as here:
you can click in the little arrow top left of the project explorer view menù and go to Package Presentation > Hierarchical.
A folder-like hierachy is implicitly created by the package names in Java. Lets say you have a package com.company and you want a sub-package in that package. Then you have to create a package with the name com.company.product. It is not done by creating a package with the name product while com.company is selected!
For eclipse Version: 2019-03 (4.11.0) Build id: 20190314-1200
I found it easier to create the desired package path along with the new class I wanted to exist at the new package path.
From within the Project Explorer view, right click on the corresponding project to create a New Class.
Then on the class creation popup I fill in the corresponding package field as I please to build out the new path as desired, along with the new class to sit in that new path.
For Eclipse Version 2020-09:
To create sub-package we can directly go inside the eclipse-workspace and in the package where we want to create a sub-package and inside that we can create a new folder and then click on the three dots icon on the right side of the Package Explorer and select the Hierarchical option inside the package presentation option. We can then refresh the project and the new sub-packages will be reflected.Below is the image for reference
Subpackage

PyDev: project not visible

I was using PyDEV without issue but recently when I create a project in Eclipse the project is not visible in the PyDev perspective but is visible in the Java perspective. My project is a python project. It seems that the perspectives are a little mixed up.
Is there a way to fix this?
My solution was:
Going to PyDev Package Explorer
Click View Menu button (arrow pointing down, top left area of the Package Explorer panel)
Top Level Elements
Click Projects
Maybe you added some filter which is hiding it in the PyDev package explorer?
I.e.: have you tried going to the PyDev package explorer filters (in PyDev package explorer > Ctrl+F10 > Customize View).
Or maybe you set the top-level to working sets and don't have a working set on PyDev? (i.e.: Ctrl+F10 > top level elements)
Or maybe you selected a working set which has nothing? (i.e.: Ctrl+F10 > select working set)
I know this is an old question, but I've had to deal with this specific problem in Eclipse 4 Luna, and I have an idea for what's wrong.
Use Package Explorer instead of PyDev Package Explorer.
The native Package Explorer, when in working set view, appears to automatically create and populate the working set "Other Projects." PyDev's explorer does not appear to do this, at least not on my default Luna installation. As well, PyDev's assignment of projects to working sets appears broken on Eclipse 4 Luna, so users of PyDev Package Explorer may have trouble finding their projects between views.
Enable Package Explorer:
- Window -> Show View -> Package Explorer
If Package Explorer not in menu:
Window -> Customize Perspective
Click the Menu Visibility tab.
Expand Window
Expand Show View
Find Package Explorer and put a check in it.
OK
Click Window then Show View, choose Package Explorer and rejoice.
I hope this helps at least one of you. I'm terribly new to Eclipse, and it is probably the single most unfriendly thing I've ever had to use. Good luck!
I had the same problem. Newly created projects did not show up. This is what brought me to this question. While looking at the answer provided by #alecor_Dev, which does not answer to the question, at least in my case, I managed to solve mine.
If you have a working set created and selected new projects will not show up. The easiest way to test is to go to:
PyDev Package Explore->View Menu button (pointing down)-> Deselect Working Set.
If you has a working set but more projects in that workspace more projects will show up.
If you want to keep the view clean you can go back to your working set but add the new project by editing the working set:
PyDev Package Explore->View Menu button (pointing down)-> Edit Active Woking Set.
And click on the project you want to add or remove.
I hope that this will help other with similar issues. While working set are a convenient way to declutter the view, can add to confusion.
I Suggest to #Fabio Zadrozny to add some visible way of marking that we are working inside a working set.
I hope that #medPhys-pl can confirm this although he moved to LiClipse. Obviously, there can be other causes that can create this kind of behaviour, but the initial description of the problem seems very similar to mine and I hope that it will solve other people's issues.

How to add views to Show In menu for particular file types

I use an older plugin called Veloeclipse for editing Velocity templates in Eclipse. There's been no development on this since 2009, which isn't a problem because it's mainly just for syntax highlighting and format validation. The really annoying thing about it, however, is that when I try to do Show In to view the current Velocity template within my Package Explorer or Project Explorer, the only available option is Properties. That's not really useful. I really need to be able to get to the file in one of the regular explorer views.
So I have sort of two questions:
Is there a way to configure this without having to monkey with any code? A configuration file or something? I've grepped through my Eclipse installation and haven't seen anything, but I'm hoping that there's something I'm missing.
So assuming that the answer to my first question is no, how do I go about modifying the plugin code so that it will show more than the Properties view in the Show In menu? Most of what I found on the plugin development wiki comes from the other direction: how to make your view or perspective appear in the Show In menu.
Any help with this would be hugely appreciated!
Try to check the plugin source code. it might do something different than other editors. What I mean is that the show in menu item that you have there is not the usual extension point but a hard coded context menu option.

how to access package explorer element in eclipse plugin

i am making an eclipse plugin which make a ui on right clicking a project in eclipse workspce . the ui contains text fields , package explorer for the current project and directory explorer for current project.
i have successfully made a ui which appears on clicking a menu item on right clicking the project but it seems i can't make any jface or swt ui since they are not visible when we are using eclipse command hadlers .so in order to overcome it i made dialog pages but they have limited dialog like directorty dialog and file dialog and that too for entire window directory..... but i want package explorer and directory explorer for the project i just chose like it happens when u try making a new class in a project the browse buttons just show packages and directory struture w.r.t to current selection
am i doin things wrong or is there a way out please suggest .....
It seems a bit unclear to me, what the 'UI' is about. If you plan to embed the package and directory views inside a dialog next to each other, then I think you have to build similar lists on your own, since they are views with their own event logic. But if you plan to use them via the browse buttons as describes, take a look at this page. It gives a good overview of the available selection dialogs in eclipse.
It is also always a good practice to search for code in eclipse that does nearly the same you want to do.
As an example, take a look at the new class wizard from the jdt.ui plug-in (This is the wizard you mentioned in your question): Press Cmd-Shift-T and begin typing 'newclass' and open NewClassWizardPage from org.eclipse.jdt.ui.wizards. This works as expected if you imported all jdt plug-ins as (binary) projects.
Take a look at the createControl method and dive into the createXXXControls methods via F3 and try to find out how JDT is doing the job.
As an alternative, open the desired selection dialog class (again with Cmd-Shift-T) and open the call hierarchy of that class...