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 90877 - Opening a result from Find usage window...
Summary: Opening a result from Find usage window...
Status: RESOLVED DUPLICATE of bug 70915
Alias: None
Product: editor
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-11 06:24 UTC by belur_1d
Modified: 2007-04-03 18:02 UTC (History)
2 users (show)

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 belur_1d 2006-12-11 06:24:47 UTC
Hi

1> Click on find usages for something
2> Click on some result for which the corr. java file is not open
3> Result-> view in editor is not where result is.

However cursor focus seems to be where the result is.If you move ur
cursor down,i can see the clicked result.

The problem is that when the file is not open, the IDE does not show me 
the result (especially if it is somewhere down, because it always shows the
beginning of the file to the user]

-Swaroop belur
Comment 1 Vitezslav Stejskal 2006-12-18 23:58:22 UTC
Reproducible in the main trunk.
Comment 2 Jan Becicka 2006-12-22 15:32:00 UTC
Yes it is reproducible, but it looks like bug in editor.
What refactoring do:

CloneableEditorSupport editSupp=bounds.getBegin().getCloneableEditorSupport();
editSupp.edit();
JEditorPane[] panes=editSupp.getOpenedPanes();
if (panes!=null) {
  panes[0].setCaretPosition(bounds.getEnd().getOffset());
  panes[0].moveCaretPosition(bounds.getBegin().getOffset());
  getTopComponent(panes[0]).requestActive();
}

I think, that it is threading issue. Is the document open right after I do
editSupp.edit()? It looks like it is not, although javadoc does not say, that
this call is asynchronous.
Comment 3 Vitezslav Stejskal 2006-12-27 23:06:25 UTC
Honzo, is your code running in AWT? If it's not then you should reschedule it to
AWT. You're right that it's a timing issue. Please read javadoc of
CloneableEditorSupport.edit, which points to CES.open, which says that the call
is automaticaly rescheduled to AWT, hence it's asynchronous and the TopComponent
is probably not opened yet at the time when you try to position the caret.
Comment 4 Jan Becicka 2007-01-02 13:08:44 UTC
Yes my code is running in AWT.
Comment 5 Jan Becicka 2007-02-14 16:42:07 UTC
Vito, do you have any idea how can I fix it?
Comment 6 Vitezslav Stejskal 2007-02-15 00:32:38 UTC
I am not sure, the symptoms sound similar to issue #70915. Is it affected by
code folding in any way? CCing Mila, he has been fixing #70915 and might have
some ideas.
Comment 7 Miloslav Metelka 2007-02-19 21:15:32 UTC
IMHO we can make this a dup of issue 70915. In fact I've used the find usages
scenario for reproducing of that issue as well.

*** This issue has been marked as a duplicate of 70915 ***