It searches for repository objects according to the specified parameters and displays found objects in the object navigator.
Command parameters are passed in the Data property. Executing the command requires to specify an array of the Variant type in this property, the elements of this array contain the following values:
Value type | Description |
Element 1: IMetabase | The repository, where search is executed. |
Element 2: IMetabaseObjectFindInfo | Parameters of repository objects search. |
Element 3: IMetabaseObjectDescriptor | The optional parameter containing description of the repository folder, which gets focus in the object navigator after the search is executed. If the element is not set, the focus is not moved in to the object navigator. |
None.
Executing the example requires a form with the Button1 button.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
MB: IMetabase;
Target: IUiCommandTarget;
Context: IUiCommandExecutionContext;
FindInfo: IMetabaseObjectFindInfo;
Data: Array;
Begin
MB := MetabaseClass.Active;
Target := WinApplication.Instance.GetPluginTarget("Std");
Context := Target.CreateExecutionContext;
FindInfo := MB.CreateFindInfo;
FindInfo.Text := "report";
FindInfo.AttributeEx := FindAttributeEx.Name Or FindAttributeEx.Ident;
FindInfo.WholeWordsOnly := False;
FindInfo.ScanNestedNamespaces := True;
Data := New Variant[2];
Data[0] := MB;
Data[1] := FindInfo;
Context.Data := Data;
Target.Execute("ShowFindObjects", Context);
End Sub Button1OnClick;
Clicking the button searches for all objects, which names or identifier contain the word "report". The list of found object is available in the Search Results window in the object navigator. It does not move to the object navigator after the search is executed.
See also: