Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 2c1b8aa202a1122f077420003b301d2b7fe22b7a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
In this documentation, we will use this UML model to illustrate the search features. 

[[image:search-model1.png]]

=Search elements=
The search feature of Papyrus helps the user to find elements in the models. The user can choose between a text search and an OCL search.

As it is shown in the following image the user chooses the query kind he wants to use: 

[[image:query_kind.png]] 

=Text search=

The user can do a simple search or an advanced search.
The user makes his choice in the A area of the following image which represents the text search dialog.

[[image:search_kind.png]] 

==Simple search==
The following image illustrates a simple text search dialog:

[[image:simple_search.png]] 

* The user can specify the string pattern he/she is looking for in the A area. 
** Check the "Case sensitive" if case must be considered. 
** The user may also want to use regular expression to express the query. Then check "Regular expression" button. The regular expression must respect Java Regex.
*The user chooses whether he wants to search only in the name attribute of instances of UML::NamedElement or in all string attributes of instances of UML metaClasses, in B area.

For instance, the following search: 

[[image:C-search.png]]

will provide the following results: 

[[image:C-result.png]]

The comment is not returned because we were note looking for all string attributes. 

However, this search:

[[image:comment-search.png]]

will return : 

[[image:comment-result.png]]

==Advanced search==
The following image shows the advanced text search dialog.

[[image:advanced_search.png]]

* As in the simple search the user can specify the string pattern he/she is looking for, and may indicate if he uses regular expression or if he wants to consider case, in the A area. 
* The user can filter the types of elements to search the string pattern in by selecting the UML metaClasses or applied stereotypes in area B . He can also choose in which attributes he wants to do the research.
* In the C area, the user can select all subelements of the actual selected element. For example, if the user selects "NamedElement" and clicks on "Select subelements",all metaClasses which inherit of UML::NamedElement will be checked. If the name attribute of "NamedElement" is checked and the user selects "NamedElement" and then clicks on "Select subelements",all instances of UML::NamedElement and their name attribute will be checked.


In the following image we search the pattern "my"  in the attribute body of the metaClass "Comment". The research will give us all the instances of "Comment" having an attribute body matching with the string pattern. 

[[Image:body_search.png]]

The result will be

[[Image:body_result.png]]


If the user select a stereotype or an UML metaClass without indicating a string pattern, the research will give him all the instances of the metaClasses he checked and all the elements having the applied stereotypes he checked.

For example the result of this research:

 [[Image:requirement_search.png]]
 
will be
 
 [[Image:requirement_result.png]]
 
=OCL search=
    
The following image shows an OCL search dialog

[[Image:OCL.png]]

The user writes his OCL query in the A area.
The scope must be "Selected resources" if the user wants to do this kind of query.


=Replace String=
Should the user want to replace the matches of your search with another string, he/she may click on the "Replace" button in the search dialog. A new dialog will popup:

[[Image:replace.png]]

As mentioned on the dialog, the replace action is mostly undoable. Matches that are found in a resource that is not opened in an editor will be replaced and will be save so that the user cannot undo the modification. 

=Filter=
The user can filter the results of the search by selecting the types of the elements he/she wants to show.

For instance, on the following search (we use the model 1): 

[[image:a-search.png]]

the user may filter the results by clicking on the icon identified in a red rectangle in the following picture: 

[[image:a-results.png]]

this will open a new dialog where the user can select the metaclasses he/she want to show: 

[[image:filter.png]]

then, the result page will show only the matches of the selected type: 

[[image:my-filtered.png]]

If the user wants to remove this filtering, he/she may click on the Filters button as illustrated in previous picture. This will open the following dialog: 

[[image:select-filters.png]]

----
This work is developed by [http://www-list.cea.fr CEA LIST] and sponsored by [http://www.ericsson.com Ericsson] in the context of Polarsys [http://wiki.eclipse.org/Polarsys]

Back to the top