Community
Participate
Working Groups
I20070516-0010. The current approach requires clients to duplicate the rather complicated code of the org.eclipse.search.internal.ui.text.EditorOpener. We should either make this class API or provide an easier mechanism for clients. Internal note: while the Search opener throw the PartInitException all the way up it is catched in the JavaSearchEditorOpener.
I would like seeing EditorOpener made into API.
>I would like seeing EditorOpener made into API. What's your exact use case?
(In reply to comment #2) > >I would like seeing EditorOpener made into API. > What's your exact use case? I am implementing a new type of search. I have subclassed AbstractTextSearchViewPage. I would like to implement the method showMatch(). If this is not implemented, the start/next buttons do not do anything. I saw that EditorOpener does a lot of this stuff for me. Currently, I'm referencing this internal API, but I would like to make it real API. Alternatively, you don't need to make EditorOpener real API. What if Match implemented IAdaptable? The AbstractTextSearchViewPage implementation of showMatch could ask for an IResource adapter from the Match, and then use (an internal field holding) the EditorOpener to open the resource. It really has all the other information it needs (offset/length/activate) - the only think missing is the IResource. -- a little off topic... -- The EditorOpener could also be used via a double click listener on the results viewer. Right now I have to install my own. A default one could have been provided via AbstractTextSearchViewPage.
Min, would it be enough if we added the following two methods: AbstractTextSearchViewPage.open(IWorkbenchPage, IFile, boolean) AbstractTextSearchViewPage.openAndSelect(IWorkbenchPage, IFile, int, int, boolean) ?
ping.
Added API in HEAD but did not rework all the existing code (no time and no immediate benefit). Min, please file a new bug report if that's enough for you. Fixed in HEAD. Available in builds >= I20100125-1300.
.
I reviewed the code in HEAD. Thank you for resolving this defect. The new API works for me.