How to reproduce:
1 case :
Try create some files from explorer.
-> Sometimes file is opened in editor but without
focus (focus has another file)
2 case :
If new file has focus in editor try click to
-> Sometimes files flash betweem selected file and
file which had focus before.
Try run swing application. Close this app. , and
try 2 case.
This behaviour is appeared in Editor, Output window.
This issue blocks GUI tests and it's very user
build , jdk1.4.1_b21
100% reproducible scenario :
- run IDE
- on selected dolder push from context menu New | New ...
- select Others | Properties
- push Finish button
-> new file is opened but the previous tab is still selected
MainWindow receives focus AFTER TopComponent (QuietEditorPane).
Following analysis is for JDK 1.4.1_01.
It seems it is not one issue. Please file new for rest. I investigated
behaviour when you create new Java class using JavaWizardIterator. In
this case it is really nasty behaviour.
In the end event FOCUS_GAINED is received for MainWindow. I
investigated where it comes from and it is really weird. This event is
created in KeyboardFocusManager.retargetFocusEvent(). Original event
is again FOCUS_GAINED event with the same source. And this event is
created when JavaWizardIterator calls EditorSupport.open() ->
TopComponent.requestFocus() -> QuietEditorPane.requestFocus(). But
this is translated to focus event with MainWindow as source. This
event is somewhere stored (some queue) and processed in the end of all
focus events generated later. I have no idea why it happens. Call is
done after JDialog.show().
Workaround is to call actionPerformed() using invokeLater(). I
reassign to java module I will attach part of log where is call stack
when original focus event is created. I will attach also diff of
Fixing description to make clear what issue is this. It is first case
at beginning of description
Sorry I fixed summary in previous commit.
Created attachment 8670 [details]
Log where focus event is created
Created attachment 8671 [details]
Diff of suggested fix
bug in the properties was separatelly filed as issue 30510
Slightly modified patch from Marek applied to the trunk. Reassign back to core for additional fixes.
java module fixed merged to QBE200301290100 branch
/cvs/java/src/org/netbeans/modules/java/ui/wizard/JavaWizardIterator.java,v <-- JavaWizardIterator.java
new revision: 22.214.171.124; previous revision: 1.14
Fixed in trunk and Q-build branch QBE200301290100. Call of
setVisible(false) on scroll pane in DesktopPane caused another
Modified q-build branch:
*** Issue 30554 has been marked as a duplicate of this issue. ***
verified in [nb_dev](20030203)