setToolTipText() not working while working with NetbeansPlatformApplication

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

setToolTipText() not working while working with NetbeansPlatformApplication

We are building a tool to provide assistance to the users when they manually inspect static analysis warnings generated on 'C' code. We found that NetBeans Platform provides an easy and efficient way to develop tools and it is suitable for our development of a tool that has GUI and capabilities to provide assistance to the users. Towards this end, we tried using Netbeans Editor Module where we wish to utilize the existing editor features like code highlighting and folding, syntax coloring, and displaying keywords/data types.

We intend to provide assistance messages to the users as a tool tip on the variables and operators (i.e. on mouse movement).

We tried using the following Code snippet in an independent NetbeansPlatformApplication (without including the Editor modules) to open a file in the editor and obtain the JEditorPane object.
        File f = new File(<file path>);
        FileObject fileObject = FileUtil.toFileObject(file);
        DataObject d = DataObject.find(fileObject);
        EditorCookie ec = (EditorCookie)d.getCookie(EditorCookie.class);;
        StyledDocument doc = ec.openDocument();
        JEditorPane[] openedPanes = ec .getOpenedPanes();
        JEditorpane editor = openedPanes[0];

And then used the setToolTipText() method on the editor object, this worked prefectly fine(with MouseMotionListener), but on trying to include  C/C++ editor module(and modules which it depends on)  in the NetbeansPlatformApplication we got the editor functionalities like syntax coloring, code folding, displaying keywords/datatypes. But now the ToolTip had stoped working and the tool tip behaviour is unpredictable as sometimes it would work and sometimes it won't .

We are looking for a help to understand how we can make the tool tip visible all the time on mouse movement event. Requesting help on this. Thank you very much in advance.