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 103164 - Java File becomes read only on Mac if I double click in the code completion dialog
Summary: Java File becomes read only on Mac if I double click in the code completion d...
Status: RESOLVED FIXED
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: Macintosh All
: P2 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-02 18:05 UTC by Winston Prakash
Modified: 2007-11-05 13:44 UTC (History)
0 users

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 Winston Prakash 2007-05-02 18:05:29 UTC
I'm making this P1, because this has happened to me several times in the past
few months, and thought it may due to retouche changes and may require some time
to stabilize. But is still there and very annoying. 

This is how it happens to me

- type the variable and then "." to get the code completion dialog.
- Then double click on the method (mostly some static method) you want.

Nothing happens. I mean the method name was not appended to after the "."

Now the editor has gone readonly (but no indicator) in the tab title.

Close and open the Java file again. Still the file is read only and can not edit.

Close the project and reopen the project, and open the Java file. Now the file
is editable.   

Note this is not always reproducible.
Comment 1 Petr Hrebejk 2007-05-03 12:29:12 UTC
OK, we are able to reproduce it on Mac. Just after start of NB. Selecting an
item in CC with double-click moves the focus out of the editor. 

Workaround, which worked for us was to open some dialog and then go back to
editor. It will gain the focus again.

We are looking into it. For now it looks like a Mac JDK focus specific problem. 
Comment 2 Petr Hrebejk 2007-05-03 12:32:50 UTC
Also please notice that there is another issue which may have similar symptoms. 

See #89893.
Comment 3 Jiri Prox 2007-05-03 12:50:24 UTC
Another similar issue is issue 65326
Comment 4 Miloslav Metelka 2007-05-07 21:20:45 UTC
Steps:
1) Restart IDE with a source already opened.
2) Invoke completion automatically e.g. type "s." after "String s; ".
3) First invocation typically only shows the completion for a short time and
closes automagically. I guess it might be because of CompletionImpl:517 if the
keyevents would arrive in a strange manner.

4) Next attempts to press Ctrl-SPACE do not do anything. Only switching to
another component or external app and back restores normal behavior.
5) Ctrl-SPACE; double-click CASE_INSENSITIVE_ORDER static field; caret stops
blinking in the editor.

6) Focus is in Project Configurations combobox. Pressing down arrow opens the
listbox with configurations.

7) If the Build toolbar gets hidden the focus is broken. From the opposite
component in the focus event it seems that the focus is in the popup itself
(it's a panel inside a layered pane in a root pane of a main window). That popup
is however no longer visible. Strange.

The problem can be reproduced even when allowing the popups (completion and
javadoc) to be focusable (currently they are parented to editor pane but they
are non-focusable).

Disabling the hideAll() code in CompletionImpl.mouseClicked() does not help
either (the popups get closed by JavaCompletionItem.defaultAction() which calls
hideCompletion() and hideDocumentation()).

Simple requesting of the focus to the editor pane does not help. I remember that
in early Swing times it was necessary to first request a focus into
corresponding frame and then into the component itself. We should possibly try that.

We should also try to first request focus into the editor pane and then close
the popup whether that does not make any difference.
Comment 5 Miloslav Metelka 2007-05-18 13:51:05 UTC
I've tried the mentioned things but it did not help to resolve the problem.
 BTW there appears to be no focusLost() sent when popup has a focus and I click
into the explorer tab. Strange. It's probably just related to using j.s.Popup
but it in fact prevents us from closing the completion popup automatically when
clicking to another component within the IDE. I'll try few more things.
 IMHO this is not a P1 since switching to another app and back should resolve
the problem.
 Reassigning to editor since this is a non-java specific problem.
Comment 6 Dusan Balek 2007-07-12 10:02:39 UTC
Should be fixed together with #96717.