directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r518810 - in /directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui: editors/searchresult/ jobs/
Date Fri, 16 Mar 2007 00:03:17 GMT
Author: seelmann
Date: Thu Mar 15 17:03:16 2007
New Revision: 518810

URL: http://svn.apache.org/viewvc?view=rev&rev=518810
Log:
Moved FilterAndSortJob, removed time triggered progress monitor, Javadocs

Added:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/editors/searchresult/FilterAndSortJob.java
      - copied, changed from r518367, directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/FilterAndSortJob.java
Removed:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/FilterAndSortJob.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/TimeTriggeredProgressMonitorDialog.java
Modified:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/editors/searchresult/SearchResultEditorContentProvider.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/RunnableContextJobAdapter.java

Copied: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/editors/searchresult/FilterAndSortJob.java
(from r518367, directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/FilterAndSortJob.java)
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/editors/searchresult/FilterAndSortJob.java?view=diff&rev=518810&p1=directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/FilterAndSortJob.java&r1=518367&p2=directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/editors/searchresult/FilterAndSortJob.java&r2=518810
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/FilterAndSortJob.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/editors/searchresult/FilterAndSortJob.java
Thu Mar 15 17:03:16 2007
@@ -18,28 +18,44 @@
  *  
  */
 
-package org.apache.directory.ldapstudio.browser.ui.jobs;
+package org.apache.directory.ldapstudio.browser.ui.editors.searchresult;
 
 
 import org.apache.directory.ldapstudio.browser.core.jobs.AbstractEclipseJob;
 import org.apache.directory.ldapstudio.browser.core.jobs.ExtendedProgressMonitor;
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
-import org.apache.directory.ldapstudio.browser.ui.editors.searchresult.SearchResultEditorConfiguration;
-import org.apache.directory.ldapstudio.browser.ui.editors.searchresult.SearchResultEditorWidget;
 
 
+/**
+ * This job to filter and sort the search result editor asynchrously to avoid 
+ * freezing the GUI.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class FilterAndSortJob extends AbstractEclipseJob
 {
 
+    /** The configuration. */
     private SearchResultEditorConfiguration configuration;
 
+    /** The main widget. */
     private SearchResultEditorWidget mainWidget;
 
+    /** All elements, unfiltered and unsorted. */
     private Object[] elements;
 
+    /** The filtered and sorted elements. */
     private Object[] filteredAndSortedElements;
 
 
+    /**
+     * Creates a new instance of FilterAndSortJob.
+     * 
+     * @param configuration the configuration
+     * @param mainWidget the main widget
+     * @param elements the elements, unfiltered and unsorted
+     */
     public FilterAndSortJob( SearchResultEditorConfiguration configuration, SearchResultEditorWidget
mainWidget,
         Object[] elements )
     {
@@ -49,12 +65,18 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     protected Object[] getLockedObjects()
     {
         return new Object[0];
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     protected void executeAsyncJob( ExtendedProgressMonitor monitor ) throws Exception
     {
         monitor.beginTask( "Filter and Sort", 3 );
@@ -73,12 +95,20 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     protected IConnection[] getConnections()
     {
         return new IConnection[0];
     }
 
 
+    /**
+     * Gets the filtered and sorted elements.
+     * 
+     * @return the filtered and sorted elements
+     */
     public Object[] getFilteredAndSortedElements()
     {
         return filteredAndSortedElements;

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/editors/searchresult/SearchResultEditorContentProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/editors/searchresult/SearchResultEditorContentProvider.java?view=diff&rev=518810&r1=518809&r2=518810
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/editors/searchresult/SearchResultEditorContentProvider.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/editors/searchresult/SearchResultEditorContentProvider.java
Thu Mar 15 17:03:16 2007
@@ -24,10 +24,8 @@
 import org.apache.directory.ldapstudio.browser.core.model.ISearch;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIConstants;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIPlugin;
-import org.apache.directory.ldapstudio.browser.ui.jobs.FilterAndSortJob;
 import org.apache.directory.ldapstudio.browser.ui.jobs.RunnableContextJobAdapter;
-import org.apache.directory.ldapstudio.browser.ui.jobs.TimeTriggeredProgressMonitorDialog;
-
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.viewers.ILazyContentProvider;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.Viewer;
@@ -87,8 +85,10 @@
                 && !this.mainWidget.getViewer().getTable().isDisposed() )
             {
                 FilterAndSortJob job = new FilterAndSortJob( this.configuration, this.mainWidget,
this.elements );
-                RunnableContextJobAdapter.execute( job, new TimeTriggeredProgressMonitorDialog(
Display.getCurrent()
-                    .getActiveShell(), 5000 ) );
+                //RunnableContextJobAdapter.execute( job, new TimeTriggeredProgressMonitorDialog(
Display.getCurrent()
+                //    .getActiveShell(), 5000 ) );
+                RunnableContextJobAdapter.execute( job, new ProgressMonitorDialog( Display.getCurrent()
+                    .getActiveShell() ) );
                 this.filteredAndSortedElements = job.getFilteredAndSortedElements();
             }
             else if ( elements.length > 0 && this.mainWidget.getViewer() != null

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/RunnableContextJobAdapter.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/RunnableContextJobAdapter.java?view=diff&rev=518810&r1=518809&r2=518810
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/RunnableContextJobAdapter.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/jobs/RunnableContextJobAdapter.java
Thu Mar 15 17:03:16 2007
@@ -27,31 +27,59 @@
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.operation.IRunnableContext;
 import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.swt.widgets.Display;
 
 
+/**
+ * This class provides some convinience methods to execute a job within
+ * an {@link IRunnableContext}.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class RunnableContextJobAdapter
 {
 
+    /**
+     * Executes the given job within a new {@link ProgressMonitorDialog}.
+     *
+     * @param job the job to execute
+     */
     public static void execute( final AbstractEclipseJob job )
     {
         execute( job, null );
     }
 
 
+    /**
+     * Executes the given job within the given runnable context and enabled error handling
+     * 
+     * @param runnableContext the runnable context
+     * @param job the job to execute
+     */
     public static void execute( final AbstractEclipseJob job, IRunnableContext runnableContext
)
     {
         execute( job, runnableContext, true );
     }
 
 
+    /**
+     * Executes the given job within the given runnable context.
+     * 
+     * @param runnableContext the runnable context
+     * @param job the job to execute
+     * @param handleError true to handle errors
+     */
     public static void execute( final AbstractEclipseJob job, IRunnableContext runnableContext,
boolean handleError )
     {
 
         if ( runnableContext == null )
-            runnableContext = new TimeTriggeredProgressMonitorDialog( Display.getDefault().getActiveShell(),
1000 );
+        {
+            runnableContext = new ProgressMonitorDialog( Display.getDefault().getActiveShell()
);
+        }
 
         IRunnableWithProgress runnable = new IRunnableWithProgress()
         {



Mime
View raw message