directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1398777 - in /directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser: BrowserContentProvider.java BrowserSorter.java
Date Tue, 16 Oct 2012 13:14:14 GMT
Author: pamarcelot
Date: Tue Oct 16 13:14:13 2012
New Revision: 1398777

URL: http://svn.apache.org/viewvc?rev=1398777&view=rev
Log:
Fix for DIRSTUDIO-827 (Quick Search is not displayed when folding is activated)

Modified:
    directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserContentProvider.java
    directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserSorter.java

Modified: directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserContentProvider.java?rev=1398777&r1=1398776&r2=1398777&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserContentProvider.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserContentProvider.java
Tue Oct 16 13:14:13 2012
@@ -406,8 +406,19 @@ public class BrowserContentProvider impl
             }
             else
             {
-                BrowserEntryPage[] entryPages = getEntryPages( parentEntry );;
-                return entryPages;
+                BrowserEntryPage[] entryPages = getEntryPages( parentEntry );
+
+                List<Object> objects = new ArrayList<Object>();
+
+                if ( widget.getQuickSearch() != null
+                    && parentEntry.getDn().equals( widget.getQuickSearch().getSearchBase()
) )
+                {
+                    objects.add( widget.getQuickSearch() );
+                }
+                
+                objects.addAll( Arrays.asList( entryPages ) );
+                
+                return objects.toArray();
             }
         }
         else if ( parent instanceof BrowserSearchResultPage )

Modified: directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserSorter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserSorter.java?rev=1398777&r1=1398776&r2=1398777&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserSorter.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.common/src/main/java/org/apache/directory/studio/ldapbrowser/common/widgets/browser/BrowserSorter.java
Tue Oct 16 13:14:13 2012
@@ -28,6 +28,7 @@ import org.apache.directory.studio.conne
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
 import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.IQuickSearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DirectoryMetadataEntry;
@@ -227,7 +228,24 @@ public class BrowserSorter extends Viewe
         {
             return greaterThanEntries();
         }
-
+        
+        // special case for quick search
+        else if ( o1 instanceof IQuickSearch || o2 instanceof IQuickSearch )
+        {
+            if ( !( o1 instanceof IQuickSearch ) && ( o2 instanceof IQuickSearch
) )
+            {
+                return 1;
+            }
+            else if ( ( o1 instanceof IQuickSearch ) && !( o2 instanceof IQuickSearch
) )
+            {
+                return -1;
+            }
+            else
+            {
+                return equal();
+            }
+        }
+        
         // o1 and o2 are entries
         else if ( o1 instanceof IEntry || o2 instanceof IEntry )
         {



Mime
View raw message