| Summary: | Abstract explorer like in search/replace | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Malgorzata Janczarska <malgorzata.tomczyk> |
| Component: | Client | Assignee: | libing wang <libingw> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 0.5 | ||
| Target Milestone: | 2.0 RC1 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
| Bug Depends on: | 398967 | ||
| Bug Blocks: | 382493 | ||
|
Description
Malgorzata Janczarska
Triage in 2.0M1. OK, finally I got off the hook of undojo stuff. Now trying to figure out a way to best suit Gosia's case. Gosia, one thing to mention, the search explorer can handle regEx replace withot interfering the server. If your case uses regEx, it will be simpler. At least the Model does not have to be exposed. Gosia, I was trying to debug the Externalizer but it hangs in nonnlsSearchUtil.js. I could not debug to the searchExplorer level to see what kind of model is returned. I read your code for a little bit, Here is my thought. 1. Regarding the model, you can create your own mode and pass it to the replace widget. You model basically has to follow this contract: a. You will have to provide several functions that is mandatory to the explorer and renderer. There were a lot wrapper functions before in the model level, which I would like to put into some sort of internal helper functions. By doing that, we will know what is exactly needed from a pure model point of view. And it should end up with very few functions that you have to implement. b. You will have to provide a getReplacedContent callback, which will be called whenever the first time a file is selected and compare view requires that. c. You will have to provide a writeIncrementalNewContent callback, which is the most important part of the replace widget. All the checked/unchecked flag is set back to the model by the widget. So this writeIncrementalNewContent has to write the whole selected files and selected matches. 2. Regarding the renderer: I think if we have enough info in the model, the render has to knwo what has to be rendered. 3.Regarding the command I am not quite sure what that means. regarding the amount of changes, this might be an RC1 candidate. But lets see if we can make it in M2. Given I still have some other minor bugs I will fix today, moving this to RC1. first draft at http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=7a27c796dfeb2e0477c57159043212d749a6b682 fixed with http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=e2a5666af7cfb3f6460f40f55661f97076e38b5a. Now you only need to implement the searchModel. You get the renderer and explorer by free. Please see searchModel.js and strExternalizerModel.js for API docs. Look for "requied function". I made the final change on how the "write all replaced files" is called in a generic way.
By doing this, we discarded the previous complicated parameters.
Now the explorer only needs to call something like:
theModel.writeReplacedContents(reportList).then(function(){
//Do report UI based on the filled up reportList.
});
As all the models (currently search or externalizer model) know what should be written by their own and just fill out the report list. The explorer takes care of rendering the report generically.
|