How to remove *.dep files from project - netbeans

i created project from existing source in netbeans. I wonder if it is posible to exclude *.dep from files listed in project in netbeans?

You can modify global settings like this:
Menu Tools -> Options
Click Miscellaneous Button at the top of dialog.
Select Files tab under the row of buttons.
Edit the field labeled Ignored Files Pattern add |.*\.dep before the last $
Java per project instructions (because I already wrote them):
Select the project in project pane on the left.
Right click for popup menu.
Select Properties near the bottom of the menu.
Select Sources in the categories list on the left of dialog.
Click the Includes/Excludes button near the bottom-right of dialog.
Enter *.dep in the Excludes field.

Related

Eclipse Mars - imported projects don't show up in Project/Enterprise Explorer

I currently have 48 projects in my workspace. All are cloned git repos that had existing projects that were then imported into Eclipse.
The last three repos that I've imported into Eclipse have imported and migrated successfully but don't show up in either the Project or Enterprise Explorer views. I can see that they exist in the .metadata/.plugins/org.eclipse.core.resources/.projects folder.
I can search the projects and create a working set, and I can add the EAR files to the server, and I can open the files, but I can't do anything that I would normally do from the Project Explorer, including viewing their properties or deleting them.
I had thought that Eclipse might have an upper limit on how many projects could be viewed, but my co-worker says she has 107 projects currently in her workspace.
Maybe the projects are hidden by an active Working Set or by Focus on Active Task.
From the first link:
How to change Eclipse's "Project Explorer" "Filters and Customization" view settings to force projects and files and folders to show up and not be hidden, such as nested projects
Tested in Eclipse Version 2021-06 (4.20.0), Build ID: 20210612-2011 on Linux Ubuntu 18.04.
Quick Summary
Go to the "Project Explorer" tab, click the 3 vertical dots in the top-right corner of that pane, then go to "Filters and Customization...", as shown here:
Uncheck the box for "Nested Projects: hide top-level project if shown as nested" and "Nested Projects: hide folders when project is shown as nested", and click "OK":
Details
I'm having this exact problem in Eclipse Version 2021-06 (4.20.0), Build ID: 20210612-2011 on Linux Ubuntu 18.04.
It turns out it's because of the Project Explorer "Filters and Customization..." settings, as I learned from #howlger's answer.
After adding a code repository directory as a project, I can see it showing up in the deprecated "Navigator" tab, shown as "Navigator (Deprecated)" in Eclipse here (I have blurred images for privacy):
However, it does not show up in the "Project Explorer" tab, which is shown below!
The problem is that the "Project Explorer" tab's "Filters and Customization..." settings are filtering out this project and not showing it. In my particular case, that is because the project I am adding is a subrepo within another git repo, which means it is a project nested within another Eclipse project, and my view settings are mistakenly set to exclude all "nested projects". Your case or reason may be different, but in either case, if your project is not showing up in your "Project Explorer" tab, then it is likely because your "Filters and Customization" settings are set to exclude it from view.
To fix this for my case, go to the "Project Explorer" tab, click the 3 vertical dots in the top-right corner of that pane, then go to "Filters and Customization...", as shown here:
Next, click the "Pre-set filters" tab, then scroll down and uncheck the box for "Nested Projects: hide top-level project if shown as nested". I recommend you also uncheck the box for "Nested Projects: hide folders when project is shown as nested", but I'm not 100% sure what that one does, as unchecking the other box alone caused my project to show up. Here is a screenshot, with the appropriate areas highlighted in yellow:
Any of the items in this list will be hidden from view in the "Project Explorer" tab if their box is checked. So, go through the list in detail and uncheck anything else you might see fit, if applicable. I took a look and left all the rest of my view settings there as-is.
Click the "OK" button when done, and voila!--my nested and previously-added project now shows up in the "Project Explorer" view!
NB: due to some sort of bug in Eclipse, you may have to repeat the above process every time you close and reopen Eclipse. :( But, you can probably do it faster now from the "Recent Filters" section of the 3-dots menu.
Update: it looks like changing the "Projects Presentation" setting from "Hierarchical" to "Flat" blocks this bug and prevents you from having to fix the "Filters and Customization" setting every time you re-open Eclipse.
Here is how: click the 3 vertical dots menu in the "Project Explorer" window --> "Projects Presentation" --> choose "Flat", as shown below:
Other references
Here is the relevant official Eclipse documentation on this: https://help.eclipse.org/: Showing or hiding files in the Project Explorer view:
Showing or hiding files in the Project Explorer view
You can choose to hide system files or generated class files in one of the navigation views. (System files are those that have only a file extension but no file name, for example .classpath.)
On the toolbar for the Project Explorer, click the Menu button Menu button [3 vertical dots] to open the drop-down menu of display options.
Select Filters and Customization..,.
In the dialog box that opens, select the Filters tab and then select the checkboxes for the types of files that you want to hide or define your own name-based filters in the User filters tab.
In addition, you can restrict the displayed files to a working set.
On the toolbar for the Project Explorer, click the Menu button [3 vertical dots] to open the drop-down menu of display options.
Choose Select Working Set...
Select an existing working set from the list or create a new one by selecting New...
My Q&A on how to blur images in GIMP: Graphic Design: How do I do a privacy blur on a section, selection, or region of an image in GIMP?
My personal Eclipse setup document: Eclipse setup instructions on a new Linux (or other OS) computer: Troubleshooting

How to remove additional class drop down in Eclipse Project Explorer view?

In the Project Explorer view of Eclipse Luna, there's an additional drop down for Java files which represents the class inside the file (the green C icon). It expands when I double click to open a class. I don't need this there. Is there a way to filter this out?
Uncheck Preferences / Java / Appearance / "Show members in Package Explorer" checkbox.
It affect both Package and Project explorer.
Preferences windows with that checkbox
It's possible if you use Package Explorer instead of Project Explorer: go to prefs, Java, Appearance and disable "Show members in Package Explorer".
You can disable various elements in the explorer tree via the View config toolbar button (small white triangle on the toolbar just below the Project Explorer tab); select Customize View... then the Content tab; there you can disable, for example, Java Elements. But doing so will hide all Java-related elements from the Project Explorer tree; if you want that, at that point you should just use the Navigator view instead of Project Explorer. Navigator is just a file-system view of the projects.
There is an option for this. Click to three dots on the right top corner in Project Explorer window, click to "Filters and Customisation", then click to "Content" tab. You will see like that things:
Uncheck "Java Elements" (PHP Elements for Eclipse PDT) then clik to OK button. Then you will see that dropdown triangle shit goes to the hell...

How to use Eclipse to hide some java files to compile?

When I am using Eclipse, I want to know if I can use any tools so that I could hide some of my files so that they would not include in the compiling. There are many java files in the project containing the main function, so I just want to know if there are some tools which can hide some of the files.
Right-click on the project in the package explorer
Select "Build Path" -> "Configure Build Path...".
On the "Source" tab on the right you see all source directories. Expand the relevant ones (if they aren't already expanded) and select either "Included" or "Excluded" and click the "Edit" button.
Then you can either select sub-directories with "Add Multiple..." or add some patterns matching the files names you want with "Add..." in the respective sections.

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.

How do I show an open file in eclipse Package Explorer?

When a file (.java for example) is open in Eclipse, how do I get the Package Explorer to show the file that I am working on?
There is a button in the Package Explorer view that looks like two yellow arrows pointed at left and right. The tooltip is "Link with Editor". Click that.
I've found that constantly syncing package explorer with editor causes package explorer view eventually to grow too long, especially with large projects. I've instead mapped a keyboard shortcut to sync package explorer with the editor. If you are using mylyn this is of course a smaller problem.
Key mappings are available at Window ⟶ Preferences ⟶ General ⟶ Keys ⟶ Show In (Show In Target Id: Package Explorer). Mine is Ctrl+Alt+⟵, be welcome to copy.
In Luna Command name has changed a little. Instead of Show In (Show In Target Id: Package Explorer) command is now Show In (Package Explorer).
From this site:
How to use Show In functionality from the popup menu
Press Alt+Shift+W while you’re in an editor. This pops up a menu with a number of choices. The choices will vary depending on what plugins you have installed. Select the option you want and press Enter.
The fastest way to select an option is to use the first letter of the option, eg. to go to the Package Explorer, press P (you may have to do this 2 or 3 times depending on how many other options start with P). The press Enter. You could also use the arrow keys.
Invoke "Show In" faster with a keyboard shortcut
If you frequently use one of the options (eg. Package Explorer), you can map a single keyboard shortcut to invoke it.
Go to Windows > Preferences > General > Keys.
Search for Show In. Eclipse will list a number of Show In options. In
our case we want Show In (Show In Target Id: Package Explorer).
Select the command you want, enter a key in Binding and you’re done.
Always link active source file with package explorer
If you like this feature, you can open the package editor and click on the double yellow arrows to always show the currently selected source file in the package explorer.
There is a double arrow icon at the top of the Package Explorer that toggles this behaviour. click on It
In your Eclipse .java file editor, right-click anywhere, then "Show In-> Package Explorer".
As shown:
As you can see, you can also open file in Navigator, Outline and so on with this.
Above project explorer window you will see the below image in the red circle , just clicked on this one mean when clicked any file in the project will showing you in project explorer.
If you want to show only one file you can
1 - Click right on the file .
2 - Select show-in .
3 - Select show in project explorer .
4 - Done.
The below image explain more about it .