Search in particular Eclipse project - eclipse

Is there any way to specify a project, where you want to search?
It's been annoying me for a long time. Like when I hit Ctrl+H to search, the only scopes available are:
Workspace
Selected resources
Enclosing projects
Working set
So, the only 3 ways I see to perform a search in particular projects are:
Open a file from the required project, hit Ctrl+H and choose Enclosing projects scope
Add required project to Working set, and perform search on this set.
Select a project in Project Explorer and search in Selected resources
All of these methods are not always convenient.
Sometimes, I just want to manually specify projects, where the search is to be performed
Edit:
The last option is not good for 2 reasons:
1) I usually have "Link with editor" option on, which associates currently opened file with corresponding item in Project Explorer. Our project is quite large, so usually I would have to scroll all the way up to collapse the selected project to make others visible.
2) Also, Project Explorer is not reachable when I'm working in another perspective, such as Debug for example (I know I can add it through Window->Show View, but that just breaks the essence of perspectives).

Related

How to make eclipse (neon 2) work better with goovy/grails?

Some time ago I edited a node project in grails. Now every project, even if it has nothing to do with node, shows 5 node files when I do "new" to create a new file. (type script, node project file etc).
I now only have a grails 3 projects in Eclipse, with the usual groovy eclipse plugins installed.
When I want to create a new groovy file (e.g. a domain object, controller etc), I go to file->new, and I only see the 5 node entries, plus a few generic ones.
Is there any way to make it show "groovy class" in the new list, and not show the node related ones?
I thought facets might be for this, but my project has no facets configured (and eclipse still thinks its node), and there are no grails/groovy type facets).
Any suggestions? Not a show stopper obviously.
E.g. can I create my own facet without coding, or can I influence which file types appear on create new by project?
I could open up a DOS command box and do the grails command to create the classes, but his is more work, especially as it creates broken tests which have to be manually deleted after (until such point as we need tests)
Intellij ultimate is unfeasibly expensive, so that is not an option.
You should be able to customize what appears in the New drop-down using Window > Perspective > Customize Perspective.... In the dialog that comes up, click the Shortcuts tab and you can check or uncheck items that will show in the New drop-down.
You can also edit what options will show for the Show View and Open Perspective sub-menus from here.

How to make Eclipse ignore some files during lookup?

In Eclipse, there is the option to lookup a specific file by going to Navigate > Open Resource. Once the popup open, you can type to search for a file in the project. Is there any way to make this lookup ignore some files and not show them?
This is only possible to do by "inclusion" (that is, telling Eclipse which files to include during the search), not by "exclusion" (telling Eclipse which files to exclude).
In the "Open Resource" dialog, notice that there's a small down-pointing arrow at the top right. From there, you can select the Working Set which will be considered during the search. You can define the working set as the collection of resources to consider during search; only resources that are contained within the working set will be shown.

sorting files by date in project explorer in eclipse juno

Is it possible to show files in package explorer in the order of date they were created? I am using eclipse juno and I couldn't find any customize option in view menu of the project..
Currently the package explorer shows items in alphabetic order which cause me to search through the files to find the last modified project or java file. Can someone help?
I'd comment if I could to ask for clarification but don't have enough points...
I assume you don't have a team repository or you would have enabled its label decorations, which I know is available in svn. Label decorations will show the team metadata associated with the files. It won't have them sorted but with a small set, you can scan them manually.
In order for this to be useful with a large set, the sort would have to be across all folders/packages. You could open up file explorer(assuming windows os), to the project folder, perform a search with filter of 'datemodified:'. Now you may have to remove the semi-colon and add it again, hit enter. That would sort the folders by date, then the files by date..across all folders.
Its ugly but it works (as far as I understand the question). Good luck.

How do I Ignore the build folder in NetBeans 'Find In Projects'?

Anyone know how to ignore the build folder when doing a 'Find in Projects' on NetBeans (v6.9.1).
Currently the Search results pane shows all results from src folders but also those from the build folder so if your project contains a lot of JSP files for example, many results are duplicated...
I think I've figured out how to ignore the build folder of projects when doing a 'Find in Projects' in NetBeans 6.9.1:
Go to Tools->Options-Miscellaneous.
Click the Files tab.
In Files Ignored by the IDE, edit the Ignored Files Pattern
regular expression and include the build folder. For example, on
my system I simply added build thus:
^(CVS|SCCS|vssver.?\.scc|#.*#|%.*%|_svn|build)$|~$|^\.(?!htaccess$).*$
Click OK to save the options and close the dialog.
(Nerd Note: Took me exactly 1 year to the day to figure this out!)
You may be able to get similar behavior with a multiple node selection search.
From the 'Files' Window (Found in the Window/Files Menu), expand all
of your projects and select all of them with a Ctrl+A (PC) or
Command+A (Mac).
Then with Control(PC) or Command(Mac) key held down, click the
folders that you don't want to search.
Finally, use Ctrl+F(PC) or Command+F(Mac) to open a search, enter the
text you're looking for, and then choose 'Selection ( # nodes)' under
the Scope where the '#' symbol is the number of folders you just selected.
It is a little more manual than applying a filter, but you should be able to better control your results.

Excluding/Disabling Validation in Eclipse

I have the (mis)fortune of having a large project source-base in which I am working primarily on PHP and JavaScript. I have to have the full project area as the project root in Eclipse, but unfortunately this includes several directories that drive the validation built into WST/DLTK/etc. nuts.
I have tried disabling all validators in the project properties. I have gone into the validators one at a time and added rules to the "Exclude Group" set to exclude the specific folders. I have removed the folders from the PHP build path in the project properties. And yet, my Problems view/tab is still littered with thousands of red flags that stem mostly from a folder that we use to keep copies of external elements (Apache, PHP, etc.). You know, typical "have a copy of the specific versions we currently use" sort of thing.
The signal-to-noise ratio is so bad that I'm unable to use the view at all, which is a shame. If I'm not going to have the benefits of the IDE, I might as well be using vim for this (I use it for other stuff, but for this codebase a good IDE is a better choice, providing I can get it to work). It seems to me that it would be an obvious feature to be able to right-click a folder in a project and select "Exclude from Validation", but alas there is no such feature. Is there another way to get the validators (PHP, HTML, etc.) to ignore the folders I need ignored?
Tried solution;
Right click project
Select properties
Select validation
Check Enable Project specific settings
On the XML Validator row, click the '...' button
Select Exclude Gruop
Click Add rule
Select 'Folder or file name'
Click Next
Select files or folder which are not validated.
Click Finish
Click OK
Click OK
This solved my problem. Because eclipse validation gives error for generated GWT files.
Best regards.
I came upon this question while looking for the same answer. I will list the steps I did here and hopefully it will help someone in the future.
I am using Eclipse 4.1 and I do the following to exclude validation for specific xml files. I am sure if you configure the different validators it will work for other files as well.
Go to Preferences -> Validation
Find the Validator you wish to change and select settings (not all of the validators have settings, hopefully yours do).
In the settings you can add an Exclude Group where you can add a rule to specify to exclude the validator for specific extensions, folder or file name, project nature, facet or content type.
I have Eclipse for PHP Developers and I was dealing with the same issue.
In addition tot he excellent answers above, I have one more suggestion.
My first recommendation is not to use Aptana unless you actually want those validators (as they are nearly impossible to turn off from my experience).
Beyond that, go to File -> Properties -> Builders, and deselect "Validation" and "Script Builder" and "JavaScript Validator".
So far it's helped speed up some operations tremendously.
I also recommend disabling "Automatic Build". Because you're using PHP, the odds that you actually need it to build anything if you don't want validation is slim.
In the main menu, go to Project and uncheck "Build Automatically". You will want to build your project every now and then by right clicking on the project and selecting "Build Project".
All the above steps have helped me get the basic editor, which is exactly what I wanted.
I used to exclude resources from validation via project specific Exclude Group (as the most answer here suggests). But in case anyone is still having problems with disabling validation for a specified folder in 2014 - just mark the folder resource as Derived:
This should disable validation for that folder.
If you are using EGIT you might also want to disable automatic inclusion of derived resources in .gitignore:
It is not really possible to select a directory, at least under Windows.
After having pressed Preferences->Validation->Settings->Add Exclude Group->Add Rule->Folder or filename->Browse Folder->(selecting some directory)->[OK]
The "Browse for folder" dialog is being closed, with the "File or folder" field staying empty.
I had the same problem with the web app i'm developping.
I ended up disabling automatic build, and building once a day (Project->Build automatically), that way i still get the benefits of code completion from libraries, while speeding up the program on older computers.
I found in the project properties there is a Builders category. In the list of builders I had a JavaScript Builder. I deselected this builder and all my annoying javascript validation woes went away.
this worked for me:
Properties > Builders section and unchecking the corresponding box. https://bugs.eclipse.org/bugs/show_bug.cgi?id=317833
seems to be a bug in some versions of eclipse.
There are more gloabal validation parameters. You can suspend all validation (or only the ones you don't need) by going to:
Window > Preferences > Validation.
Here, check the box "Suspend all validators".
Alternatively, uncheck the validators you don't need from the list below.
A full build will be requested which might take some time. But Eclipse will run a lot faster afterwards [But without validation of course]
http://www.flickr.com/photos/jesuspresley/5094048124/
Solution.
Go configure what's displayed in the Problems View like lothar proposed, create new custom filter and in "Scope" area choose "On working set". Now press the button right below this option to configure what working set would it be: in working set selection pop-up hit the "New" button and mark all your project files EXCEPT those you want to exclude from validation. You might want to save this working set under convenient name, like "No_Validation_Set".
Summary:
1) working set excluding problematic files.
2) custom Problems View filter to operate on this set.
Issues:
when adding new files to project you need to update your working set, so they are validated too.
When I excluded files from validation for the project, my setting didn't seem to be recognised until I restarted Eclipse and cleaned the project.