I often see a yellow start near the methods, and some percentage in Eclipse Luna's intelligent code completion:
What does this star and the percentage mean?
Both the star and the percentage are added by the Intelligent Code Completion.
These suggestions are based on context and code analysis (data mined) of similar situations. The percentage is presumably an indication for the confidence of that suggestion.
Protected methods (which was the explanation suggested by Ted Hopp) are in fact indicated by a yellow diamond with rounded corners, similar to the icon in the outline view.
From the Eclipse Luna documentation, it appears to mean that it is a protected method.
A number of code completion engines come equipped with Eclipse Mars edition onwards. They are provided by by eclipse.org Code Recommenders.
Normally eclipse orders members alphabetically. However, Code recommender engines will override the alphabetical listing and place commonly used icons near the top. For example println() would be presented near the top with a yellow star after you type System.out. and toString() would appear near the top with a yellow star after typing String obj.
The starred items will be followed by an alphabetical list of members which either could not be identified by the engines or identified as being unlikely to be applicable.
Percentages indicate the likelihood of the suggestion being applicable based upon code from other users who have used your components in their code.
The yellow star indicates that the suggestion has been provided from code recommenders based upon mined data.
Related
Is there a way to just see one method of a class in the IntelliJ IDEA editor and hide everything else, and/or toggle between this and the regular view.
Please note, I'm not looking to fold/collapse other methods, which is certainly a way to minimize getting lost in a large file.
I am looking for a way to only view a specific method I'm working on within a class.
e.g. If there is a legacy code where an existing class has 10 long
methods (each ~50 lines long), and I'm working on one of them and don't wish to be lost in
the 500 lines of code and need to focus on a single method thereby narrowing my view to 50
lines of code.
I do remember a few versions back that this was possible, but am not able to find that setting now.
Further clarifying my question. Consider the method selected in the image below
I am interested in a view that'll show just the method like below (with all the java capabilities like code highlighting, refactoring etc., enabled of course):
In IntelliJ IDEA 2019.3.3 (Community Edition) there's a fold option 'Fold Selection' that hides even the signature.
Select / highlight the code above the method you want to focus on
Right click > Folding > Fold Selection. Shortcut = cmd + .
It might be in earlier versions but I haven't checked.
Fold selection menu option
I have searched in google but unfortunately couldn't find any answers, so the question is:
What this symbol means in eclipse? (eclipse version : neon.1 for EE developers)
(It is known that the green dot indicates a method but what about the yellow star?)
Update: In this image you can see 8 methods that have the star symbol.
Completion proposals with that icon are contributed by Code Recommenders. That plugin leverages external information to recommend more relevant proposals, as you can also see by the percentage shown beside each entry: it indicates s.t. like the probability that the given proposal is what you need in your context.
You will also find mention of Code Recommenders and how it intergrates with JDT in the preferences under Java > Editor > Content Assist > Advanced.
Doesn't it have a tooltip? Just hover over it and see what it says.
That might be a custom icon that was introduced by a certain Eclipse plugin that you installed. To figure out what plugin it relates to, go to Window -> Customize Perspective. There, under Tool Bar Visibility tab, you will see the tool bar structure. You can expand each section to see the list of functions and the related icons. Your icon should be there somewhere.
Eclipse generally sorts methods alphabetically.
To ease users, top used methods are listed before the alphabetical sorting; think of System.out where println will be on top.
Another case is when a certain return type is expected, say for any arbitrary object:
String str = obj.
toString() will be on the top.
Methods like these are starred.
When I set a break point on a row which already has a marker(The value of the local variable is not used) on it, I cannot see the break point marker; because the yellow lamp marker covers the break point marker.
Is it possible to change the priority of the markers so that the break point sits on top of the lamp marker?
As long as #Mena answer is ok, as he sais...
Use at your own risk :)
This can be dangerous in a big project.
To avoid problems with hided warnings due configurations, what I usually do is:
Leave config as is, to see warnings.
Remove all really unnecessary lines causing warnings
Add an annotation to method still having warnings but needing breakpoint at same line. You can annotate class if necessary when massive warnings or breakpoints needed.
#SuppressWarning("unused")
public void yourMethod() {
}
This will allow you to handle warnings individually and see breakpoints when necessary.
I find that incredibly annoying too.
The only solution I've found is to go to the Java editor preferences, and disable the checkbox "Report problems as you type".
This will not change the priority, it will disable the hint and only show the breakpoint.
Here's a picture to illustrate:
Use at your own risk :)
Finally a TRUE relief after years of a so annoying and tiny thing:
1) go to your eclipse install path and look for all files (filename) that contain the word "warn" and are of the format .gif or .png (because they contain transparency data), here there were 5 files whose icon/image matched, most were named as: quickfix_warning_obj.gif (or.png)
2) rename all of them to *.DISABLED like "quickfix_warning_obj.gif.DISABLED", and as soon you restart eclipse, this will force it to restore the right one as soon you open an editor that uses it and has some warning on it.
3) having detected the right file, replace it with one of identical size (width and height in pixels), I would like to suggest this image I just created, so simple and not annoying at all and still is useful!
4) restart eclipse again and clap with a smiling face!
PS.: you can try to just replace this file also, that was the right one here for Eclipse Luna:
$ECLIPSE_INSTALL_PATH/configuration/org.eclipse.osgi/478/0/.cp/icons/full/obj16/quickfix_warning_obj.gif
Obs.:
Of course you can replace all of them that look the same, change other annoying icons and so on, and experiment with your own gif/png size and image, just that these steps is what worked perfectly here.
The image I supplied is almost invisible some times, but they were never really useful to me as I let the code with warning become underlined as a highlight. A better image is welcome :)
And, of course, this is a workaround, like a theme change, that does not involve any coding/recompiling of eclipse, therefore the priority is not changed at all, but the results are good enough to me at least.
EDIT: here one for the search results: searchm_obj.gif at configuration/org.eclipse.osgi/331/0/.cp/icons/full/obj16/searchm_obj.gif on Luna
I'm starting to create a Industrial Simulation (IS) interface, using Java.
The problem I'm pointing here is the interface.
A IS interface will have some big squares (geometrical figure) (unfilled, instead of it they will have their "names" inside it), one or more lines linking the squares, and while time will be going, some "mini-squares" will get out of one big square to another, following the line that links both.
I have to construct a interface that is able to have either the geometric (square) figures and the animation with the "minisquares" following the link (that will be the line).
Is there any API, or tool, whatever, in java, that could help me starting this part of the project?
If you can use javafx... runs on the JVM... that might be easiest way. Here's a link to a tutorial for animating along a path
Otherwise I guess you'll be looking at Swing, but I suspect it's a lot trickier. Here's a similar link.
Visual editors like Matisse can help you get started with layout etc., but I don't know of anything that will let you point-and-click your way round animation.
I have a small Java application that has a JTextArea where the user enters text. I would like to add spell checking capabilities to this component similar to the way that Microsoft Word does it, i.e. misspelled words are underlined and a popup menu with corrections is displayed when the user right clicks on the underlined word. Are there any open source libraries for adding this functionality to JTextAreas?
You could implement your own spell checker using a dictionary (can get quite large depending on languages you support), then distance metrics are calculated from the words in the text box to the dictionary. Underlining can be done using font styling, there as applet based sample here.
Jaspell is a Java implementation of the popular Aspell. In there are some explantions of the search algorithms used.
As mentioned previously Jazzy is also great and IBM provides a nice tutorial.
I haven't tried this before, but I came across it a little while ago: http://sourceforge.net/projects/jazzy/