Bug 28728 - selecting different sources via tabs "loses" cursor in Editor
selecting different sources via tabs "loses" cursor in Editor
Product: platform
Classification: Unclassified
Component: Text
PC Windows 3.1/NT
: P2 (vote)
Assigned To: mslama
: 13355 29607 29685 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2002-11-13 17:48 UTC by ssffleming
Modified: 2008-12-23 10:25 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT

Focus is requested from BasicTabbedPaneUI (2.04 KB, text/plain)
2003-02-10 12:03 UTC, Martin Roskanin
Suggested fix of CloneableEditor (1.29 KB, patch)
2003-02-10 16:50 UTC, mslama
Details | Diff
Patch (54.63 KB, application/octet-stream)
2003-02-10 16:52 UTC, mslama

Note You need to log in before you can comment on or make changes to this bug.
Description ssffleming 2002-11-13 17:48:34 UTC
Testing using Dublin build 021111_1 of EE on NT, JDK 1.4

Steps to reproduce:
open several text files in the source editor
edit some text switching back and forth
cursor position is lost when select tab for source file using mouse button #1

Note: this does not happen in Explorer...cursor position in Filesystems or other tree
is preserved when select different tabs
Comment 1 Martin Roskanin 2002-12-10 14:44:52 UTC
Focus appears in the first button of the editor toolbar. 
I am not able to find out who change the focus from editor pane to the
Adding keyword FOCUS
Comment 2 Martin Roskanin 2003-01-15 09:20:52 UTC
*** Issue 29607 has been marked as a duplicate of this issue. ***
Comment 3 Martin Roskanin 2003-01-16 15:40:37 UTC
*** Issue 29685 has been marked as a duplicate of this issue. ***
Comment 4 Martin Roskanin 2003-01-29 08:36:33 UTC
*** Issue 13355 has been marked as a duplicate of this issue. ***
Comment 5 Martin Roskanin 2003-02-10 12:03:29 UTC
Created attachment 8862 [details]
Focus is requested from BasicTabbedPaneUI
Comment 6 Martin Roskanin 2003-02-10 13:19:23 UTC
I am not sure whether the bug is in JDK or core/windowing system.
Reassigning to core for more investigation. 
Comment 7 mslama 2003-02-10 16:48:18 UTC
I think it is necessary to overwrite requestDefaultFocus() in
TopComponent: org.netbeans.modules.java.JavaEditor$JavaEditorComponent
 or in some superclass if it is enough to request default focus on
editor pane could be possible to overwrite it in some editor subclass
of TopComponent like CloneableEditor. I attach diff for
Comment 8 mslama 2003-02-10 16:50:16 UTC
Created attachment 8878 [details]
Suggested fix of CloneableEditor
Comment 9 mslama 2003-02-10 16:52:25 UTC
Created attachment 8879 [details]
Comment 10 mslama 2003-02-10 16:54:10 UTC
You can test patch, just put to lib/patches. It works fine for me.
Comment 11 Martin Roskanin 2003-02-10 17:09:23 UTC
Works for me too. Thanks Marek.
Tested on:
  Operating System      = Windows 2000 version 5.0 running on x86
  Java; VM; Vendor      = 1.4.1; Java HotSpot(TM) Client VM 1.4.1-b21;
Sun Microsystems Inc.
Comment 12 David Konecny 2003-02-11 09:07:06 UTC
I reviewed the patch and it seem to me OK.
Comment 13 mslama 2003-02-11 13:11:59 UTC
Fixed in CloneableEditor. Method requestDefaultFocus() is added to
assign focus to editor pane when requestDefaultFocus() is called for

openide/src/org/openide/text/CloneableEditor.java r.1.54
Comment 14 Marian Mirilovic 2004-03-05 22:32:37 UTC
verified in NB3.6 beta

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