I am getting these strange white package icons in my testing project. From what I've seen # http://jamie.ideasasylum.com/images/icons.pdf, they signal "empty packages", but I don't know why.
My src/ folder is set is includedin the build path, so I don't get what the problem might be:
Thanks
This is most likely because you have chosen hierarchical package views. The hierarchical package view will show empty package icons for packages without any classes.
Switching to flat package views will allow Eclipse to display only packages that have classes in them.
Create at least one class in the 'empty' package 'white package' and refresh the project, the color should change to Golden.
When Package does not contain any class, then the color is white.
Related
I'm using eclipse neon. I have created a maven project and create a package com.prueba.account and then I have created many packages inside.
But eclipse shows me all packages as an independent project and without the full path like in the image. Notice that checking package is inside com.prueba.account
Just Click on the Drop Down in Project explorer. All you need is to change Package presentation from Hierarchical to Flat.
Hope it helps !!!!
First of all, welcome to Stack Overflow Gary.
Then to extend on Adyas Answer:
In Eclipse there are two ways to display the package-structure.
Hierarchical :
And Flat:
I personally find the Hierarchical view way more convenient, for when you're working on a bigger project, you often get really long package names which, when in Flat view, might clutter the whole window.
But in the end, it's up to your personal taste.
The way to change between this two modes is to click on the down arrow icon at the top of the Project Explorer and under Package Presentation you can choose between the two.
I have run into this annoyance over and over again and have been unable to find a solution or an answer here for it:
When I create a package in my application and then add a package within it, if I do not have a file in the directory already it will auto collapse my package in the left-side navigation of Android Studio. This prevents me from adding other sub-packages to the parent package, without manually resolving the issue within the file system.
For Example:
What I want is:
-presentation
-screens
-devicescreen
-adapters
-presenters
-views
In the 1:Project view, you have Hide Empty Middle Packages turned ON. You need to turn it off. Once turned off it will be shown as Compact Empty Middle Package. Please look at the screenshot attached.
With Android Studio Electric Eel | 2022.1.1 you need to switch to Project View and then click on Settings icon from the right top side and then disable Compact Middle Packages under the Tree Appearance and then you create your sub package folder it will not merge/collapse and work as a sub-package as we need.
This will prevent Android Studio to automatically collapse the package and sub-package.
Is there any way to view package dependencies in Eclipse? I seem to remember a long time ago that it was possible. I have a packageX and want to see what packages refer to it. Ie packageY references it, but not packageZ.
There seem to be some outdated plugins out there, for example Java Dependency Viewer, but the comments for the plugin say 'don't bother'.
If you mean a java package, there is a possibility: You right-click the package in the project explorer, select References → Workspace and get ... a list of almost no results.
Then you go into the search menu (the small triangle ▿ at the top right border of the search view), select "filters" and uncheck the "imports" box. Then all references to your package within your workspace should appear in the view.
Is it possible to fix all the package names in a given folder in IntelliJ?
If files are manually imported into IntelliJ, and their package names are all wrong (including the sub-folders), how can I mass fix the package names?
This has caused me a lot of grief so far....
moving to a package or renaming a package
This has to be a bug.
Example:
If I am on a package in the project explorer, and rename the package, say it is:
com.example.xml.xml
Now I want to change this (and all the files under it) to:
com.example.xml
I can't seem to do it!
When it says "rename package com.example.xml.xml to":
If I enter "com.example.xml" it won't work. I'm not sure what it is going on, I have spent a over an hour trying this as I have more files to import/fix.
It seems you can't change a full package name like this one: "com.example.xml.xml", but you can change each fragment, for that you can go to "View Options" (a little wheel) in the project view, disable "compact empty middle packages" options, and do something like renaming the second "xml" from the end, so the final package could get into something like:
com
-example
-bar
-xml
Then you can drag and drop all contents in the last "xml" to "bar" package and finally delete the last "xml". In your case it seems you won't need to rename the package just move the contents
In project view change layout to Flatten packages. Then in same menu unselect Hide empty middle packages. Then create the new package you want. And then using drag'n'drop move the root package which contains your code to a newly created package (when the pop-up appears, select the second option, i.e. move everything ...). Delete old, unused packages
I am facing this weird problem ..When i checked out project from svn my whole project was in directory kind of structure
ie. my package was like (folder inside another folder)
MainProject
+
+
+++project_1_name
++++++++src
++++++++++++com
++++++++++++++companyname
++++++++++++++++++ClassName
+
+++project_2_name
++++++++src
++++++++++++com
++++++++++++++companyname
++++++++++++++++++ClassName
but i want it to be like
MainProject
+
project_1_name
+++++src.com.companyname.className
project_2_name
+++++src.com.companyname.className
when i am importing a particular sub project from the main project separately on my workspace then the project is appearing as package structure as i see..I am using eclipse for the first time ..Kindly pardon me for asking some thing stupid like this ..But please help me
thanks in advance
The structure/folder hierarchy is as expected, a java package is a folder.
In Eclipse, Package Explorer, click on a small arrow-like icon pointing downwards and select Package Presentation 'Flat' or 'Hierarchical'.
Possibly you would like to have 'Flat'.
Do you mean you want the Package Explorer view instead of the Navigator view?
Window > Show View > Package Explorer
Or maybe you want the Project Explorer view:
Window > Show View > Project Explorer
Either of those views has a "flat" and a "hierarchical" package style. The "flat" package style sounds like what you want.
When you import projects from SVN, after selecting the base url, you should check the "find projects in the children of the selected resource" box.