In order to make Eclipse's content assist more like Intellij's, I changed the "auto activation triggers" setting to pop up the content assist window whenever I type, as mentioned in this question.
However, now whenever I press Space it inserts the content assist suggestion, even though I wanted to type a space.
Is there a way to make eclipse insert the suggestion only when I press Enter, not when I press space?
There is no way to control this. Open a feature request in Bugzilla: https://bugs.eclipse.org .
In Preferences>>Java>>Editor>>Content Assist, select Disable insertion triggers except 'Enter'. This handles the space bar issue.
You'll still get inserts sometimes, when there is only one proposal. I lived with this for a while, but I needed to disable it so I could use content assist in a plug-in to only provide suggestions.
You can turn this off by disabling Insert Single Proposals Automatically in the same menu.
Below image shows how can you bind the key to Content Assist command.
Related
I'm working on a java project using Eclipse, javaFX, TableView.. My application is available in three languagues and user can change it from the Setting corner in the app and everything goes right, but i noteced that when a table is empty it show this message or hint line:
As you can see even if user change language this line still in french(My system language) and i don't find any way to change it, change its content or hide it..
Please if anyone can help me in this just post an idea or comment.
Thanks..
Try this to set the empty tableview message accordingly each time when language is changed: tableview.setPlaceholder(new Label("Empty tableview!"));
Lately Eclipse's content assist feature has been giving me some frustration.
I recently changed my Auto Activation trigger so that the autocomplete box would appear whenever I start typing, rather than just after I type a period.
This is great most of the time but it has some annoying downsides. For example:
Eclipse autocompletes 'String' to android.R.string. This is very very annoying considering it changes "String" to "string" when I press space or enter. Why would I want that? android.r.string hasn't even been imported!
Here is what my content assist settings look like:
Two desired solutions would be the following:
Don't show proposals that don't match case (little 's' shouldn't match big 'S')
Don't show proposals that I have not imported.
If anyone could help me out with this it would be greatly appreciated!
Try these:
1. Sort the proposals by relevance and not alphabetically.
2. Hide proposals not visible in the invocation context (you have this one) and
3. Hide deprecated references
Currently the Eclipse autocompletion seems only to be triggered after a dot or on parameters, I want to use it for variables too, e.g. if I have
String test="hello";
then I want the autocompletion to suggest "test" if I start typing "t" in the next line (e.g. if I intent to change the value of the variable test).
Is there any Eclipse plugin capable of doing this? I already checked the Eclipse content assist options, but seems like there no option for what I want? Thanks for any hint!
First of all, thanks for all the replies. They are correct, however you have to press the key combination each time. Here's how it's done automatically:
That plug-in is not necessary any more. Just go to
Preferences > Java > Editor > Content Assist
and paste:
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.
into the "Auto activation triggers for Java:" field.
This simply triggers auto activation after any English alphabet character and after dot.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=159157#c12
Works fine :-)
Hint: You probably want to additionally set the auto activation delay to 0, at least if you are used to visual studio ;-)
In addition to the suggestions above, did you try ALT + / it does incremental matching? No?
ctrl + space
If you press ctrl+space key combination, eclipse will show you the code assist window.
Type t and then hit ctrl+space, it will show you possible matches
You can press "t" and then Ctrl+Space..
is it?
In Eclipse
Window--->Preferences---> search for Content Assist under Content Assist go for Advanced
and check the Java Praposals.
done.
I have a JCheckBox that should not be checked by the user when a certain other field is empty.
So now I want to have an error popup and then reset the checkbox (I've considered disabling the checkbox, but the connection to the other field is non-obvious, and a tooltip text IMO not visible enough).
What's the correct way to do that in Swing? Through a PropertyVetoException? Where do I throw it and where do I catch it? My first (probably ugly) idea would be to add a ChangeListener that itself shows the popup and resets the value.
Edit: The question is about Nikki (screenshot below), an app I am developing which geotags images and exports them to Google Earth's KMZ format. The checkbox is used to select the images to include in the export. But this requires the images to be gotagged first (which in turn requires either a timestamp, or manual assignment). I don't think this requirement can be made obvious through the UI layout.
(source: brazzy.de)
I would simply disable the check box and add a message explaining why the option is not available. A nice way to show the message is to display a mini exclamation mark next to the check box and put the message in a tooltip.
Poping up an exception often feels wrong because users don't read error messages. For most users an error message popup means that the application did something wrong, in your case it's the normal behavior.
Edit if you insist on letting the check box enabled, another way to show the user that some info is missing would be to flash the missing data. Eg. if latitude and longitude are missing and the user clicks on export, set a red background onto these fields for a just a second. This will clearly show the user what's missing.
In this screen, don't you want to put the mouse over the red circle to understand what's going on?
validation http://www.vogella.de/articles/EclipseDataBinding/images/validation10.gif
I don't think the Export JCheckBox should be disabled at all. Instead, the Export JButton itself should examine the current export list and display any anomalous entries in a way that allows navigation to a chosen photograph. If all entries are correct, Export would proceed as usual.
Addendum: It think you are right to keep the interface as non-modal as possible. My model for this would be unsaved files when exiting an editor or uncommitted changes when closing a project in an IDE.
If that's a status line at the bottom of the window, you might indicate the number of photographs currently selected for export, adding a count if any still need geocoding.
The field should simply be allowed to disable the checkbox. If the coupling is unintuitive then the GUI layout may have to be reconsidered.
EDIT: I ran it from your page, and I believe the issue here is that you actually have a third and fourth step in addition to select folder, select images. The third step is validate image, and fourth is select images for export. I think your problem is that this is not clearly conveyed in the current layout, and that reflects in your question.
I would suggest that you create a separate column containing the checkbox for each image, and that THAT checkbox is disabled until the image passes validation (step 3). Perhaps with an explanatory text in the column about why the image hasn't passed yet.
On an Eclipse RCP application, I'm building an Editor in which some fields are mandatory.
If the user saves the editor with theses fields not filled, what is the best way/practice to handle this ?
(my first guess is to show an error dialog if theses fields are empty in doSave() method but I'm not sure it's the "eclipse" way to deal with this kind of problem)
If you consider some dialog box like "Create a New Java Project",
you simply cannot do any action (like "Next" or "Finish" until you fill the one mandatory field ("Project name")
So it is different than checking on the doSave() event.
If that field is invalid (like if the project name already exist), a warning is displayed in the zone at the top.
If the field is correctly filled, then you can save.
(Note: I know this is not an Editor, but it can give you an idea about the mandatory fields management in eclipse)
alt text http://ds.informatik.uni-marburg.de/MAGE/gdt/images/tutorial/NewJavaProject.png
I agree with VonC and would disable the "Save" button, as long as the user has filed all the important fields.
Showig a warning which fields the user has to fill would help a lot.
EDIT:
Create a component which added himself as change listener. When someone changes the component, you can check whether the input is correct.
Create a window whith all the self-checking components and add the window as listener to all the components.
When somebody change a compounent you can directly check if the input is valid and the user can step to the next page or save the page.
In RCP (Example FieldEditorPreferencePage) a lot of components have the doSave() and isValid() methods.
In isValid() you can check all the components you can find in the window and in doSave(), you sould check the isValid() state, when it is not done automatically, and do some additional save actions.
You could use FieldDecorations to mark the mandatory fields and provide visual feedback if the content of a field is incorrect.