Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Papyrus/Mars Work Description/Improvments/Search UI
The Papyrus search UI is a dialog integrated into the Eclipse search interfaces. Its role is to let the user search for elements and attributes in the UML models and diagrams created with Papyrus.
There are two kinds queries that the user can provide: text query or OCL query. For each kind of query, the user can use a simple search mode, or an advanced search mode. In the simple search mode, the user must search among all elements and attributes in the model. In the advanced search mode, the user can choose the types of elements and attributes to search for, as well as element stereotypes.
The improvement work done for Mars focuses mainly on the advanced search mode. Along with bug fixes, the new advanced search mode of Mars improves the UI for stereotypes displaying, and adds new options to search for stereotyped elements.
The following video shows a demo of the new search UI in action: Papyrus Search Improvements Video
Frontend Changes and Improvements
The advanced search UI has been improved for stereotypes searching. The new UI is the following:
The major zones of the new UI are the following:
- Zone A: This is the text query and its options. The main difference in Mars is the addition of the explanatory text.
- Zone B: This filtered checkbox tree viewer shows the UML elements that the user wants to search for. The major difference concerns the selection of elements. When an element is selected, all of its attributes are selected. When the last attribute of an element is deselected, the element is deselected. Selection bugs, when the UI refreshes for any reason, have been fixed.
- Zone C: This is a new filtered checkbox tree viewer. It shows the stereotypes that are applied in the selected resources, i.e. the selected models for the search. Attributes of stereotypes also appear. The behavior of the tree viewer is the same as the behavior of the zone B tree viewer.
- Zone D: These two new checkboxes add options to search for stereotyped elements. When "Enforce all and only selected stereotypes are applied" is checked, UML elements must and must only have the selected stereotypes applied to be eligible for search. When "Enforce at least one stereotype is applied" is checked, a UML element must at least have one selected stereotype applied, to be eligible for search. If none of the checkboxes are checked, then stereotyped elements are returned, but also any UML element selected by the user in zone B, even if they do not have a selected stereotype applied.
- Zone E: Buttons to select/deselect all stereotypes in zone D have been added. Bugs on "Refresh lists" button have been fixed.
Backend Changes and Improvements
Backend improvements have been made on the performance of the search functionality.
The performance of the search operations has been improved for stereotypes searching. Stereotype collecting operations have been greatly optimized. Utility methods of Ecore are not called anymore since they demand a lot of underlayered computing.
The performance of results display is another issue since display operations are very demanding. To lessen the load of display operations, results display is now flattened: an element is displayed with its qualified name instead of a hierarchical display of all of its parents.
To further reduce perceived lag, when displaying results, an asynchronous display of results is also introduced. The results are now displayed progressively after the search. The main difference with the old search UI, is that now the UI does not hang when there are a lot of results to display (e.g. more than 100). For small samples of results to display, the behavior is not impacted, and results are still preceived as displayed instantly.
A progress monitor has been added so the user can check the progress of the search operations.
Finally several bugs have been fixed. They are referenced in the Bugzilla References section of this page.
The following bugs are fixed:
- Problem: Index out of bound exception when searching for some strings.
- Solution: Fixed the computation of offsets and length for matches found in a string.
- Problem: Attributes of elements or stereotypes are hidden after the refresh button is clicked, in some instances.
- Solution: Fixed UI refreshing backend.
- Problem: The UI refreshes when the user selects the same search mode he/she is already in.
- Solution: UI now remembers search mode.
- Problem: The user could select an element, but its attributes aren't selected automatically.
- Solution: Selecting an element now selects all of its attributes. Deselecting the last attribute of an element also deselects the element. Backend bugs were also fixed to reflect correctly the user selection.
- Problem: Explanatory text above search UI query textbox was not shown.
- Solution: Explanatory text is now shown and more explicit on effects of leaving the text query blank.
- Problem: Search is performed in whole workspace when a project folder is selected.
- Solution: Fixed scope collection when a project folder is selected.
- Problem: Search is not performed on correct resource when active diagram is selected as resource.
- Solution: Get the model of the active diagram as resource to search in
- Problem: The filter dialog box shows duplicate stereotypes when the same stereotype is applied in different projects.
- Solution: Fixed stereotype comparison for both display and actual filtering action.
- Problem: When searching in several models (e.g. all workspace models), all or some searched models, with diagrams, are loaded into the current model's model explorer.
- Solution: Fixed by creating a composite query when several resources are selected as the search scope.
- Problem: User help documentation not update to date
- Solution: Updated
- Problem: Stereotypes must be collected for display but the operation takes too long.
- Solution: Optimized by not having to go through whole model but the correct resource content list.
- Problem: Results display hangs the UI and progress is not monitored and displayed to the user.
- Solution: Display is now asynchronuous and the progress is shown to the user.
- Problem: Flat display of results, instead of hierarchical, for performance issues
- Solution: Display flat results with qualified names
- Problem: Non-string attributes are displayed as empty strings. Some attribute matches are not displayed when they have the same offset and length because their hashcode is then the same.
- Solution: Fixed hashcode method of attribute match and display non-string attributes correctly (i.e. name of named element)
- Problem: User should be able to search for elements with only at least one stereotype applied (i.e. OR operator)
- Solution: Added a checkbox for this option
- Problem: Stereotypes list in advanced UI does not show icons. Furthermore the display of some inherited stereotypes is bugged.
- Solution: Children collecting was fixed
- Problem: The user could only search for primitive attributes.
- Solution: Search for any attribute type. Name of named element used for search if the attribute is a type that's a sub-type of named element.
- Problem: Tooltips for buttons should be displayed to help the user.
- Solution: Added
- Problem: The advanced search UI grouped stereotypes and UML types together. Furthermore all stereotypes of applied profiles were displayed. This makes the list too big. The user may also want to separate stereotypes from UML types.
- Solution: Created another list, next to the UML types list, for stereotypes. Only applied stereotypes are displayed in this list.
- Problem: Some stereotypes that aren't applied in actual Papyrus projects are shown.
- Solution: Fixed with new UML visitor
Ongoing and Future Work
- Integration of "refactoring" as "replace" functionality of the search UI
- Further performance improvements: indexation, model loading, search history
- Sub-types selection for stereotypes.
- Display only UML types (and their sub-types?) that are actually used in selected models. [Under discussion]
- Keep previous search options. [Under discussion]
- Show which profiles to display stereotypes from in search options [Under discussion]
- Boolean chart [Under discussion]
- Bug 459421 - Advanced search sub-categories (attributes) not visible when filtering elements: Filtering elements does not show their attributes that do not match the filter.
- Bug 462827 - Searching in any view and resource loading consistency: Consistency in resource loading for search