Netbeans - exclude .svn directories from editor - netbeans

I'm using NetBeans 6.9.1 and for some reason in the "Projects" view the .svn directories are showing up alongside the source code. How can I tell NetBeans to not show the .svn directories?
I believe it worked like this when I first installed NetBeans but somehow it's started showing the .svn directories (I likely mucked up a setting).

It is usually set up like this by default, but you must have changed it.
In the menu Tools / Options -> Miscellaneous -> Files you should have a "ignored by the IDE" pattern looking like
^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(?!lib|htaccess$).*$
This is my setting, I have added the last htaccess part to show .htaccess files in the project window.
You can see the default pattern at http://ui.netbeans.org/docs/ui/file_types_UI_spec/

Related

NetBeans doesn't show git ignore files

I can't see my project's .gitignore files within my netbeans program.
Is there a way to make them appear within the list of files? I could not find a way.
Open the NetBeans Options
Click on the 'Files' tab
Under 'Ignored Files Pattern', the default is:
^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(?!htaccess$).*$
This means that, by default, NetBeans ignores all files beginning with '.' except for .htaccess
You can update this regex to the following to also exclude .gitignore:
^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn)$|~$|^\.(?!(htaccess|gitignore)$).*$
Click OK, and NetBeans will immediately begin displaying your .gitignore files.

Some files are not openable in Eclipse IDE

For unknown reason, files of some types become not open-able in Eclipse IDE, for examples, *.txt, *.am, *.mak. When i right-click on files of those types in Project Explorer view, there is no "Open" or "Open With" menu options shown up like *.cc and *.hh. Those files types were use to be open-able within the same projects.
I confirm that the unopenable file types are associated with respective editors.
What may be wrong with my project or workspace settings?
[2013-09-30-update]
Still find no clue on why all non-c/c++ files cannot be opened by Eclipse IDE running on my Macbook :(
I imported the directories containing the files to create a project on Eclipse. The directories are mounted via Samba.
Any answer will be appreciated!!
Go to windows > preferences > general tab > editors > file associations and check your file type if its not present add them. It will be done.

Eclipse file search finds the same file multiple times

In Eclipse I have two maven projects A and B, where A is a parent for B. The directory structure is the following:
A/pom.xml
A/B/pom.xml
A/B/...
Then I use File search (Ctrl+H) to find any file in the project B. The search result window shows the file two times with different relative paths:
A/B/<my_file>
B/<my_file>
So, the same file is shown twice. Obviously, the first search result is reduntant. Is there a way to exclude these duplicate search results?
What I personally do to avoid this is marking each module in the parent project as derived (right-click on the folder > properties > Attributes: Derived).
Then when you perform a file search, uncheck "Consider derived resources" (I don't think it is checked by default) and you won't get the A/B/<my_file>.
The only inconvenience is that you must do this for each module, and each time a new module is added.
In an open resource window (cntrl+shift+R), click on the arrow on top-right and check "Filter Duplicated Resources". This worked for me.
Checking Window -> Preferences -> Maven -> Hide folders of physically nested modules (experimental) worked for me in Mars.1 Release (4.5.1).
After checking it I closed all projects within eclipse, deleted eclipse project files (.project, .classpath and .settings) and reimported my maven projects.
I had similar problem.
My solution for this problem was
Create eclipse "working set" of projects to search
Set this working set as option into search dialog
Search in it
Windows - Preferences - Maven - Hide folders of physically nested modules
I agree with Damon Horrell.
Go to Windows - Preferences - Maven - Hide folders of physically nested modules (make sure the checkbox is checked).
Note: Make sure to re-import the maven project into eclipse to see the changes.
Within the parent project, child ones were already visually hidden in my case, but still found through search and Ctrl-click links.
I solved this by using Resource filters:
Right-click (parent) project > Properties > Resource > Resource Filters
Click Add Filter..., select Applies to -> Folders and enter one child project's folder name, click OK
Repeat 2. for all child project folders
By the end, you should have something like this:
There is an ancient bug which requests Eclipse to support nested projects. Opened 2008, won't happen soon, I guess.
Since Eclipse doesn't support Maven's default nested module layout, you have to import each module individually which doesn't confuse Eclipse but it can confuse you as you can see in the search results. Similar things happen when you start to save launch configs in a module.
There are several possible solutions:
Get used to ignoring half the search results. Takes some discipline but no magic.
Make sure your root project doesn't contain anything important that you might want to open from Eclipse (i.e. move the parent POM to a new module which must be a child of the root project). Now you can close the root project.
Takes some discipline where to put things in your project and it's clumsy when you have to add new modules.
Use the flat multi-module approach. This is an extension to #2, it looks odd and there might be plugins that are offended by that. So if you use a lot of nonstandard plugins, you should check whether they like the new layout.
As a new joiner, still couldn't comment but I'd really like to add something to the best answer. It works! It not only removed the duplicate files for me (one from child module and one from parent module), it also removed the class files from parent module).
But it added the folder to my .gitignore which will cause problem for new files/directories added later. I just reverted the change to .gitignore and it still works in eclipse.
Find this answer to disable auto change of .gitignore
EGit and Eclipse modifies .gitignore file but it should not
You can solve this problem using a flat multi-module approach.
Caveats may apply if you're using the maven-release-plugin with a version control system other than Subversion.
In addition to "Hide folders of physically nested modules" mentioned, you could uncheck parent modules when importing Maven project:

How do you make NetBeans ignore files when searching for files?

In NetBeans when you go to Navigate -> Go to File you can search for files by filename. Is there a way to instruct NetBeans to ignore some files. It's picking lots of files from a tmp directory in my project which I never intend to open and it's just noise.
You can also add folders to the "Files ignored by the IDE" configuration.
Select Tools|Options and add the folder names to the regex.
NB: I have not yet confirmed that this achieves what is described.
In NetBeans 7 you go to "Project Properties" then to "Ignored Folders" and you just add your folders there.
You can configure include/exclude file patterns on a project by project basis. This feature will allow you to add an exclude pattern for your 'tmp' directory, which will stop 'Go to File' suggesting files contained in this directory.
To configure bring up the project properties (File -> Project Properties), select sources, and click 'includes/excludes' button. I.e.:
In my version of Netbeans (6.9.1 on Win 7), there is no button under Project Properties -> Source in which to enter exclusion patterns.
You have to go to Tools -> Options -> Miscellaneous -> Files and add the necessary file names or extensions under "files ignored by the IDE" in the Ignored Files Pattern field regexp.
For ignoring an entire folder, it is (in my version) on the project properties screen, but not under Sources; instead look at the "Ignored Folders" category.

How can I make Eclipse file search not include svn directories?

When I do a file search on eclipse it includes the .svn directories by default. I tried excluding them from the build path but they still appear on file search results.
Spaceman is right. With Helios, choose Project -> Properties -> Resource -> Resource Filters and then add an exclude filter for type "Folder" with name .svn.
If you install the subclipse plugin then it automatically excludes the .svn directories (plus provides some other cool stuff in the IDE).
http://subclipse.tigris.org/
If it does not work, simply restart Eclipse (sometimes it's needed on a fresh checkout)
Following up on Mark Ingram's excellent answer, simply installing the plugin won't get you there -- You'll still need to Share your project in order for the automatic Search filtering to take hold. After you set up the SVN repository location from within the Subeclipse view you may Share your project by doing the following:
From within Package Explorer, right-click the project name
Select the Team context menu option and then Share Project....
Step trough the wizard to tie your project to its location in the svn repository
Once you complete that and the workspace rebuilds you are all set to enjoy filtered search.
Excluding the .svn folders by making them derived stops then appearing in the search results, see here.
You have to do it manually for each folder, if you have a lot of .svn folders then it's not ideal.
If you are gonig down the plugin route, I tend to prefer subversive over subclipse.
Ah - OK. I don't use SubVersion per se, but would this be of any use? It claims it can do what you want...
Eclipse import would also contain file of type .java.svn-base, so its better to give as in below image
[[1]: https://i.stack.imgur.com/szDxP.png][1]
You can off course also select ALL the file name patterns to include in the file search dialog
Click on the drop-down triangle in the top-right corner of the Navigator and choose "Filters..".
By default Eclipse only offers you ".class" and ".".
If you choose ".*" you'll hide .svn files. Obviously all other .something files will also be hidden.