Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 201823 - Newly opened file not focused
Newly opened file not focused
Status: VERIFIED FIXED
Product: editor
Classification: Unclassified
Component: -- Other --
7.1
PC Linux
: P1 (vote)
: 7.1
Assigned To: Jaroslav Tulach
issues@editor
: REGRESSION
: 201916 202684 202811 202958 (view as bug list)
Depends on: 202656
Blocks: 200966 201808
  Show dependency treegraph
 
Reported: 2011-09-08 14:08 UTC by Jesse Glick
Modified: 2011-11-24 14:55 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2011-09-08 14:08:18 UTC
20110908-bd714e8cd36a, and a recent regression I think. When I open a source file, say from the Projects tab, the editor window is opened but does not receive focus - no caret is painted, and arrow keys just change the selection in Projects.

Furthermore, in the case of a Java source, no semantic highlighting is run, so code folds do not appear, etc.

Workaround is to press Ctrl-0 after opening a new file.
Comment 1 Jesse Glick 2011-09-08 14:08:51 UTC
Not really sure what category this is, or if it is in fact for openide.text.
Comment 2 Vladimir Voskresensky 2011-09-08 16:20:44 UTC
Please, investigate it.
Most probably due to this issue in C++ we have lost all HL at all. After reopening file HL does not appear. EditorRegistry contains extra elements. see issue #201808
Comment 3 Miloslav Metelka 2011-09-09 15:07:10 UTC
Apparently EditorRegistry.FocusL.focusGained() does not get called in recent builds while it gets called properly in older builds.

CloneableEditor.requestFocusInWindow() gets called in both builds by MultiViewPeer.requestFocusInWindow() and that one by MultiViewCloneableTopComponent.requestFocusInWindow()

CE.requestFocusInWindow() looks like this:

    public boolean requestFocusInWindow() {
        super.requestFocusInWindow();

        if (pane != null) {
            if ((customComponent != null) && !SwingUtilities.isDescendingFrom(pane, customComponent)) {
                return customComponent.requestFocusInWindow();
            } else {
                return pane.requestFocusInWindow();
            }
        }

        return false;
    }

Problem is that when the method gets called the pane.getParent() == null in new builds while in older builds the parent is non-null. Therefore the method won't work and the focus is not transferred.
Yardo, since you've done some changes in multiview recently, don't you know what could be wrong? Thanks.
Comment 4 Jesse Glick 2011-09-09 17:24:39 UTC
Blocking a P1.

I am guessing caused by 5906c9488e61.
Comment 5 Jesse Glick 2011-09-09 17:31:43 UTC
(In reply to comment #4)
> I am guessing caused by 5906c9488e61.

Confirmed by backing out the core.multiview part of that changeset and noting that the editor is focused normally as a result.

So I guess someone should backout the change and reopen bug #200966. It is more my time zone, but as I am going on vacation soon I do not want to make "big" changes.
Comment 6 Jesse Glick 2011-09-09 17:51:56 UTC
jtulach has poor connectivity right now so backing out on his behalf: core-main #b31edd9ddcb9
Comment 7 Quality Engineering 2011-09-10 14:27:31 UTC
Integrated into 'main-golden'
Changeset: http://hg.netbeans.org/main-golden/rev/b31edd9ddcb9
User: Jesse Glick <jglick@netbeans.org>
Log: Backed out changeset 5906c9488e61
Hotfix for #201823.
Comment 8 Milutin Kristofic 2011-09-13 11:40:14 UTC
*** Bug 201916 has been marked as a duplicate of this bug. ***
Comment 9 Vladimir Voskresensky 2011-09-26 14:34:48 UTC
re-introduced by fix for issue #200966
http://hg.netbeans.org/cnd-main/rev/bb3c22be8a00
Comment 10 Jesse Glick 2011-09-26 17:41:58 UTC
(In reply to comment #9)
> re-introduced by fix for issue #200966
> http://hg.netbeans.org/cnd-main/rev/bb3c22be8a00

...and apparently backed out: a8b2c5f886fb.
Comment 11 Vladimir Voskresensky 2011-09-26 18:33:47 UTC
does not repeat after backout, closing again
Comment 12 Milutin Kristofic 2011-09-27 08:27:31 UTC
*** Bug 202684 has been marked as a duplicate of this bug. ***
Comment 13 Milutin Kristofic 2011-09-29 09:26:46 UTC
*** Bug 202811 has been marked as a duplicate of this bug. ***
Comment 14 Jan Lahoda 2011-10-03 10:42:27 UTC
*** Bug 202958 has been marked as a duplicate of this bug. ***
Comment 15 Jiri Prox 2011-11-24 14:55:45 UTC
verified
Product Version: NetBeans IDE 7.1 RC1 (Build 201111232200)
Java: 1.7.0_02; Java HotSpot(TM) 64-Bit Server VM 22.0-b10
System: Windows 7 version 6.1 running on amd64; Cp1250; en_US (nb)
User directory: C:\Users\jprox\.netbeans\7.1rc1
Cache directory: C:\Users\jprox\.netbeans\7.1rc1\var\cache


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo