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.

Bug 113921 - Can't hook into bracket completion
Summary: Can't hook into bracket completion
Status: NEW
Alias: None
Product: obsolete
Classification: Unclassified
Component: languages (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P3 blocker (vote)
Assignee: issues@obsolete
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-27 23:50 UTC by Torbjorn Norbye
Modified: 2008-07-30 10:30 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Torbjorn Norbye 2007-08-27 23:50:11 UTC
I need to add some custom bracket-completion code for a Schliemann-based language (RHTML).  

I followed some instructions from Hanz, but I can't get it to work - so I was asked to file this issue. 

In my RHTML.nbs file, I have this:

COMPLETE org.netbeans.modules.ruby.rhtml.editor.BracketCompletion.completion

(this is between the NAVIGATOR and FOLD entries, if order matters).

I also have a public class, 

package org.netbeans.modules.ruby.rhtml.editor;

public class BracketCompletion {
    public static String completion(org.netbeans.api.languages.Context context) {
        JTextComponent target = context.getJTextComponent();
        ...

but when I open an .rhtml file and try to type keystrokes, newlines, etc. - the above method never gets called.

I would expect it to be called for every keystroke. I would also really like for it to be called as follows:
- before every keystroke
- after every keystroke
- including newlines
- including backspaces

It would be good for the Context object to let me distinguish these scenarios.

This isn't specific to RHTML; JSPs have the same issue. In Java code there is a BracketCompletion class which processes
keystrokes based on the above events, and in order to support normal Java editing within JSPs, the Schliemann support
for JSPs need to be able to register some sort of keyboard hook with the Schliemann editor kit and delegate those events
to the Java editor's Bracketcompletion class.
Comment 1 Torbjorn Norbye 2007-09-25 23:45:11 UTC
I've found a workaround I can use for Ruby+RHTML for NetBeans 6.0
Comment 2 Petr Jiricka 2007-10-04 16:30:29 UTC
This is not critical for NetBeans 6, we agreed to change the priority to P3.