| Summary: | Add possibility to search and replace in Application Model editor | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] e4 | Reporter: | Dirk Fauth <dirk.fauth> | ||||
| Component: | UI | Assignee: | Project Inbox <e4.ui-inbox> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | azerr, Lars.Vogel, marco, nobody, steven, wim.jongman | ||||
| Version: | unspecified | Keywords: | helpwanted | ||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Dirk Fauth
Is it possible to employ the org.eclipse.ui.texteditor.FindReplaceAction here, or would the necessary Action have to be ported to the new model? I will try to find a solution here. Haven't looked at it in detail yet, but looking at the package it looks like it is dependent to Eclipse 3.x code. So IMHO it looks like it needs to be ported to the new model. In that case there is a bigger design decision involved in here, as there are already only two actions available (Undo and Redo) which do not require a Dialog. So I would need to introduce kind of a ported precedent, or is there already a bundle containing these ported actions? No chance for me starting this before these question is settled. We should definitely not add a dependency to org.eclipse.ui. So, what would be the right way to start porting the required Dialogs? In which plug-in would they belong? Steven did add / fixes some search functionality in the live application model editor in Bug 432555, Bug 432372. I mark this on as WORKSFORME. @Lars, I don't think you can search on the XMI tab yet. Thanks Steven for the clarification. Reopening. (In reply to Lars Vogel from comment #8) > Thanks Steven for the clarification. Reopening. Is it worth it to pull in dependency and use the existing eclipse XML editor? I have used it on other RCP projects. It has a bit of overhead but offers decent formatting and auto completion. (In reply to Steven Spungin from comment #9) > (In reply to Lars Vogel from comment #8) > > Thanks Steven for the clarification. Reopening. > > Is it worth it to pull in dependency and use the existing eclipse XML > editor? I have used it on other RCP projects. It has a bit of overhead but > offers decent formatting and auto completion. That would introduce a dependency to WTP, right? I think we should avoid that. (In reply to Lars Vogel from comment #10) > (In reply to Steven Spungin from comment #9) > > (In reply to Lars Vogel from comment #8) > > > Thanks Steven for the clarification. Reopening. > > > > Is it worth it to pull in dependency and use the existing eclipse XML > > editor? I have used it on other RCP projects. It has a bit of overhead but > > offers decent formatting and auto completion. > > That would introduce a dependency to WTP, right? I think we should avoid > that. I can understand that. How about a swing component with XML Editor Kit? (In reply to Steven Spungin from comment #11) > I can understand that. How about a swing component with XML Editor Kit? I think swing is even more evil than WTP. :-) There was an idea from Angelo Zerr to use the orion editor. (In reply to Wim Jongman from comment #13) > There was an idea from Angelo Zerr to use the orion editor. +1 for that. > There was an idea from Angelo Zerr to use the orion editor. Hi Lars, Wim, I would like to clarify some info about my idea about search and replace. At first, using orion editor will not fix the problem with Application Model editor. There is the same problem with the integration of orion editor in teh e4Tools : it doesn't provide search/replace capability. I think this bug should be renamed to "Add possibility to search and replace in any editor". Indeed org.eclipse.ui.texteditor.FindReplaceAction is linked to 3.x Editor, and today E4 provides several editor kind : * 3.x Editors * OrionEditorControl which uses SWT Browser to load JS Orion editor. * Application Model editor I had the same problem with my project CodeMirror-Eclipse https://github.com/angelozerr/CodeMirror-Eclipse where I embed CodeMirror in SWT Browser (and I have done the same idea for OrionEditorControl). CodeMirror gives some features for search/replace but I would like to use the SWT "Find/Replace" dialog to fill search/replace. It was impossible to use the existing FindReplaceAction, because my CodeMirror editor doesn't extend 3.x TextEditor. That's why I had to implement my own FindReplaceAction https://github.com/angelozerr/CodeMirror-Eclipse/blob/master/core/codemirror.eclipse.ui/src/codemirror/eclipse/ui/internal/search/WorkbenchFindReplaceAction.java (I have copied/pasted the original FindReplaceAction and adpat it for CodeMirror). The problem with this solution is that my search dialog is not shared between 3.x editors and my CodeMirror editors. So I think, FindReplaceAction should be removed from org.eclipse.ui.texteditor to E4 project or E4 should provide an E4FindReplaceService in order to any editor (3.x, Embed SWT Browser editor, Application Model editor) can benefit and contribute to search/replace features by using the same SWT "Find/Replace" dialog. Regards Angelo I refactored the XMI code in the model editor to a new class called XmiTab. At the top of the tab I added a text box that will cycle search the contents (highlight and scroll into view). See following screenshot for more details. Created attachment 244174 [details]
screenshot 1
(In reply to Steven Spungin from comment #17) > Created attachment 244174 [details] > screenshot 1 Cool. A good start. Does the cycle work with CTRL+K / CTRL+L just like in the Java editor. Every time the user hits enter the next one is found. I really don't want to do to much more until we get a better editor. It's sad that nobody has found an XML editor that does not have 'excess baggage'. My main goal with this was to put the code into a separate class, so eventually replacing the editor would be an easier task. The search field is just icing on the cake. Gerrit Review: https://git.eclipse.org/r/#/c/28394/ |