Are Eclipse warnings customizable beyond just the level - java

I am wondering if it possible to, for example, set the warning level for unused import statements on files that end in *Impl.java?
I know I can use the #SupressWarnings annotations, but the files that I want excluded are built from another project. I simply want to ignore their problems...at least for the time being.
I don't see any customizable options that would achieve this and my Google-Fu is failing me.
I assume it is simply not an available option, but I thought I would ask the experts before I wrote it off completely.
Thanks!

Go to Window > Preferences > Java > Compiler > Errors/Warnings
This menu gives you the option to choose which occurrences of events you want to treat as error/warning/not-at-all.
(There are more places where you can configure additional cases, e.g. Window > Preferences > Java Persistence > Errors/Warnings for the Java Persistence framework. To find them all use the in-menu search (top left corner in the preferences menu) and search for 'warning' or something like that.)
As far as I know it is not possible to specify any further conditions for the configuration of the warn levels.
Isn't it an option to just switch the option to 'ignore' for the time you work on this specific project?
A work around could be to have a second workspace just for that project. As eclipse saves its preferences workspace-wise this would not affect your other projects.

Perhaps keep those files in a different project. Set the project settings so it doesn't display the warnings. Than include this project in your current project. Not sure if it works and if this is what you wants but it might be a workaround.

Related

How to make IntelliJ Idea display only compiler generated warnings and supress intelligent inspections?

I am working on IntelliJ Idea 14. Is there a way out for the above?
Under "Inspections" in the Settings configuration, you can change your inspections profile to exclude the ones you don't want. Also, at the bottom right of the application window you can click on the "little guy in the hat" and turn down the inspections on a file-by-file basis.
Suppressing inspection in general may not be good idea. You could create multiple custom profiles and keep it as part of project. Create a new one called "minimum", which will have inspection that is meaningful to full team. Set that as default for project
Create another which will have much bigger set and run occasionally else where.

How to show only compiling errors in Eclipse's editors?

I participate in development very big project. Project consist on many(more than 30) Eclipse projects. Every project uses specific Eclipse setiings for validation(for example boxing/unboxing - error for these settings).
I want to see only compilation errors. I know this way:
click on project settings and select ignore error/warnings for all lines.
But for 30 project -it is very big and stupid work. Maybe are there way - faster ?
As +Sam Yonnou all but said, you need to either actually turn off the warnings you don't care about by setting the Compiler to ignore those things, or go to the Annotations preference page and disable their presentation entirely:
This page will affect all text editors, though.
In eclipse if you're worried about the warnings coming up in the Problems View, you can click the little down arrow on the top right of the Problems View, and select Show then All Errors, which will hide the warnings in the Problems View. As for hiding the messages in the source code editor, I don't know.
If I am understanding your problem correctly, then you can fix this by going to
Window > Preferences > Java > compiler > Errors / Warnings
and adjusting the settings there to fit your needs.

IntelliJ git integration tips and tricks

I actually ignored the git integration that IntelliJ has and I was recently frustrated with the diff tools that git comes with by default, I noticed how intellij has a very nice way of seeing the history for a given file, and comparing previous versions etc.
What are some cool/useful git integration tips and tricks you like with IntelliJ?
I would like to see some keyboard shortcuts, like if I am on a file, I want to quicky open up the history view or compare with the last commigted file.
Is it possible to compare commits? (not just a single file)
BTW, what diff tool does IntelliJ use by default, it's pretty good!
You can view IntelliJ IDEA's default keymap reference card to see what's available starting out.
I don't believe there is a default keyboard shortcut assigned to showing the current file history, but you can specifically assign a shortcut to show file history:
Settings → Keymap → (in the search box on the right type: "history" to narrow the options) → assign your desired keyboard shortcut to "Git: Show History"
While it is definitely possible to compare various revisions of a file from different commits, I'm not sure what else you would want to do to compare commits beyond the scope of a single file, but when reviewing commits, you can view all of the changes in the commit, showing all the diffs, one file at a time.
As far as their diff tool is concerned, I believe it was internally developed and is part of their version control featureset.

How can I add a custom warning to Java files in Eclipse?

I'd like to add a custom warning message (i.e. add an entry to the Warnings section of the Problems tab) for .java files in Eclipse.
While I've found information (here and elsewhere) on creating plugins and using markers, I haven't yet found anything which talks about extending the "problem-finding" process. Most of the articles I've found don't discuss when to create markers, only how, and those that do assume that I'm interested in attaching them to a custom build step or custom editor, neither of which seems appropriate for what I'm trying to do.
How can I create a warning which functions like those available via Window > Preferences > Java > Compiler > Errors/Warnings?
I think that a builder might be appropriate for what you want to do. There's a template in the new plugin wizard that creates everything you need for a builder (ex. business logic). Since the builder runs every time the file is modified, you can clear the old warning (code generated for you) and add a new warning (code generated for you) if applicable. This also applies when the file is first created.
You could even look through the code and find hard-coded strings and flag them with warnings if you want.
As for the comments marking translation keys in the code today, those are there to guide NLS tools (you probably already knew that). The idea was to write the code first and then go back later and translate. If a change is made to the code later, the tools can run again and only act on new strings added by the delta.

Questions about IntelliJ to Eclipse transition

I just started using eclipse for some personal projects and am finding the transition from IntelliJ (what I use at work) kind of annoying. I hope it's kosher to ask a few different questions in the same thread. Here goes:
1) How do I get "views" (I'm not sure if this is the term. I mean windows such as Project Explorer, Servers, Console, etc) to stay expanded and on top even after I've clicked back on the editor or another view. I'm pretty sure that right now all of these tabs are "quick views" that I have minimized and then docked, so I may not be doing this right to begin with. In IntelliJ, I would simply just pin the tab.
2) How can I open a file (for instance, an ant build.xml) without having to make it part of an eclipse project? I want the syntax highlighting and Ctrl-click ability that the IDE will give me (not to mention being able to use eclipse's built-in ant), but I don't need to associate the file with any others and so don't see the point of having to make it a part of a project.
3) Is it just me (wouldn't be surprised) or does eclipse have a bug with parsing empty html tags within the body of html tags of the same type. I've only tested this in a JSP, and it doesn't happen with JSF tags. For example: <div id="foo"><div id="bar"/></div>. Eclipse will give a warning saying the first div tag has no end tag. This is with the most recent version of eclipse for Java EE, no plugins have been installed.
4) Finally, a general question: Any best practices or resources to look at for organizing the eclipse interface and perspectives/views? What about workspaces/projects? Is there some tutorial out there that would be really informative that I could read through in less than an hour?
I appreciate any answers and tips/tricks.
First of all, please acknowledge that there are different people in the world and there are people who don't work the "Eclipse way". Even if I was paid for it (and I am), I couldn't work with IDEA. So if Eclipse rubs you the wrong way, it may not be for you. That out of the way, your answers:
In Eclipse, you open a view and let it stay where it is. In IDEA, the view changes all the time, things pop up and go away. Eclipse is static unless you specifically move things around. There are two ways to move things: You can minimize a part (a part is something which contains tabbed views). This moves the part into the closest border. Or you can maximize the current part (Ctrl-M). This pushes all other parts out of the way. Another Ctrl-M will restore the view.
This is a good place to show the difference between IDEA and Eclipse. IDEA tries to anticipate what you're doing and to be helpful. For me, this means it always gets in my way. It will start to format source as I type, things move, etc. That freaks me out. Eclipse is like a toolbox. Everything is there but you have to pick it up. A toolbox doesn't move on its own accord and it doesn't try to be smart.
Eclipse is based on the idea of a workspace. The workspace is the universe and nothing outside exists. If you need to go outside, you must first create a file or folder. In the "New File/Folder" wizard, you can open the advanced options (at the bottom) and link this resource to a real file/folder in the file system. May sound like a lot of effort but it allows Eclipse to display virtually anything in the explorer since it just shows "resources" in there, not actually files.
Smells like a bug. Please report it at https://bugs.eclipse.org/bugs/
I'm not aware of anything.
[EDIT] 3. As cletus pointed out, is not valid HTML. So that might cause the warning.
An Eclipse Perspective is a collection Views and their position. You can customize or create new perspectives, but the existing ones are good enough for a start (Java, J2EE, Java Browsing etc.). I recommend to stick with the default layout for a while until you've managed to use the quick view feature (which, personally, i find quite annoying). On small screens, i simply like to use Ctrl-M to switch the Editor to fullscreen mode and back, without the need of minimizing single views or move them around.
Yes, you can run external build scripts as well and it's called External Tool in Eclipse. Go to Run > External Tools > External Tools Configurations. Create either a new Ant-based config or a native executable (Program). The location of the build script or executable can either be workspace-relative (Browse Workspace) or absolute on the file system (Browse File System)

Categories