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.
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
Reproducible in the main trunk.
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.
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.
Yes my code is running in AWT.
Vito, do you have any idea how can I fix it?
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.
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 ***