diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/preferences/IPreferenceConstants.java b/com.archimatetool.editor/src/com/archimatetool/editor/preferences/IPreferenceConstants.java index 461a64502..eaadc9207 100644 --- a/com.archimatetool.editor/src/com/archimatetool/editor/preferences/IPreferenceConstants.java +++ b/com.archimatetool.editor/src/com/archimatetool/editor/preferences/IPreferenceConstants.java @@ -175,4 +175,13 @@ public interface IPreferenceConstants { // Single column layout in Properties View String PROPERTIES_SINGLE_COLUMN = "propertiesSingleColumn"; + + // Search Filter + String SEARCHFILTER_NAME = "searchFilterName"; + String SEARCHFILTER_DOCUMENTATION = "searchFilterDocumentation"; + String SEARCHFILTER_PROPETY_VALUES = "searchFilterPropertyValues"; + String SEARCHFILTER_VIEWS = "searchFilterViews"; + String SEARCHFILTER_SHOW_ALL_FOLDERS = "searchFilterShowAllFolders"; + String SEARCHFILTER_MATCH_CASE = "searchFilterMatchCase"; + String SEARCHFILTER_USE_REGEX = "searchFilterUseRegex"; } diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/preferences/PreferenceInitializer.java b/com.archimatetool.editor/src/com/archimatetool/editor/preferences/PreferenceInitializer.java index 612d1005a..fccaa0a98 100644 --- a/com.archimatetool.editor/src/com/archimatetool/editor/preferences/PreferenceInitializer.java +++ b/com.archimatetool.editor/src/com/archimatetool/editor/preferences/PreferenceInitializer.java @@ -165,5 +165,7 @@ public void initializeDefaultPreferences() { store.setDefault(UPDATE_URL, "https://www.archimatetool.com/archi-version.txt"); store.setDefault(PROPERTIES_SINGLE_COLUMN, false); + + store.setDefault(SEARCHFILTER_NAME, true); } } diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/Messages.java b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/Messages.java index 10fdb39d3..e538f4edf 100644 --- a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/Messages.java +++ b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/Messages.java @@ -31,8 +31,28 @@ public class Messages extends NLS { public static String SearchWidget_17; + public static String SearchWidget_18; + + public static String SearchWidget_19; + public static String SearchWidget_2; + public static String SearchWidget_20; + + public static String SearchWidget_21; + + public static String SearchWidget_22; + + public static String SearchWidget_23; + + public static String SearchWidget_24; + + public static String SearchWidget_25; + + public static String SearchWidget_26; + + public static String SearchWidget_27; + public static String SearchWidget_3; public static String SearchWidget_4; diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchFilter.java b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchFilter.java index 2834438fa..67f4861a3 100644 --- a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchFilter.java +++ b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchFilter.java @@ -7,6 +7,8 @@ import java.util.HashSet; import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; @@ -15,6 +17,7 @@ import com.archimatetool.editor.utils.StringUtils; import com.archimatetool.model.IArchimateConcept; +import com.archimatetool.model.IArchimateModel; import com.archimatetool.model.IDiagramModel; import com.archimatetool.model.IDocumentable; import com.archimatetool.model.IFolder; @@ -35,29 +38,36 @@ public class SearchFilter extends ViewerFilter { private String fSearchText = ""; - private boolean fFilterName = true; // default to true - private boolean fFilterDocumentation; - - private Set fConceptsFilter = new HashSet<>(); - private Set fPropertiesFilter = new HashSet<>(); - private Set fSpecializationsFilter = new HashSet<>(); - private boolean fFilterViews = false; - - private boolean fShowAllFolders = false; + private boolean filterName; + private boolean filterDocumentation; + private boolean filterPropertyValues; + private boolean filterViews; + + private boolean showAllFolders; + private boolean matchCase; + private boolean useRegex; + + private Set conceptsFilter = new HashSet<>(); + private Set propertyKeyFilter = new HashSet<>(); + private Set specializationsFilter = new HashSet<>(); + + private Matcher regexMatcher; SearchFilter() { } void setSearchText(String text) { fSearchText = text; + createRegexMatcher(); } void reset() { setFilterOnName(true); setFilterOnDocumentation(false); + setFilterOnPropertyValues(false); resetConceptsFilter(); - resetPropertiesFilter(); + resetPropertyKeyFilter(); resetSpecializationsFilter(); setFilterViews(false); } @@ -92,7 +102,7 @@ private boolean isElementVisible(Object element) { } } - if(isShowAllFolders()) { + if(getShowAllFolders()) { return true; } } @@ -116,27 +126,38 @@ public boolean matchesFilter(Object element) { } // Name, Documentation or Property - if(isFilteringName() || isFilteringDocumentation() || isFilteringPropertyKeys()) { + if(isFilteringName() || isFilteringDocumentation() || isFilteringPropertyKeys() || isFilteringPropertyValues()) { show &= (isFilteringName() && shouldShowObjectWithName(element)) || (isFilteringDocumentation() && shouldShowObjectWithDocumentation(element)) - || (isFilteringPropertyKeys() && shouldShowProperty(element)); + || ((isFilteringPropertyKeys() || isFilteringPropertyValues()) && shouldShowObjectWithProperty(element)); } return show; } private boolean shouldShowConcept(Object element) { - return fConceptsFilter.contains(((EObject)element).eClass()); + return conceptsFilter.contains(((EObject)element).eClass()); } + private boolean shouldShowSpecialization(Object element) { + if(element instanceof IArchimateConcept concept) { + for(IProfile profile : concept.getProfiles()) { + for(IProfile p : specializationsFilter) { + // Could be matching Profile name/class in different models + if(ArchimateModelUtils.isMatchingProfile(p, profile)) { + return true; + } + } + } + } + + return false; + } + private boolean shouldShowObjectWithName(Object element) { if(element instanceof INameable nameable) { String name = StringUtils.safeString(nameable.getName()); - - // Normalise in case of multi-line text - name = StringUtils.normaliseNewLineCharacters(name); - - return name.toLowerCase().contains(fSearchText.toLowerCase()); + return matchesString(name); } return false; @@ -145,129 +166,235 @@ private boolean shouldShowObjectWithName(Object element) { private boolean shouldShowObjectWithDocumentation(Object element) { if(element instanceof IDocumentable documentable) { String text = StringUtils.safeString(documentable.getDocumentation()); - return text.toLowerCase().contains(fSearchText.toLowerCase()); + return matchesString(text); + } + + // "Purpose" is really "Documentation" + if(element instanceof IArchimateModel model) { + String text = StringUtils.safeString(model.getPurpose()); + return matchesString(text); } return false; } - private boolean shouldShowSpecialization(Object element) { - if(element instanceof IArchimateConcept concept) { - for(IProfile profile : concept.getProfiles()) { - for(IProfile p : fSpecializationsFilter) { - // Could be matching Profile name/class in different models - if(ArchimateModelUtils.isMatchingProfile(p, profile)) { - return true; + private boolean shouldShowObjectWithProperty(Object element) { + if(element instanceof IProperties properties) { + for(IProperty property : properties.getProperties()) { + // If filtering on property keys + if(isFilteringPropertyKeys()) { + // And this property has that filtered key + if(propertyKeyFilter.contains(property.getKey())) { + // If filtering on property value match on that else show the element + return isFilteringPropertyValues() ? matchesString(property.getValue()) : true; } } + // Else match on property value + else if(matchesString(property.getValue())) { + return true; + } } } - + return false; } - private boolean shouldShowProperty(Object element) { - if(element instanceof IProperties properties) { - for(IProperty property : properties.getProperties()) { - if(fPropertiesFilter.contains(property.getKey())) { - return hasSearchText() ? property.getValue().toLowerCase().contains(fSearchText.toLowerCase()) : true; - } + private boolean matchesString(String str) { + if(str == null || str.length() == 0) { + return false; + } + + if(getUseRegex()) { + return matchesRegexString(str); + } + + if(getMatchCase()) { + return str.contains(fSearchText); + } + + return str.toLowerCase().contains(fSearchText.toLowerCase()); + } + + private boolean matchesRegexString(String searchString) { + return regexMatcher != null ? regexMatcher.reset(searchString).find() : false; + } + + private void createRegexMatcher() { + regexMatcher = null; + + if(getUseRegex() && hasSearchText()) { + try { + // Create a Matcher from the search text Pattern that can be re-used + Pattern pattern = Pattern.compile(fSearchText, getMatchCase() ? 0 : Pattern.CASE_INSENSITIVE); + regexMatcher = pattern.matcher(""); + } + catch(Exception ex) { } } - - return false; } public boolean isFiltering() { - return isFilteringName() || isFilteringDocumentation() || isFilteringConcepts() || isFilteringPropertyKeys() || isFilteringSpecializations() || isFilteringViews(); + return isFilteringName() + || isFilteringDocumentation() + || isFilteringConcepts() + || isFilteringPropertyKeys() + || isFilteringPropertyValues() + || isFilteringSpecializations() + || isFilteringViews(); } + private boolean hasSearchText() { + return fSearchText.length() > 0; + } + + boolean isValidSearchString() { + // If we are using regex and we have a matcher then it's valid + if(getUseRegex() && hasSearchText()) { + return regexMatcher != null; + } + + return true; + } + + // ===== Name + + void setFilterOnName(boolean set) { + filterName = set; + } + + boolean getFilterOnName() { + return filterName; + } + private boolean isFilteringName() { - return fFilterName && hasSearchText(); + return getFilterOnName() && hasSearchText(); } + // ===== Documentation + + void setFilterOnDocumentation(boolean set) { + filterDocumentation = set; + } + + boolean getFilterOnDocumentation() { + return filterDocumentation; + } + private boolean isFilteringDocumentation() { - return fFilterDocumentation && hasSearchText(); + return getFilterOnDocumentation() && hasSearchText(); } - private boolean isFilteringConcepts() { - return !fConceptsFilter.isEmpty(); + // ===== Property Values + + void setFilterOnPropertyValues(boolean set) { + filterPropertyValues = set; } - private boolean isFilteringPropertyKeys() { - return !fPropertiesFilter.isEmpty(); + boolean getFilterOnPropertyValues() { + return filterPropertyValues; } - private boolean isFilteringSpecializations() { - return !fSpecializationsFilter.isEmpty(); + private boolean isFilteringPropertyValues() { + return getFilterOnPropertyValues() && hasSearchText(); } - private boolean hasSearchText() { - return fSearchText.length() > 0; - } + // ===== Property Keys - void setFilterOnName(boolean set) { - fFilterName = set; + void addPropertyKeyFilter(String key) { + propertyKeyFilter.add(key); } - void setFilterOnDocumentation(boolean set) { - fFilterDocumentation = set; + void removePropertyKeyFilter(String key) { + propertyKeyFilter.remove(key); } + + Set getPropertyKeyFilter() { + return propertyKeyFilter; + } + + void resetPropertyKeyFilter() { + propertyKeyFilter.clear(); + } + + boolean isFilteringPropertyKeys() { + return !propertyKeyFilter.isEmpty(); + } + + // ===== Concepts void addConceptFilter(EClass eClass) { - fConceptsFilter.add(eClass); + conceptsFilter.add(eClass); } void removeConceptFilter(EClass eClass) { - fConceptsFilter.remove(eClass); + conceptsFilter.remove(eClass); } void resetConceptsFilter() { - fConceptsFilter.clear(); + conceptsFilter.clear(); } - void addPropertiesFilter(String key) { - fPropertiesFilter.add(key); - } - - void removePropertiesFilter(String key) { - fPropertiesFilter.remove(key); - } - - Set getPropertiesFilter() { - return fPropertiesFilter; + boolean isFilteringConcepts() { + return !conceptsFilter.isEmpty(); } - void resetPropertiesFilter() { - fPropertiesFilter.clear(); - } + // ===== Specializations void addSpecializationsFilter(IProfile profile) { - fSpecializationsFilter.add(profile); + specializationsFilter.add(profile); } void removeSpecializationsFilter(IProfile profile) { - fSpecializationsFilter.remove(profile); + specializationsFilter.remove(profile); } void resetSpecializationsFilter() { - fSpecializationsFilter.clear(); + specializationsFilter.clear(); } + boolean isFilteringSpecializations() { + return !specializationsFilter.isEmpty(); + } + + // ===== All Folders + void setShowAllFolders(boolean set) { - fShowAllFolders = set; + showAllFolders = set; } - boolean isShowAllFolders() { - return fShowAllFolders; + boolean getShowAllFolders() { + return showAllFolders; } + // ===== Views + void setFilterViews(boolean set) { - fFilterViews = set; + filterViews = set; } boolean isFilteringViews() { - return fFilterViews; + return filterViews; + } + + // ===== Match Case + + void setMatchCase(boolean set) { + matchCase = set; + createRegexMatcher(); + } + + boolean getMatchCase() { + return matchCase; + } + + // ===== Regex + + void setUseRegex(boolean set) { + useRegex = set; + createRegexMatcher(); } + boolean getUseRegex() { + return useRegex; + } } \ No newline at end of file diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchWidget.java b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchWidget.java index a1f178c67..dfd9e4018 100644 --- a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchWidget.java +++ b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/SearchWidget.java @@ -31,6 +31,7 @@ import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.window.Window; import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Color; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Composite; @@ -73,7 +74,11 @@ public class SearchWidget extends Composite { private IAction fActionFilterName; private IAction fActionFilterDocumentation; + private IAction fActionFilterPropertyValues; private IAction fActionFilterViews; + private IAction fActionShowAllFolders; + private IAction fActionMatchCase; + private IAction fActionUseRegex; private List fConceptActions = new ArrayList<>(); @@ -83,6 +88,8 @@ public class SearchWidget extends Composite { private static int TIMER_DELAY = 600; + private static Color ERROR_COLOR = new Color(255, 0, 0); + /** * Hook into the global edit Action Handlers and null them when the text control has the focus */ @@ -173,12 +180,8 @@ private void createSearchTextWidget() { fKeyDelayTimer.schedule(new TimerTask() { @Override public void run() { - Display.getDefault().syncExec(() -> { // This has to run in the UI thread - if(!fSearchText.isDisposed()) { - fSearchFilter.setSearchText(fSearchText.getText()); - refreshTree(); - } - }); + // This has to run in the UI thread + Display.getDefault().syncExec(() -> updateSearch()); } }, TIMER_DELAY); }); @@ -186,8 +189,7 @@ public void run() { // Search on Return key press else { fSearchText.addListener(SWT.DefaultSelection, event -> { - fSearchFilter.setSearchText(fSearchText.getText()); - refreshTree(); + updateSearch(); }); } @@ -195,6 +197,23 @@ public void run() { fSearchText.addListener(SWT.Activate, textControlListener); fSearchText.addListener(SWT.Deactivate, textControlListener); } + + private void updateSearch() { + if(!fSearchText.isDisposed()) { + fSearchFilter.setSearchText(fSearchText.getText()); + setValidSearchTextHint(); + refreshTree(); + } + } + + /** + * If we're using regex check that it's valid regex and set color to red and tooltip if not + */ + private void setValidSearchTextHint() { + boolean validSearchText = fSearchFilter.isValidSearchString(); + fSearchText.setForeground(validSearchText ? null : ERROR_COLOR); + fSearchText.setToolTipText(validSearchText ? null : Messages.SearchWidget_20); + } private void createToolBar() { // Create a Toolbar @@ -210,7 +229,7 @@ public ImageDescriptor getImageDescriptor() { }; toolBarmanager.add(dropDownAction); - // Filter on Name + // Name fActionFilterName = new Action(Messages.SearchWidget_0, IAction.AS_CHECK_BOX) { @Override public void run() { @@ -219,10 +238,9 @@ public void run() { }; }; fActionFilterName.setToolTipText(Messages.SearchWidget_1); - fActionFilterName.setChecked(true); // default is true for name dropDownAction.add(fActionFilterName); - // Filter on Documentation + // Documentation fActionFilterDocumentation = new Action(Messages.SearchWidget_2, IAction.AS_CHECK_BOX) { @Override public void run() { @@ -233,21 +251,33 @@ public void run() { fActionFilterDocumentation.setToolTipText(Messages.SearchWidget_3); dropDownAction.add(fActionFilterDocumentation); - // Properties + // Property Values + fActionFilterPropertyValues = new Action(Messages.SearchWidget_21, IAction.AS_CHECK_BOX) { + @Override + public void run() { + fSearchFilter.setFilterOnPropertyValues(isChecked()); + refreshTree(); + }; + }; + fActionFilterPropertyValues.setToolTipText(Messages.SearchWidget_22); + dropDownAction.add(fActionFilterPropertyValues); + + // Property Keys IAction actionProperties = new Action(Messages.SearchWidget_5, IAction.AS_PUSH_BUTTON) { @Override public void run() { UserPropertiesKeySelectionDialog dialog = new UserPropertiesKeySelectionDialog(getShell(), getAllUniquePropertyKeys(), - new ArrayList<>(fSearchFilter.getPropertiesFilter())); + new ArrayList<>(fSearchFilter.getPropertyKeyFilter())); if(dialog.open() != Window.CANCEL) { - fSearchFilter.resetPropertiesFilter(); + fSearchFilter.resetPropertyKeyFilter(); for(String key : dialog.getSelectedKeys()) { - fSearchFilter.addPropertiesFilter(key); + fSearchFilter.addPropertyKeyFilter(key); } refreshTree(); } } }; + actionProperties.setToolTipText(Messages.SearchWidget_23); dropDownAction.add(actionProperties); dropDownAction.add(new Separator()); @@ -322,22 +352,45 @@ public void run() { refreshTree(); } }; - fActionFilterViews.setChecked(fSearchFilter.isFilteringViews()); + fActionFilterViews.setToolTipText(Messages.SearchWidget_24); dropDownAction.add(fActionFilterViews); dropDownAction.add(new Separator()); // Show All Folders - IAction actionFolders = new Action(Messages.SearchWidget_12, IAction.AS_CHECK_BOX) { + fActionShowAllFolders = new Action(Messages.SearchWidget_12, IAction.AS_CHECK_BOX) { @Override public void run() { fSearchFilter.setShowAllFolders(isChecked()); refreshTree(); } }; - actionFolders.setChecked(fSearchFilter.isShowAllFolders()); - dropDownAction.add(actionFolders); + fActionShowAllFolders.setToolTipText(Messages.SearchWidget_25); + dropDownAction.add(fActionShowAllFolders); + + // Match Case + fActionMatchCase = new Action(Messages.SearchWidget_18, IAction.AS_CHECK_BOX) { + @Override + public void run() { + fSearchFilter.setMatchCase(isChecked()); + refreshTree(); + } + }; + fActionMatchCase.setToolTipText(Messages.SearchWidget_26); + dropDownAction.add(fActionMatchCase); + // Regex + fActionUseRegex = new Action(Messages.SearchWidget_19, IAction.AS_CHECK_BOX) { + @Override + public void run() { + fSearchFilter.setUseRegex(isChecked()); + setValidSearchTextHint(); + refreshTree(); + } + }; + fActionUseRegex.setToolTipText(Messages.SearchWidget_27); + dropDownAction.add(fActionUseRegex); + dropDownAction.add(new Separator()); // Reset @@ -349,10 +402,45 @@ public void run() { }; dropDownAction.add(actionReset); + loadPreferences(); + // Need to update toolbar manager now toolBarmanager.update(true); } + private void loadPreferences() { + fActionFilterName.setChecked(ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.SEARCHFILTER_NAME)); + fSearchFilter.setFilterOnName(fActionFilterName.isChecked()); + + fActionFilterDocumentation.setChecked(ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.SEARCHFILTER_DOCUMENTATION)); + fSearchFilter.setFilterOnDocumentation(fActionFilterDocumentation.isChecked()); + + fActionFilterPropertyValues.setChecked(ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.SEARCHFILTER_PROPETY_VALUES)); + fSearchFilter.setFilterOnPropertyValues(fActionFilterPropertyValues.isChecked()); + + fActionFilterViews.setChecked(ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.SEARCHFILTER_VIEWS)); + fSearchFilter.setFilterViews(fActionFilterViews.isChecked()); + + fActionShowAllFolders.setChecked(ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.SEARCHFILTER_SHOW_ALL_FOLDERS)); + fSearchFilter.setShowAllFolders(fActionShowAllFolders.isChecked()); + + fActionMatchCase.setChecked(ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.SEARCHFILTER_MATCH_CASE)); + fSearchFilter.setMatchCase(fActionMatchCase.isChecked()); + + fActionUseRegex.setChecked(ArchiPlugin.PREFERENCES.getBoolean(IPreferenceConstants.SEARCHFILTER_USE_REGEX)); + fSearchFilter.setUseRegex(fActionUseRegex.isChecked()); + } + + private void savePreferences() { + ArchiPlugin.PREFERENCES.setValue(IPreferenceConstants.SEARCHFILTER_NAME, fSearchFilter.getFilterOnName()); + ArchiPlugin.PREFERENCES.setValue(IPreferenceConstants.SEARCHFILTER_DOCUMENTATION, fSearchFilter.getFilterOnDocumentation()); + ArchiPlugin.PREFERENCES.setValue(IPreferenceConstants.SEARCHFILTER_PROPETY_VALUES, fSearchFilter.getFilterOnPropertyValues()); + ArchiPlugin.PREFERENCES.setValue(IPreferenceConstants.SEARCHFILTER_VIEWS, fSearchFilter.isFilteringViews()); + ArchiPlugin.PREFERENCES.setValue(IPreferenceConstants.SEARCHFILTER_SHOW_ALL_FOLDERS, fSearchFilter.getShowAllFolders()); + ArchiPlugin.PREFERENCES.setValue(IPreferenceConstants.SEARCHFILTER_MATCH_CASE, fSearchFilter.getMatchCase()); + ArchiPlugin.PREFERENCES.setValue(IPreferenceConstants.SEARCHFILTER_USE_REGEX, fSearchFilter.getUseRegex()); + } + /** * Reset all filters, properties, specializations */ @@ -362,6 +450,9 @@ private void reset() { // Don't filter on Documentation menu item fActionFilterDocumentation.setChecked(false); + + // Don't filter on Property Values menu item + fActionFilterPropertyValues.setChecked(false); // Clear & uncheck Specializations menu items populateSpecializationsMenu(); @@ -385,8 +476,8 @@ private void reset() { * Currently called when a model is opened or closed to update Properties and Specializations */ public void softReset() { - // Clear & Reset Properties - fSearchFilter.resetPropertiesFilter(); + // Clear & Reset Property keys + fSearchFilter.resetPropertyKeyFilter(); // Clear & Reset Specializations populateSpecializationsMenu(); @@ -555,6 +646,8 @@ private void restoreTreeState() { public void dispose() { super.dispose(); + savePreferences(); + fViewer.removeTreeListener(treeExpansionListener); if(fSearchFilter.isFiltering()) { diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/messages.properties b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/messages.properties index be5f3865b..7a4eabbdb 100644 --- a/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/messages.properties +++ b/com.archimatetool.editor/src/com/archimatetool/editor/views/tree/search/messages.properties @@ -1,5 +1,5 @@ SearchWidget_0=Name -SearchWidget_1=Search in Name +SearchWidget_1=Filter on Name SearchWidget_10=Implementation && Migration SearchWidget_11=Relations SearchWidget_12=Show All Folders @@ -8,8 +8,18 @@ SearchWidget_14=Other SearchWidget_15=Strategy SearchWidget_16=Specializations SearchWidget_17=Views +SearchWidget_18=Match Case +SearchWidget_19=Match Regular Expression SearchWidget_2=Documentation -SearchWidget_3=Search in Documentation +SearchWidget_20=Invalid Regular Expression +SearchWidget_21=Property Value +SearchWidget_22=Filter on Property values +SearchWidget_23=Select Properties to filter +SearchWidget_24=Filter on Views +SearchWidget_25=Show all folders +SearchWidget_26=Match case +SearchWidget_27=Match based on regular expression +SearchWidget_3=Filter on Documentation SearchWidget_4=Filter Options SearchWidget_5=Properties... SearchWidget_6=Business diff --git a/com.archimatetool.help/help/Images/model-tree-filter.png b/com.archimatetool.help/help/Images/model-tree-filter.png index e12e362a2..a4dad308e 100755 Binary files a/com.archimatetool.help/help/Images/model-tree-filter.png and b/com.archimatetool.help/help/Images/model-tree-filter.png differ diff --git a/com.archimatetool.help/help/Images/model-tree-searchbar2.png b/com.archimatetool.help/help/Images/model-tree-searchbar2.png index 5d051c1d5..3d0e7706a 100755 Binary files a/com.archimatetool.help/help/Images/model-tree-searchbar2.png and b/com.archimatetool.help/help/Images/model-tree-searchbar2.png differ diff --git a/com.archimatetool.help/help/Text/model_tree_search.html b/com.archimatetool.help/help/Text/model_tree_search.html index d8a973955..5bb65e861 100644 --- a/com.archimatetool.help/help/Text/model_tree_search.html +++ b/com.archimatetool.help/help/Text/model_tree_search.html @@ -19,18 +19,18 @@

Searching and Filtering in the Model Tree

Click here to open the Search Bar

-

As you type into the text field of the Search Bar the Model Tree updates to show only those objects that match the search criteria in the Search Bar. By default only the names of the objects are matched to the search string. You can also search on the "Documentation" field of the objects by ticking this in the "Filter Options" drop-down menu in the Search Bar:

+

As you type into the text field of the Search Bar the Model Tree updates to show only those objects that match the search criteria in the Search Bar. By default only the names of the objects are matched to the search string. You can also search on the "Documentation" field of the objects by selecting this in the "Filter Options" drop-down menu in the Search Bar:

Searching on both "Name" and "Documentation"

-

To clear the search text click on the icon to the right of the text. To clear the filters, deselect "Name" and/or "Documentation".

+

To clear the search text click on the icon to the right of the text. To clear these filters, deselect "Name" and/or "Documentation".


Filtering Object Types

-

To filter certain types of ArchiMate concept you can select the types to include in the filter/search in the drop-down menu. You can select Specializations, Elements, Relations, and Views:

+

To filter certain types of ArchiMate concept you can select the types to include in the filter in the drop-down menu. You can select Specializations, Elements, Relations, and Views:

Filtering certain object types

@@ -40,19 +40,19 @@

Filtering Object Types


Filtering User Properties

+ +

You can filter on the values of User Properties by selecting the "Property Value" drop-down menu item and adding some text in the text field.

-

To filter on User Properties of objects, select the Property keys to include in the filter/search by clicking on the "Properties..." menu item and then select the required Property keys in the dialog that opens:

+

To filter on selected User Properties, select the Property keys to include in the filter by clicking on the "Properties..." menu item and then select the required Property keys in the selection dialog:

Selecting User Property Keys

- -

You can then filter on the values of the selected Property keys by adding some text in the text field.


Filtering Specializations

-

To filter Specializations of concepts you can select the Specializations to include in the filter/search in the drop-down menu in the same way as for Object Types. This will reveal all concepts that match the Specializations selected.

+

To filter Specializations of concepts you can select the Specializations to include in the filter in the drop-down menu in the same way as for Object Types. This will reveal all concepts that match the Specializations selected.


@@ -62,6 +62,18 @@

Show All Folders


+

Match Case

+ +

Select this option to match case on the search text.

+ +
+ +

Match Regular Expression

+ +

Select this option to match using regular expressions. If the regular expression is invalid the search text will show in red. Note that the syntax is Java based.

+ +
+

Reset Filters

Selecting this menu item will clear all selections for Documentation, Properties, Specializations, Elements, Relations, and Views.