When I begin typing "butt" for "button", the content assist recommends a Button - that is right and I want it like this.
see example
But when I press enter, it inserts "java.awt.Button"
see example
How do I tell the assist to insert only "Button"?
Your Eclipse IDE may not be properly configured for JavaFX which could prevent autocomplete from finding JavaFX's classes. The solution is likely to update Eclipse IDE's access rules, otherwise you may be interested by this answer or this one. Read below for further details.
You already import JavaFX's Button whereas the autocomplete proposes AWT's Button (see the java.awt on the right of the proposal). To make sure AWT's Button is not mistaken for JavaFX's one its fully qualified name has to be use — hence java.awt.Button.
The real issue is that your content assist should also propose the javafx.scene.control.Button class, and that should be solved by configuring access rules as described in the first answer I linked.
Related
I am currently helping a blind person to learn Java using Eclipse as their IDE. However, when there are errors, e.g. a typo, the red underlines indicating an error are not useful/apparent.
How can blind users be made aware of errors or other visual indicators within Eclipse?
In eclipse you can use Ctrl+. and Ctrl+, to navigate forwards and backwards through underlined sections.
When the cursor is in an underlined section, the error is shown in the status bar which your screen reader may be able to read (with JAWS use Insert+PgDn or CapsLock+PgDn).
There are some more tips for Eclipse's accessibility features in the Eclipse Help pages.
Jaws normally says "invalid" before each invalid part of code in the code editor as you navigate with arrow keys.
You have nothing specific to configure for this. At least for me, it worked out of the box from day 1.
IN case of doubt or if it doesn't work out of the box, you can customize the way Jaws behaves by going to the setting center.
More specifically, in the speech and sound scheme, you might pick a modern scheme different than classic, or want to customize the way the "invalid" font style is announced.
You will also certainly need to pay triple attention to things that eclipse automatically insert for you as you type, like closing parens and braces, as they aren't announced at all by Jaws when they are automatically inserted. They can easily make you enter unwanted extra characters.
As a blind user I prefer to completely disable all autocompletes like this and only keep it on demand with shortcuts like F2, but that's a personal choice.
Unfortunately, I can't help if you are using NVDA, but there certainly are solutions as well.
I'm particularly interested in removing the "Java Class" submenu as Kotlin is more relevant to my needs. Although I know you can attach keybindings to controls, this would be convenient for me as I prefer to use my mouse to operate the IDE. Is there any way to do this?
I'm using the latest IDE version.
You can't remove it right now, please vote for this request.
I'm developing an Eclipse plug-in, mostly as a learning exercise, in which I have a wizard page. In this wizard page I would like to have a small text area that behaves like a code editor with the appropriate content assist and information hovers etc, much like the breakpoint properties wizard has for adding conditions.
I'm new to plug-in development and I may not have quite picked up the vocabulary, so I'm not having much luck searching for examples. Can someone please point me in the right direction?
I assume that you are looking for an embeddable Java source editor - and with that you hit a difficult topic.
The source viewer mentioned by Chris Gerken is called JDISourceViewer. It is instantiated and configured in JavaBreakpointConditionEditor::createControl.
If you cannot find the mentioned classes, or if you want to experiment with them, then open the Plug-ins view, find the org.eclipse.jdt.debug.ui plug-in and select Import As > Source Project from the context menu.
Unfortunately - in the beginning - the (Java) editors weren't designed to be embedded outside of the editor area and many editor participants (e.g. actions, formatter, etc) still expect an IEditorPart. Hence it is a quirky and complicated endeavour to use an editor in a dialog or the like.
Moreover, the Java source editing infrastructure is not exposed as public API. It isn't meant to be used by clients and can change at any time without prior notice. You will see respective warnings in yoyur code. For a learning exercise, however, that shouldn't matter much.
This is basically the same question as this except for Netbeans 8.0.2 (running under jMonkeyEngine SDK 3.1-alpha1) instead of Visual Studio.
Honestly, the aforemetnioned link says it better than I can, but basically I'm a vim key binding user, and have the netbeans jVi plugin installed and want to map, for example, alt-j and alt-k to scroll through the code completion list instead of the arrow keys:
I've searched through Tools->Options->Keymap, as well as the the JVi configs at Tools->Options->jViConfig. I don't see anything at all under jViConfig, so I think the standard NetBeans key bindings are the way to go.
I have tried modifying most of the obvious down keys e.g insertion point down, scroll down, page down etc, but they all affect the underlying text in the editor, never the completion list.
And:
Does anyone know of a way to do this?
Or maybe a plugin to provide the functionality?
It simply appears that the raw arrow key movements are not mappable by netbeans (?).
Note: this is possible to do in Visual Studio 2015, so I'm hoping it's possible in NetBeans as well.
Many Thanks.
AFAIK, there is no way to do this in NetBeans. At least there wasn't in 2010, when I filed the NetBeans bug hint completion makes assumptions about associated editor pane bindings. I maintain jVi. I filed the bug since I was having trouble with completion bindings for some special keys. In the NB source take a look at
editor.completion/src/org/netbeans/modules/editor/completion/CompletionScrollPane.java
And you'll see a bunch of hardcoded stuff.
In the jVi source
nbvi/nbvi-module/src/org/netbeans/modules/jvi/KeyBindings.java
method fixupKeypadKeys, you see what jVi does (given the fix for the bug I filed). This is part of some arcane code that depends on being friend with some NB editor package.
You could file a bug with NB. If you provided NB a patch, they might incorporate it. If you file a NB bug, cc me (err at netbeans.org)
Alternately, you could try adding some code to the jVi file to add your keybindings.
I want to add a listener to the default code editor in Eclipse. It should be triggered whenever a new code file is opened or closed. Is there anything available like that? I did a google search for hours, but could find a working solution.
I'm especially focusing the default Java code editor. But once I know how to hook into such an editor it shouldn't be a big problem to add additional ones. The main problem I have so far is, that I don't know what I should do with the IEditorDescriptor I could get.
You can register an IPartListener2 with the PartService, for example:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getPartService().addPartListener(aListener)
There are other ways to register the IPartListener, for example if you have a reference to an IWorkbenchPage.
The part listener is notified when editors are opened or closed, among other things. For IPartListener2, you get an IWorkbenchPartReference which you can use to check what kind of editor is involved. For example, to detect the standard Java editor, you can check for the ID org.eclipse.jdt.ui.CompilationUnitEditor.