This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The fix for Issue 156127 "Code completion cannot be disabled" causes this problem. jVi pops up a dialog containing a JComboBox for vi command mode; the box's JTextComponent is registered as a completion provider, see Issue #110239 and Issue #113673 for patches that fixed problems to get the JTextComponent to work. There is Issue 110237, which remains unfixed, about API problems between CodeCompletion and EditorRegistry. Note: the jVi ":" command brings up the command entry dialog. After the fix for Issue 156127 there is no longer default bindings provided for code completion. This causes the jVi use case to fail. The problem is exacerbated because CompletionImpl.findEditorKeys finds nothing unless the JTextComponent has a Kit derived from NBs' BaseKit. So a workaround that has jVi adding the proper keystrokes for the action name will fail.
Noted its a REGRESSION. Set priority to P2 because there doesn't seem to be an obvious workaround.
Ernie, do you need a regular plain JTextField to have a code completion or could it be a JTextField with BaseKit (and BaseDocument) installed? If the latter case would suffice then the solution that I've described in issue 110237 would suffice IMHO.
> the solution that I've described in issue 110237 would suffice IMHO Yes, that was my thought as well, assuming > or more generically JTextComponent in case of install-into way is the technique implemented. I've been meaning to ask if I should depend this issue on that one. I wonder if there should be a client property/parameter for the level of support. BaseKit may have too much or it may be just fine if it doesn't get all the "fancy" stuff. jVi's command entry window does not want all the editor baggage/bindings. This is simple text entry (embedded in a combo box helps provide command history feature). So if BaseKit is relatively "plain" then that would work great. Alternately the type JTextComponent vs JEditorPane could be used to guess what to put in; but there might be cases where a simpler JEditorPane is wanted, I don't know what kind of flexibility you want.
BTW, I found a workaround. I install a binding for Ctrl-Space and do showCompletion. This seems to be good enough for what jVi needs.
If we can resolve this by using the workaround then let's close this issue and just continue the API effort under issue 110237. Regarding factory API the factory should probably take JTextComponent as parameter and attempt to work with the JTextField as well. BTW the BaseKit- related things do not handle well the single-line mode so JTextField is definitely better at the moment regarding this.
*** This issue has been marked as a duplicate of 110237 ***