directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r936652 - in /directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view: dialogs/ views/
Date Thu, 22 Apr 2010 08:39:07 GMT
Author: pamarcelot
Date: Thu Apr 22 08:39:06 2010
New Revision: 936652

URL: http://svn.apache.org/viewvc?rev=936652&view=rev
Log:
Fix for DIRSTUDIO-447 (Add the ability to use wildcards (?, *) in the ATs or OCs selection
dialog to ease the search).
Applied patch provided by Keheliya Gallaba.

Modified:
    directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/AttributeTypeSelectionDialogContentProvider.java
    directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/ObjectClassSelectionDialogContentProvider.java
    directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/SearchView.java

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/AttributeTypeSelectionDialogContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/AttributeTypeSelectionDialogContentProvider.java?rev=936652&r1=936651&r2=936652&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/AttributeTypeSelectionDialogContentProvider.java
(original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/AttributeTypeSelectionDialogContentProvider.java
Thu Apr 22 08:39:06 2010
@@ -72,14 +72,11 @@ public class AttributeTypeSelectionDialo
             String searchText = ( String ) inputElement;
 
             String searchRegexp;
-            if ( searchText.length() == 0 )
-            {
-                searchRegexp = ".*"; //$NON-NLS-1$
-            }
-            else
-            {
-                searchRegexp = searchText + ".*"; //$NON-NLS-1$
-            }
+
+            searchText += "*"; //$NON-NLS-1$
+            searchRegexp = searchText.replaceAll( "\\*", "[\\\\S]*" ); //$NON-NLS-1$ //$NON-NLS-2$

+            searchRegexp = searchRegexp.replaceAll( "\\?", "[\\\\S]" ); //$NON-NLS-1$ //$NON-NLS-2$

+
             Pattern pattern = Pattern.compile( searchRegexp, Pattern.CASE_INSENSITIVE );
 
             List<AttributeTypeImpl> atList = schemaHandler.getAttributeTypes();
@@ -169,4 +166,4 @@ public class AttributeTypeSelectionDialo
     {
         // Nothing to do
     }
-}
\ No newline at end of file
+}

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/ObjectClassSelectionDialogContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/ObjectClassSelectionDialogContentProvider.java?rev=936652&r1=936651&r2=936652&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/ObjectClassSelectionDialogContentProvider.java
(original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/dialogs/ObjectClassSelectionDialogContentProvider.java
Thu Apr 22 08:39:06 2010
@@ -72,14 +72,11 @@ public class ObjectClassSelectionDialogC
             String searchText = ( String ) inputElement;
 
             String searchRegexp;
-            if ( searchText.length() == 0 )
-            {
-                searchRegexp = ".*"; //$NON-NLS-1$
-            }
-            else
-            {
-                searchRegexp = searchText + ".*"; //$NON-NLS-1$
-            }
+
+            searchText += "*"; //$NON-NLS-1$
+            searchRegexp = searchText.replaceAll( "\\*", "[\\\\S]*" ); //$NON-NLS-1$ //$NON-NLS-2$

+            searchRegexp = searchRegexp.replaceAll( "\\?", "[\\\\S]" ); //$NON-NLS-1$ //$NON-NLS-2$

+
             Pattern pattern = Pattern.compile( searchRegexp, Pattern.CASE_INSENSITIVE );
 
             List<ObjectClassImpl> ocList = schemaHandler.getObjectClasses();

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/SearchView.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/SearchView.java?rev=936652&r1=936651&r2=936652&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/SearchView.java
(original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/views/SearchView.java
Thu Apr 22 08:39:06 2010
@@ -685,8 +685,8 @@ public class SearchView extends ViewPart
 
         if ( searchString != null )
         {
-            String computedSearchString = searchString.replaceAll( "\\*", "\\\\S*" ); //$NON-NLS-1$
//$NON-NLS-2$
-            computedSearchString = computedSearchString.replaceAll( "\\?", ".*" ); //$NON-NLS-1$
//$NON-NLS-2$
+            String computedSearchString = searchString.replaceAll( "\\*", "[\\\\S]*" ); //$NON-NLS-1$
//$NON-NLS-2$
+            computedSearchString = computedSearchString.replaceAll( "\\?", "[\\\\S]" ); //$NON-NLS-1$
//$NON-NLS-2$
 
             Pattern pattern = Pattern.compile( computedSearchString, Pattern.CASE_INSENSITIVE
);
 



Mime
View raw message