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 88091 - Code completion doesn't offer right method to objects in form editor
Summary: Code completion doesn't offer right method to objects in form editor
Status: VERIFIED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Jan Pokorsky
URL:
Keywords:
Depends on:
Blocks: 89637
  Show dependency tree
 
Reported: 2006-10-26 17:06 UTC by Jana Maleckova
Modified: 2007-01-17 10:09 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jana Maleckova 2006-10-26 17:06:10 UTC
NetBeans IDE Dev (Build 200610251800)
1.6.0-rc; Java HotSpot(TM) Client VM 1.6.0-rc-b99
Windows XP version 5.1 running on x86
cs_CZ (nb); Cp1250
HW: dual core

Description:
============
Create new JFrame. And try to edit main method in form editor. 
e.g. write code which sets system look and feel.

UIManager.setlo  - and press ctrl+space for completion. No setLookAndFeel method
is offered

And also if you select e.g. Class node in navigator win - tree, the whole class
is not selected in editor. The boardes of block are not correct.
Comment 1 Tomas Zezula 2006-10-26 19:30:07 UTC
Is the UIManager imported (not marked by error)? The Ctrl+Space offers only
visible (imported) classes. Ctrl+Alt+Space offers all classes and automatically
imports them.
Comment 2 Jiri Prox 2006-10-27 08:24:21 UTC
It happens for all classes. It looks like the model is not synchronized
correctly (can be seen in Navigator -> Trees). When the file is saved, it starts
to work fine.

Steps to reproduce:
1) create new JForm
2) in ctor type: "string".
-> provided CC is not correct
Comment 3 Dusan Balek 2006-10-30 16:13:11 UTC
Seems like a problem with guarded sections. Reassigning.
Comment 4 Jan Pokorsky 2006-11-15 15:49:42 UTC
Yesterday I fixed some position issues so it should be the culprit. Anyway I can
reproduce the same even with plain java file. Just copy method

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new NewJFrame().setVisible(true);
            }
        });
    }

to some empty java file and try to cc for UIManager inside invokeLater.
Sometimes it even mess existing code. It seems to be a bug related to annonymous
inner classes not guarded sections.
Comment 5 Jan Pokorsky 2006-11-22 19:08:13 UTC
Sorry, I meant position issues should *NOT* be the culprit.
Comment 6 Jan Pokorsky 2006-11-27 13:57:22 UTC
I guess I found the problem. JavaSource does not track the data object validity
state. In this case the data object becomes invalid and a new one is created but
JavaSource still listens to the old data object (old document).

I will fix JavaSource to listen to DataObjec.PROP_VALID.

I would also recommend to file separate bug about anonymous
inner classes since it does not relate to this issue.
Comment 7 Jan Pokorsky 2006-11-27 18:09:45 UTC
fixed in trunk

/cvs/java/source/src/org/netbeans/api/java/source/JavaSource.java
new revision: 1.20; previous revision: 1.19
/cvs/form/src/org/netbeans/modules/form/JavaCodeGenerator.java
new revision: 1.187; previous revision: 1.186
Comment 8 Jiri Prox 2006-11-27 21:42:28 UTC
verified in trunk
Comment 9 Jan Pokorsky 2006-11-28 19:16:29 UTC
merged to release60-m5 branch

/cvs/java/source/src/org/netbeans/api/java/source/JavaSource.java
new revision: 1.17.2.1; previous revision: 1.17
/cvs/form/src/org/netbeans/modules/form/JavaCodeGenerator.java
new revision: 1.186.2.1; previous revision: 1.186
Comment 10 Jiri Prox 2006-12-01 09:48:34 UTC
verified in m5