directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1521528 - in /directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui: ./ dialogs/preferences/ editors/searchresult/
Date Tue, 10 Sep 2013 15:42:57 GMT
Author: pamarcelot
Date: Tue Sep 10 15:42:57 2013
New Revision: 1521528

URL: http://svn.apache.org/r1521528
Log:
Fix for DIRSTUDIO-948 (Sorting search results does not work with over 1000 results).

Modified:
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIPreferencesInitializer.java
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/SearchResultEditorPreferencePage.java
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages.properties
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages_de.properties
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages_fr.properties
    directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorContentProvider.java

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java?rev=1521528&r1=1521527&r2=1521528&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIConstants.java
Tue Sep 10 15:42:57 2013
@@ -48,6 +48,7 @@ public final class BrowserUIConstants
     public static final String PREFERENCE_BROWSER_LINK_WITH_EDITOR = "browserLinkWithEditor";
//$NON-NLS-1$
     public static final String PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN = "searchResultEditorShowDn";
//$NON-NLS-1$
     public static final String PREFERENCE_SEARCHRESULTEDITOR_SHOW_LINKS = "searchResultEditorShowLinks";
//$NON-NLS-1$
+    public static final String PREFERENCE_SEARCHRESULTEDITOR_SORT_FILTER_LIMIT = "searchResultEditorSortFilterLimit";
//$NON-NLS-1$
     public static final String PREFERENCEPAGEID_MAIN = BrowserUIPlugin.getDefault().getPluginProperties()
         .getString( "PrefPage_MainPreferencePage_id" ); //$NON-NLS-1$
     public static final String PREFERENCEPAGEID_ATTRIBUTES = BrowserUIPlugin.getDefault().getPluginProperties()

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIPreferencesInitializer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIPreferencesInitializer.java?rev=1521528&r1=1521527&r2=1521528&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIPreferencesInitializer.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/BrowserUIPreferencesInitializer.java
Tue Sep 10 15:42:57 2013
@@ -45,6 +45,7 @@ public class BrowserUIPreferencesInitial
         // Search Result Editor
         store.setDefault( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN, true
);
         store.setDefault( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_LINKS, true
);
+        store.setDefault( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SORT_FILTER_LIMIT,
10000 );
 
         // Entry Editors
         store.setDefault( BrowserUIConstants.PREFERENCE_ENTRYEDITORS_USE_USER_PRIORITIES,
false );

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/SearchResultEditorPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/SearchResultEditorPreferencePage.java?rev=1521528&r1=1521527&r2=1521528&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/SearchResultEditorPreferencePage.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/SearchResultEditorPreferencePage.java
Tue Sep 10 15:42:57 2013
@@ -25,9 +25,13 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
 import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
 import org.eclipse.ui.IWorkbench;
 import org.eclipse.ui.IWorkbenchPreferencePage;
 
@@ -40,13 +44,15 @@ import org.eclipse.ui.IWorkbenchPreferen
  */
 public class SearchResultEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
 {
-
     /** The show Dn button. */
     private Button showDnButton;
 
     /** The show links button. */
     private Button showLinksButton;
 
+    /** The sort/filter limit text */
+    private Text sortFilterLimitText;
+
 
     /**
      * Creates a new instance of SearchResultEditorPreferencePage.
@@ -72,19 +78,41 @@ public class SearchResultEditorPreferenc
      */
     protected Control createContents( Composite parent )
     {
-        Composite composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
+        Composite composite = BaseWidgetUtils.createColumnContainer( parent, 2, 1 );
 
-        BaseWidgetUtils.createSpacer( composite, 1 );
-        BaseWidgetUtils.createSpacer( composite, 1 );
+        BaseWidgetUtils.createSpacer( composite, 2 );
+
+        // Show Dn
         showDnButton = BaseWidgetUtils.createCheckbox( composite, Messages
-            .getString( "SearchResultEditorPreferencePage.DNAsFirst" ), 1 ); //$NON-NLS-1$
+            .getString( "SearchResultEditorPreferencePage.DNAsFirst" ), 2 ); //$NON-NLS-1$
         showDnButton.setSelection( getPreferenceStore().getBoolean(
             BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN ) );
+
+        // Show DN As Link
         showLinksButton = BaseWidgetUtils.createCheckbox( composite, Messages
-            .getString( "SearchResultEditorPreferencePage.DNAsLink" ), 1 ); //$NON-NLS-1$
+            .getString( "SearchResultEditorPreferencePage.DNAsLink" ), 2 ); //$NON-NLS-1$
         showLinksButton.setSelection( getPreferenceStore().getBoolean(
             BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_LINKS ) );
 
+        // Sort/Filter Limit
+        String sortFilterLimitTooltip = Messages.getString( "SearchResultEditorPreferencePage.SortFilterLimitToolTip"
); //$NON-NLS-1$
+        Label sortFilterLimitLabel = BaseWidgetUtils.createLabel( composite, Messages
+            .getString( "SearchResultEditorPreferencePage.SortFilterLimitColon" ), 1 ); //$NON-NLS-1$
+        sortFilterLimitLabel.setToolTipText( sortFilterLimitTooltip );
+        sortFilterLimitText = BaseWidgetUtils.createText( composite, "" + getPreferenceStore().getInt(
+            BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SORT_FILTER_LIMIT ), 5, 1 );
//$NON-NLS-1$
+        sortFilterLimitText.setToolTipText( sortFilterLimitTooltip );
+        sortFilterLimitText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) ) //$NON-NLS-1$
+                {
+                    e.doit = false;
+                }
+            }
+        } );
+
         applyDialogFont( composite );
         return composite;
     }
@@ -95,10 +123,27 @@ public class SearchResultEditorPreferenc
      */
     public boolean performOk()
     {
+        // Show Dn
         getPreferenceStore().setValue( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN,
             showDnButton.getSelection() );
+
+        // Show DN As Link
         getPreferenceStore().setValue( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_LINKS,
             showLinksButton.getSelection() );
+
+        // Sort/Filter Limit
+        int sortFilterLimit = getPreferenceStore().getInt(
+            BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SORT_FILTER_LIMIT );
+        try
+        {
+            sortFilterLimit = Integer.parseInt( sortFilterLimitText.getText().trim() );
+        }
+        catch ( NumberFormatException nfe )
+        {
+        }
+        getPreferenceStore().setValue( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SORT_FILTER_LIMIT,
+            sortFilterLimit );
+
         return true;
     }
 

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages.properties?rev=1521528&r1=1521527&r2=1521528&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages.properties
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages.properties
Tue Sep 10 15:42:57 2013
@@ -36,6 +36,8 @@ SearchResultEditorPreferencePage.DNAsFir
 SearchResultEditorPreferencePage.DNAsLink=Show DN as link
 SearchResultEditorPreferencePage.GeneralSettings=General settings for the LDAP search result
editor:
 SearchResultEditorPreferencePage.ResultEditor=Search Result Editor
+SearchResultEditorPreferencePage.SortFilterLimitColon=Sort/Filter limit:
+SearchResultEditorPreferencePage.SortFilterLimitToolTip=If there are more than the specified
number of search results they won't be sorted/filtered. Hint: For performance reason the maximum
value should be 10.000\!
 EntryEditorsPreferencePage.ApplicationWideSetting=Use the application-wide open mode setting
 EntryEditorsPreferencePage.ApplicationWideSettingTooltip=Allows multiple options for opening
editors (ie. single/double click and more). See <a>'General'</a> for the open
mode configuration.
 EntryEditorsPreferencePage.DescriptionColon=Description:

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages_de.properties?rev=1521528&r1=1521527&r2=1521528&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages_de.properties
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages_de.properties
Tue Sep 10 15:42:57 2013
@@ -34,6 +34,8 @@ SearchResultEditorPreferencePage.DNAsFir
 SearchResultEditorPreferencePage.DNAsLink=Zeige DN als Verweis
 SearchResultEditorPreferencePage.GeneralSettings=Allgemeine Einstellungen f\u00FCr den LDAP
Suchresultate Editor\:
 SearchResultEditorPreferencePage.ResultEditor=Suchresultate Editor
+SearchResultEditorPreferencePage.SortFilterLimitColon=Sortier/Filtern-Limit:
+SearchResultEditorPreferencePage.SortFilterLimitToolTip=Bei mehr Eintr\u00E4gen wird keine
Sortierung/Filterung durchgef\u00FChrt. Hinweis: Der Wert sollte 10000 nicht \u00FCbersteigen\!
 EntryEditorsPreferencePage.ApplicationWideSetting=Anwendungsweiten \u00d6ffnen Modus verwenden
 EntryEditorsPreferencePage.ApplicationWideSettingTooltip=Erlaubt verschiedene Optionen zum
\u00d6ffnen von Editoren (z.B. Einzelklick oder Doppelklick), siehe <a>'Allgemein'</a>
f\u00fcr weitere Einstellungen.
 EntryEditorsPreferencePage.DescriptionColon=Beschreibung:

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages_fr.properties?rev=1521528&r1=1521527&r2=1521528&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages_fr.properties
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/preferences/messages_fr.properties
Tue Sep 10 15:42:57 2013
@@ -36,6 +36,8 @@ SearchResultEditorPreferencePage.DNAsFir
 SearchResultEditorPreferencePage.DNAsLink=Afficher le DN sous forme de lien
 SearchResultEditorPreferencePage.GeneralSettings=R\u00E9glages g\u00E9n\u00E9raux pour l'\u00E9diteur
de r\u00E9sultat de recherche LDAP:
 SearchResultEditorPreferencePage.ResultEditor=Editeur de r\u00E9sultat de recherche
+SearchResultEditorPreferencePage.SortFilterLimitColon=Limite de tri/filtrage :
+SearchResultEditorPreferencePage.SortFilterLimitToolTip=S'il y a plus de r\u00E9sultats de
recherche que la valeur sp\u00E9cifi\u00E9e, le tri/filtrage ne sera pas effectu\u00E9. Conseil:
Pour des raisons de performance, la valeur maximale ne devrait pas d\u00E9passer 10 000 \!
 EntryEditorsPreferencePage.ApplicationWideSetting=Utiliser le r\u00E9glage global de mode
d'ouverture de l'application
 EntryEditorsPreferencePage.ApplicationWideSettingTooltip=Permet de multiples options pour
l'ouverture des \u00E9diteurs (ie. simple/double clic et plus). Voir <a>'G\u00E9n\u00E9ral'</a>
pour la configuration du mode d'ouverture.
 EntryEditorsPreferencePage.DescriptionColon=Description:

Modified: directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorContentProvider.java?rev=1521528&r1=1521527&r2=1521528&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorContentProvider.java
(original)
+++ directory/studio/trunk/plugins/ldapbrowser.ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorContentProvider.java
Tue Sep 10 15:42:57 2013
@@ -103,8 +103,9 @@ public class SearchResultEditorContentPr
         // filter and sort, use Job if too much elements
         if ( configuration.getFilter().isFiltered() || configuration.getSorter().isSorted()
)
         {
-            if ( elements.length > 1000 && mainWidget.getViewer() != null
-                && !mainWidget.getViewer().getTable().isDisposed() )
+            if ( elements.length > BrowserUIPlugin.getDefault().getPreferenceStore()
+                .getInt( BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SORT_FILTER_LIMIT
)
+                && mainWidget.getViewer() != null && !mainWidget.getViewer().getTable().isDisposed()
)
             {
                 // deactivate fitering and sorting for large data set
                 // FilterAndSortRunnable runnable = new FilterAndSortRunnable( configuration,
mainWidget, elements );



Mime
View raw message