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

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.

Related

Eclipse search only in shared files

I often use 'File Search' in Eclipse CDT and use 'Enclosing project'. Results include matches within compilation folders that I am not interested about.
I can create a 'Working set' but I've got around 25 projects and changing the working set all the time doesn't make me work faster.
Is there a way to continue using 'Enclosing project' but filter out any file that is not coming form a repository / shared in the Team? I normally use SVN but I'd rather something that works for any file that has been shared in a repo.
Set the compilation folders as derived: right-click and choose Properties: Resource and check the checkbox Derived.
Derived files are by default excluded from the File Search (in the File Search dialog is a checkbox that can be checked if derived files should also be searched).

Eclipse: "Find All References" ignore target directory

Is there any way to limit the search for "Find all References" in Eclipse so that it ignores files in the target directory. This is not the same as the answer from this question: Limit “Find References” in Eclipse to only references from my code. That answer only works for text search. I want all references to a particular variable.
Maven Java project?
If the target folder is properly set as Default output folder in the project's properties > Java build path > Source you should be fine.
Source: just tested on Eclipse Indigo (I've tried Ctrl+Shift+G on both classes and variables); the search is limited to src/main and src/test.
Try:
Go to Window->Customize Perspective. In Command And Groups Availability tab enable Window Working Set option if not enabled. Click OK
Go to Window->Working Sets->Edit. A dialog will pop up. Click NEW button
A dialog will pop up. Select Resource option in that. Click Next Button
Click on Select All Button. Deselect the target folder. Enter the name for this working set say "Exclude target folder".
Open the source file in editor. Keep cursor on a variable. Right on that variable
Go References->Working set->Exclude target folder
By this you can also exclude some files along with folders. One drawback in this is that you have to manually deselect each and every files and folders to exclude.
Right-click and select properties and then check the derived check-box. Done.
This works for the target directory and any other directories and files you want to exclude from searches and your normal workflow since the IDE will view these derived resources as resources that are not original data, and can be recreated from their source 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.

How to place a file on classpath in Eclipse?

As this documentation says, "For example if you place this jndi.properties file on your classpath", but how can I place the .properties file on my classpath if I am using Eclipse?
Just to add. If you right-click on an eclipse project and select Properties, select the Java Build Path link on the left. Then select the Source Tab. You'll see a list of all the java source folders. You can even add your own. By default the {project}/src folder is the classpath folder.
One option is to place your properties file in the src/ directory of your project. This will copy it to the "classes" (along with your .class files) at build time. I often do this for web projects.
This might not be the most useful answer, more of an addendum, but the above answer (from greenkode) confused me for all of 10 seconds.
"Add Folder" only lets you see folders that are the sub-folders of the project whose build path you are looking at.
The "Link Source" button in the above image would be called "Add External Folder" in an ideal world.
I had to make a properties file that is to be shared between multiple projects, and by keeping the properties file in an external folder, I am able to have only one, instead of having a copy in each project.
Well one of the option is to goto your workspace, your project folder, then bin copy and paste the log4j properites file.
it would be better to paste the file also in source folder.
Now you may want to know from where to get this file, download smslib, then extract it, then smslib->misc->log4j sample configuration -> log4j here you go.
This what helped,me so just wanted to know.
Copy the file into your src folder. Go to the Project Explorer in Eclipse, Right-click on your project, and click on "Refresh". The file should appear on the Project Explorer pane as well.

Netbeans - exclude .svn directories from editor

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/