Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 27333 - Explorer Find Tool: Editor loses caret position
Explorer Find Tool: Editor loses caret position
Product: platform
Classification: Unclassified
Component: Text
All All
: P3 (vote)
: 3.x
Assigned To: David Konecny
: 26796 (view as bug list)
Depends on:
  Show dependency treegraph
Reported: 2002-09-15 10:23 UTC by bht
Modified: 2008-12-22 19:42 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT

Set dot stack trace after opening the java file from explorer (2.88 KB, text/plain)
2002-09-24 15:19 UTC, Martin Roskanin

Note You need to log in before you can comment on or make changes to this bug.
Description bht 2002-09-15 10:23:42 UTC
Expected behavior:
When using the find tool from explorer, it is
expected that the Java editor sets the caret
position on the line of the position that is shown
in the right half of the Search Results dialog
when one hits [Enter] on it.

What actually happens:
The file is opened but after apparently locating
for a fraction of a second (on a slow PC, 200MHz.
on faster PCs this might not be visible), the
caret position jumps to the top of the file and
stays there.

How to reproduce:
Concentrate on a single file.
Ensure that the file is not already open in the
In the Search Results dialog, press [Enter]while
the focus in on a line in the right half. This
error reproduces in about 60% of all cases so you
might have some difficulty in reproducing this.
It appears that this fails only with the [Enter]
key while it works with mouse double clicks.

Repeat the action by switching back to the Search
Results dialog and hitting [Enter] on the found
position line again.
Or use the mouse.
Comment 1 bht 2002-09-15 10:39:08 UTC
I have to correct one of my statements. The error DOES reproduce with
mouse double clicks also.
Comment 2 Martin Roskanin 2002-09-24 12:58:04 UTC
*** Issue 26796 has been marked as a duplicate of this issue. ***
Comment 3 Martin Roskanin 2002-09-24 15:16:57 UTC
It seems that the problem is in the openide. How to reproduce the
problem very simply:

just open some java file from explorer. Cursor should be at the class
declaration, but sometimes it jumps to the top of the document.
This can be reproduced even with editor module uninstalled.  
Reassigning to openide.

The problem:

CloneableEditor.setDot (around line 226) is performed twice. The first
time it sets the cursor correctly, secondly to the top of the
document. Please see attached stack trace.
Comment 4 Martin Roskanin 2002-09-24 15:19:52 UTC
Created attachment 7495 [details]
Set dot stack trace after opening the java file from explorer
Comment 5 Marian Mirilovic 2002-10-11 12:22:42 UTC
Platform/OS independent.
Comment 6 Marian Mirilovic 2002-12-06 17:18:16 UTC
reassigne to David K., new owner of editor
Comment 7 bht 2003-03-19 10:34:18 UTC
It looks like this has been partly fixed, possibly in relation to
issue 31750. Not bad!

However it's not 100% ok yet. Now the cursor position is right but the
focus does not work i.e. the find dialog keeps it and the source file
editor does not get it. This is in SDI mode, I don't know about MDI.

Try a result list with a few entries at least. The first time it works
but subsequent clicks on list entries further down the list don't
transfer focus to the editor.
Comment 8 David Konecny 2003-04-29 14:38:44 UTC
I tried it but I'm not able to reproduce it. I have the latest dev
build in SDI mode and Search result dialog showing several matches.
Whenever I double click some position in bottom right list box the
editor is correctly focused.

Anyway if there is problem like this then it is most probably in
utilities component and not in openide. Please file separate issue for
them. Thx.
Comment 9 bht 2003-04-29 21:19:31 UTC
This works for me(reporter), too. Thanks.
Comment 10 Lukas Hasik 2003-04-30 07:54:34 UTC

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