directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r670449 [3/3] - in /directory/studio/trunk: connection-core/src/main/java/org/apache/directory/studio/connection/core/ connection-core/src/main/java/org/apache/directory/studio/connection/core/io/ connection-core/src/main/java/org/apache/di...
Date Mon, 23 Jun 2008 05:20:24 GMT
Copied: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java (from r670090, directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java?p2=directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java&p1=directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java&r1=670090&r2=670449&rev=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchJob.java (original)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/SearchRunnable.java Sun Jun 22 22:20:21 2008
@@ -41,7 +41,8 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.DnUtils;
-import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.jobs.StudioBulkRunnableWithProgress;
+import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.io.jndi.StudioSearchResult;
@@ -67,12 +68,12 @@
 
 
 /**
- * Job to perform search operations. 
+ * Runnable to perform search operations. 
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
  */
-public class SearchJob extends AbstractNotificationJob
+public class SearchRunnable implements StudioBulkRunnableWithProgress
 {
 
     /** The searches. */
@@ -80,21 +81,20 @@
 
 
     /**
-     * Creates a new instance of SearchJob.
+     * Creates a new instance of SearchRunnable.
      * 
      * @param searches the searches
      */
-    public SearchJob( ISearch[] searches )
+    public SearchRunnable( ISearch[] searches )
     {
         this.searches = searches;
-        setName( BrowserCoreMessages.jobs__search_name );
     }
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getConnections()
+     * {@inheritDoc}
      */
-    protected Connection[] getConnections()
+    public Connection[] getConnections()
     {
         Connection[] connections = new Connection[searches.length];
         for ( int i = 0; i < connections.length; i++ )
@@ -106,9 +106,18 @@
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getLockedObjects()
+     * {@inheritDoc}
      */
-    protected Object[] getLockedObjects()
+    public String getName()
+    {
+        return BrowserCoreMessages.jobs__search_name;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Object[] getLockedObjects()
     {
         List<Object> l = new ArrayList<Object>();
         l.addAll( Arrays.asList( searches ) );
@@ -117,9 +126,9 @@
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractNotificationJob#executeNotificationJob(org.apache.directory.studio.connection.core.StudioProgressMonitor)
+     * {@inheritDoc}
      */
-    protected void executeNotificationJob( StudioProgressMonitor monitor )
+    public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( " ", searches.length + 1 ); //$NON-NLS-1$
         monitor.reportProgress( " " ); //$NON-NLS-1$
@@ -141,9 +150,9 @@
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractNotificationJob#runNotification()
+     * {@inheritDoc}
      */
-    protected void runNotification()
+    public void runNotification()
     {
         for ( int pi = 0; pi < searches.length; pi++ )
         {
@@ -154,9 +163,9 @@
 
 
     /**
-     * @see org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob#getErrorMessage()
+     * {@inheritDoc}
      */
-    protected String getErrorMessage()
+    public String getErrorMessage()
     {
         return searches.length == 1 ? BrowserCoreMessages.jobs__search_error_1
             : BrowserCoreMessages.jobs__search_error_n;
@@ -532,7 +541,7 @@
                             entry.setAlias( true );
                             entry.setHasChildrenHint( false );
                         }
-                        
+
                         if ( SchemaConstants.REFERRAL_OC.equalsIgnoreCase( value ) )
                         {
                             entry.setReferral( true );
@@ -643,7 +652,7 @@
                 Attribute attribute = attributeEnumeration.next();
                 String attributeDescription = attribute.getID();
 
-                if( attribute.getAll().hasMore() )
+                if ( attribute.getAll().hasMore() )
                 {
                     IAttribute studioAttribute = null;
                     if ( entry.getAttribute( attributeDescription ) == null )
@@ -656,7 +665,7 @@
                     {
                         studioAttribute = entry.getAttribute( attributeDescription );
                     }
-    
+
                     NamingEnumeration<?> valueEnumeration = attribute.getAll();
                     while ( valueEnumeration.hasMore() )
                     {

Added: directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/StudioBrowserJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/StudioBrowserJob.java?rev=670449&view=auto
==============================================================================
--- directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/StudioBrowserJob.java (added)
+++ directory/studio/trunk/ldapbrowser-core/src/main/java/org/apache/directory/studio/ldapbrowser/core/jobs/StudioBrowserJob.java Sun Jun 22 22:20:21 2008
@@ -0,0 +1,30 @@
+
+package org.apache.directory.studio.ldapbrowser.core.jobs;
+
+import org.apache.directory.studio.connection.core.jobs.StudioConnectionJob;
+import org.apache.directory.studio.connection.core.jobs.StudioRunnableWithProgress;
+import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
+
+public class StudioBrowserJob extends StudioConnectionJob
+{
+
+    public StudioBrowserJob( StudioRunnableWithProgress runnable )
+    {
+        super( runnable );
+    }
+
+    
+    @Override
+    protected void suspendEventFireingInCurrentThread()
+    {
+        EventRegistry.suspendEventFireingInCurrentThread();
+        super.suspendEventFireingInCurrentThread();
+    }
+    
+    @Override
+    protected void resumeEventFireingInCurrentThread()
+    {
+        EventRegistry.resumeEventFireingInCurrentThread();
+        super.resumeEventFireingInCurrentThread();
+    }
+}

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyEntryAsAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyEntryAsAction.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyEntryAsAction.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/CopyEntryAsAction.java Sun Jun 22 22:20:21 2008
@@ -24,12 +24,12 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
 import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
-import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
-import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeAttributesJob;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeAttributesRunnable;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearchResult;
 import org.eclipse.swt.dnd.Clipboard;
@@ -166,10 +166,10 @@
                 getSelectedBookmarks()[0].getDn() );
             if ( entry == null )
             {
-                ReadEntryJob job = new ReadEntryJob( getSelectedBookmarks()[0].getBrowserConnection(),
+                ReadEntryRunnable runnable = new ReadEntryRunnable( getSelectedBookmarks()[0].getBrowserConnection(),
                     getSelectedBookmarks()[0].getDn() );
-                RunnableContextJobAdapter.execute( job );
-                entry = job.getReadEntry();
+                RunnableContextRunner.execute( runnable, null, true );
+                entry = runnable.getReadEntry();
             }
             entryList.add( entry );
         }
@@ -198,8 +198,8 @@
             IEntry[] uninitializedEntries = ( IEntry[] ) uninitializedEntryList
                 .toArray( new IEntry[uninitializedEntryList.size()] );
 
-            InitializeAttributesJob job = new InitializeAttributesJob( uninitializedEntries, false );
-            RunnableContextJobAdapter.execute( job );
+            InitializeAttributesRunnable runnable = new InitializeAttributesRunnable( uninitializedEntries, false );
+            RunnableContextRunner.execute( runnable, null, true );
 
             // SyncInitializeEntryJob job = new
             // SyncInitializeEntryJob(uninitializedEntries,

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateInDitAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateInDitAction.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateInDitAction.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/LocateInDitAction.java Sun Jun 22 22:20:21 2008
@@ -22,9 +22,9 @@
 
 
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
-import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserView;
@@ -56,9 +56,9 @@
             IEntry entry = connection.getEntryFromCache( dn );
             if ( entry == null )
             {
-                ReadEntryJob job = new ReadEntryJob( connection, dn );
-                RunnableContextJobAdapter.execute( job );
-                entry = job.getReadEntry();
+                ReadEntryRunnable runnable = new ReadEntryRunnable( connection, dn );
+                RunnableContextRunner.execute( runnable, null, true );
+                entry = runnable.getReadEntry();
             }
 
             if ( entry != null )

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/actions/MoveAction.java Sun Jun 22 22:20:21 2008
@@ -24,12 +24,12 @@
 import java.util.LinkedHashSet;
 
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.actions.BrowserAction;
 import org.apache.directory.studio.ldapbrowser.common.dialogs.MoveEntriesDialog;
 import org.apache.directory.studio.ldapbrowser.common.dialogs.SimulateRenameDialogImpl;
-import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
 import org.apache.directory.studio.ldapbrowser.core.jobs.MoveEntriesJob;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryRunnable;
 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.ISearch;
@@ -206,9 +206,9 @@
                 IEntry newParentEntry = entries[0].getBrowserConnection().getEntryFromCache( newParentDn );
                 if( newParentEntry == null )
                 {
-                    ReadEntryJob job = new ReadEntryJob( entries[0].getBrowserConnection(), newParentDn );
-                    RunnableContextJobAdapter.execute( job );
-                    newParentEntry = job.getReadEntry();
+                    ReadEntryRunnable runnable = new ReadEntryRunnable( entries[0].getBrowserConnection(), newParentDn );
+                    RunnableContextRunner.execute( runnable, null, true );
+                    newParentEntry = runnable.getReadEntry();
                 }
                 if ( newParentEntry != null )
                 {

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/EntryPropertyPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/EntryPropertyPage.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/EntryPropertyPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/EntryPropertyPage.java Sun Jun 22 22:20:21 2008
@@ -21,11 +21,11 @@
 package org.apache.directory.studio.ldapbrowser.ui.dialogs.properties;
 
 
-import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.core.events.EntryModificationEvent;
-import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeAttributesJob;
-import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeChildrenJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeAttributesRunnable;
+import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeChildrenRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
@@ -185,9 +185,9 @@
     private void reloadOperationalAttributes()
     {
         IEntry entry = EntryPropertyPage.getEntry( getElement() );
-        InitializeAttributesJob job = new InitializeAttributesJob( new IEntry[]
+        InitializeAttributesRunnable runnable = new InitializeAttributesRunnable( new IEntry[]
             { entry }, true );
-        RunnableContextJobAdapter.execute( job );
+        RunnableContextRunner.execute( runnable, null, true );
 
         this.entryUpdated( entry );
     }
@@ -196,12 +196,12 @@
     private void reloadEntry()
     {
         IEntry entry = EntryPropertyPage.getEntry( getElement() );
-        InitializeChildrenJob job1 = new InitializeChildrenJob( new IEntry[]
+        InitializeChildrenRunnable runnable1 = new InitializeChildrenRunnable( new IEntry[]
             { entry } );
-        InitializeAttributesJob job2 = new InitializeAttributesJob( new IEntry[]
+        InitializeAttributesRunnable runnable2 = new InitializeAttributesRunnable( new IEntry[]
             { entry }, true );
-        RunnableContextJobAdapter.execute( job1 );
-        RunnableContextJobAdapter.execute( job2 );
+        RunnableContextRunner.execute( runnable1, null, true );
+        RunnableContextRunner.execute( runnable2, null, true );
         this.entryUpdated( entry );
     }
 

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/SchemaPropertyPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/SchemaPropertyPage.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/SchemaPropertyPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/dialogs/properties/SchemaPropertyPage.java Sun Jun 22 22:20:21 2008
@@ -25,10 +25,10 @@
 import java.text.DateFormat;
 import java.util.Date;
 
-import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.core.BrowserConnectionManager;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ReloadSchemasJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ReloadSchemaRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
@@ -167,8 +167,8 @@
     private void reloadSchema()
     {
         final IBrowserConnection browserConnection = RootDSEPropertyPage.getConnection( getElement() );
-        ReloadSchemasJob job = new ReloadSchemasJob( browserConnection );
-        RunnableContextJobAdapter.execute( job );
+        ReloadSchemaRunnable runnable = new ReloadSchemaRunnable( browserConnection );
+        RunnableContextRunner.execute( runnable, null, true );
         update( browserConnection );
     }
 

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/ReloadSchemaAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/ReloadSchemaAction.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/ReloadSchemaAction.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/schemabrowser/ReloadSchemaAction.java Sun Jun 22 22:20:21 2008
@@ -21,7 +21,8 @@
 package org.apache.directory.studio.ldapbrowser.ui.editors.schemabrowser;
 
 
-import org.apache.directory.studio.ldapbrowser.core.jobs.ReloadSchemasJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ReloadSchemaRunnable;
+import org.apache.directory.studio.ldapbrowser.core.jobs.StudioBrowserJob;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
@@ -65,7 +66,7 @@
         final IBrowserConnection browserConnection = schemaPage.getConnection();
         if ( browserConnection != null )
         {
-            new ReloadSchemasJob( browserConnection ).execute();
+            new StudioBrowserJob( new ReloadSchemaRunnable( browserConnection ) ).execute();
             schemaPage.getSchemaBrowser().refresh();
         }
     }

Copied: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/FilterAndSortRunnable.java (from r670090, directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/FilterAndSortJob.java)
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/FilterAndSortRunnable.java?p2=directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/FilterAndSortRunnable.java&p1=directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/FilterAndSortJob.java&r1=670090&r2=670449&rev=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/FilterAndSortJob.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/FilterAndSortRunnable.java Sun Jun 22 22:20:21 2008
@@ -22,18 +22,18 @@
 
 
 import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.StudioProgressMonitor;
-import org.apache.directory.studio.ldapbrowser.core.jobs.AbstractEclipseJob;
+import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.jobs.StudioRunnableWithProgress;
 
 
 /**
- * This job to filter and sort the search result editor asynchrously to avoid 
+ * Runnable to filter and sort the search result editor asynchronously 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
+public class FilterAndSortRunnable implements StudioRunnableWithProgress
 {
 
     /** The configuration. */
@@ -50,13 +50,13 @@
 
 
     /**
-     * Creates a new instance of FilterAndSortJob.
+     * Creates a new instance of FilterAndSortRunnable.
      * 
      * @param configuration the configuration
      * @param mainWidget the main widget
      * @param elements the elements, unfiltered and unsorted
      */
-    public FilterAndSortJob( SearchResultEditorConfiguration configuration, SearchResultEditorWidget mainWidget,
+    public FilterAndSortRunnable( SearchResultEditorConfiguration configuration, SearchResultEditorWidget mainWidget,
         Object[] elements )
     {
         this.configuration = configuration;
@@ -68,7 +68,16 @@
     /**
      * {@inheritDoc}
      */
-    protected Object[] getLockedObjects()
+    public String getName()
+    {
+        return "";
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Object[] getLockedObjects()
     {
         return new Object[0];
     }
@@ -77,7 +86,7 @@
     /**
      * {@inheritDoc}
      */
-    protected void executeAsyncJob( StudioProgressMonitor monitor ) throws Exception
+    public void run( StudioProgressMonitor monitor )
     {
         monitor.beginTask( "Filter and Sort", 3 );
         monitor.worked( 1 );
@@ -98,9 +107,18 @@
     /**
      * {@inheritDoc}
      */
-    protected Connection[] getConnections()
+    public Connection[] getConnections()
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public String getErrorMessage()
     {
-        return new Connection[0];
+        return "";
     }
 
 

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorContentProvider.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorContentProvider.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/editors/searchresult/SearchResultEditorContentProvider.java Sun Jun 22 22:20:21 2008
@@ -21,15 +21,13 @@
 package org.apache.directory.studio.ldapbrowser.ui.editors.searchresult;
 
 
-import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.core.model.ISearch;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
 import org.eclipse.jface.viewers.ILazyContentProvider;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
 
 
 public class SearchResultEditorContentProvider implements ILazyContentProvider
@@ -84,12 +82,11 @@
             if ( elements.length > 1000 && this.mainWidget.getViewer() != null
                 && !this.mainWidget.getViewer().getTable().isDisposed() )
             {
-                FilterAndSortJob job = new FilterAndSortJob( this.configuration, this.mainWidget, this.elements );
+                FilterAndSortRunnable runnable = new FilterAndSortRunnable( this.configuration, this.mainWidget, this.elements );
                 //RunnableContextJobAdapter.execute( job, new TimeTriggeredProgressMonitorDialog( Display.getCurrent()
                 //    .getActiveShell(), 5000 ) );
-                RunnableContextJobAdapter.execute( job, new ProgressMonitorDialog( Display.getCurrent()
-                    .getActiveShell() ) );
-                this.filteredAndSortedElements = job.getFilteredAndSortedElements();
+                RunnableContextRunner.execute( runnable, null, true );
+                this.filteredAndSortedElements = runnable.getFilteredAndSortedElements();
             }
             else if ( elements.length > 0 && this.mainWidget.getViewer() != null
                 && !this.mainWidget.getViewer().getTable().isDisposed() )

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/ConnectionViewUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/ConnectionViewUniversalListener.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/ConnectionViewUniversalListener.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/views/connection/ConnectionViewUniversalListener.java Sun Jun 22 22:20:21 2008
@@ -22,9 +22,10 @@
 
 
 import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.jobs.OpenConnectionsJob;
+import org.apache.directory.studio.connection.core.jobs.OpenConnectionsRunnable;
 import org.apache.directory.studio.connection.ui.actions.SelectionUtils;
 import org.apache.directory.studio.connection.ui.widgets.ConnectionUniversalListener;
+import org.apache.directory.studio.ldapbrowser.core.jobs.StudioBrowserJob;
 import org.apache.directory.studio.ldapbrowser.ui.views.browser.BrowserView;
 import org.apache.directory.studio.ldapbrowser.ui.views.modificationlogs.ModificationLogsView;
 import org.apache.directory.studio.ldapbrowser.ui.views.searchlogs.SearchLogsView;
@@ -165,8 +166,7 @@
         }
         else
         {
-            OpenConnectionsJob ocj = new OpenConnectionsJob( connection );
-            ocj.execute();
+            new StudioBrowserJob( new OpenConnectionsRunnable( connection ) ).execute();
         }
     }
 

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/BatchOperationWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/BatchOperationWizard.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/BatchOperationWizard.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/BatchOperationWizard.java Sun Jun 22 22:20:21 2008
@@ -23,10 +23,10 @@
 
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.studio.connection.core.Connection;
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.actions.BrowserSelectionUtils;
-import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCoreConstants;
-import org.apache.directory.studio.ldapbrowser.core.jobs.SearchJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.SearchRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
@@ -37,6 +37,7 @@
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
 import org.apache.directory.studio.ldifeditor.editor.LdifEditor;
 import org.apache.directory.studio.ldifeditor.editor.NonExistingLdifEditorInput;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.IStructuredSelection;
@@ -301,10 +302,10 @@
                     ISearch search = applyOnPage.getApplyOnSearch();
                     if ( search.getBrowserConnection() != null )
                     {
-                        SearchJob job = new SearchJob( new ISearch[]
+                        SearchRunnable runnable = new SearchRunnable( new ISearch[]
                             { search } );
-                        RunnableContextJobAdapter.execute( job, getContainer() );
-                        if ( job.getExternalResult().isOK() )
+                        IStatus status = RunnableContextRunner.execute( runnable, getContainer(), true );
+                        if ( status.isOK() )
                         {
                             ISearchResult[] srs = search.getSearchResults();
                             dns = new LdapDN[srs.length];

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryDnWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryDnWizardPage.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryDnWizardPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryDnWizardPage.java Sun Jun 22 22:20:21 2008
@@ -28,12 +28,12 @@
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.name.Rdn;
 import org.apache.directory.studio.connection.core.DnUtils;
-import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.widgets.DnBuilderWidget;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyListener;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.IValue;
@@ -242,7 +242,7 @@
      * 
      * This implementation just checks if this page is complete. It 
      * doesn't call {@link #getNextPage()} to avoid unneeded 
-     * invokings of {@link ReadEntryJob}s.
+     * invokings of {@link ReadEntryRunnable}s.
      */
     public boolean canFlipToNextPage()
     {
@@ -253,7 +253,7 @@
     /**
      * {@inheritDoc}
      * 
-     * This implementation invokes a {@link ReadEntryJob} to check if an
+     * This implementation invokes a {@link ReadEntryRunnable} to check if an
      * entry with the composed DN already exists.
      */
     public IWizardPage getNextPage()
@@ -265,9 +265,9 @@
         final LdapDN dn = DnUtils.composeDn( rdn, parentDn );
 
         // check if parent exists or new entry already exists
-        ReadEntryJob readEntryJob1 = new ReadEntryJob( wizard.getSelectedConnection(), parentDn );
-        RunnableContextJobAdapter.execute( readEntryJob1, getContainer(), false );
-        IEntry parentEntry = readEntryJob1.getReadEntry();
+        ReadEntryRunnable readEntryRunnable1 = new ReadEntryRunnable( wizard.getSelectedConnection(), parentDn );
+        RunnableContextRunner.execute( readEntryRunnable1, getContainer(), false );
+        IEntry parentEntry = readEntryRunnable1.getReadEntry();
         if ( parentEntry == null )
         {
             getShell().getDisplay().syncExec( new Runnable()
@@ -280,9 +280,9 @@
             } );
             return null;
         }
-        ReadEntryJob readEntryJob2 = new ReadEntryJob( wizard.getSelectedConnection(), dn );
-        RunnableContextJobAdapter.execute( readEntryJob2, getContainer(), false );
-        IEntry entry = readEntryJob2.getReadEntry();
+        ReadEntryRunnable readEntryRunnable2 = new ReadEntryRunnable( wizard.getSelectedConnection(), dn );
+        RunnableContextRunner.execute( readEntryRunnable2, getContainer(), false );
+        IEntry entry = readEntryRunnable2.getReadEntry();
         if ( entry != null )
         {
             getShell().getDisplay().syncExec( new Runnable()

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryTypeWizardPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryTypeWizardPage.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryTypeWizardPage.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryTypeWizardPage.java Sun Jun 22 22:20:21 2008
@@ -22,18 +22,17 @@
 
 
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyListener;
 import org.apache.directory.studio.ldapbrowser.common.widgets.search.EntryWidget;
 import org.apache.directory.studio.ldapbrowser.core.events.EventRegistry;
-import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeAttributesJob;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.InitializeAttributesRunnable;
+import org.apache.directory.studio.ldapbrowser.core.jobs.ReadEntryRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
-import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyConnection;
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.schema.SchemaUtils;
 import org.apache.directory.studio.ldapbrowser.core.utils.ModelConverter;
@@ -168,9 +167,9 @@
             }
 
             // check if selected DN exists
-            ReadEntryJob readEntryJob = new ReadEntryJob( browserConnection, dn );
-            RunnableContextJobAdapter.execute( readEntryJob, getContainer(), false );
-            templateEntries[0] = readEntryJob.getReadEntry();
+            ReadEntryRunnable readEntryRunnable = new ReadEntryRunnable( browserConnection, dn );
+            RunnableContextRunner.execute( readEntryRunnable, getContainer(), false );
+            templateEntries[0] = readEntryRunnable.getReadEntry();
             if ( templateEntries[0] == null )
             {
                 getShell().getDisplay().syncExec( new Runnable()
@@ -186,8 +185,8 @@
             // init attributes
             if ( !templateEntries[0].isAttributesInitialized() )
             {
-                InitializeAttributesJob job = new InitializeAttributesJob( templateEntries, false );
-                RunnableContextJobAdapter.execute( job, getContainer() );
+                InitializeAttributesRunnable initializeAttributesRunnable = new InitializeAttributesRunnable( templateEntries, false );
+                RunnableContextRunner.execute( initializeAttributesRunnable, getContainer(), true );
             }
 
             // clone entry and remove non-modifyable attributes

Modified: directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryWizard.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryWizard.java (original)
+++ directory/studio/trunk/ldapbrowser-ui/src/main/java/org/apache/directory/studio/ldapbrowser/ui/wizards/NewEntryWizard.java Sun Jun 22 22:20:21 2008
@@ -22,11 +22,11 @@
 
 
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.studio.ldapbrowser.common.jobs.RunnableContextJobAdapter;
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.widgets.browser.BrowserCategory;
 import org.apache.directory.studio.ldapbrowser.common.widgets.browser.BrowserEntryPage;
 import org.apache.directory.studio.ldapbrowser.common.widgets.browser.BrowserSearchResultPage;
-import org.apache.directory.studio.ldapbrowser.core.jobs.CreateEntryJob;
+import org.apache.directory.studio.ldapbrowser.core.jobs.CreateEntryRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IAttribute;
 import org.apache.directory.studio.ldapbrowser.core.model.IBookmark;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
@@ -37,6 +37,7 @@
 import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyEntry;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIConstants;
 import org.apache.directory.studio.ldapbrowser.ui.BrowserUIPlugin;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.Wizard;
@@ -293,10 +294,9 @@
                 ocPage.saveDialogSettings();
                 dnPage.saveDialogSettings();
 
-                CreateEntryJob job = new CreateEntryJob( prototypeEntry, selectedConnection );
-                RunnableContextJobAdapter.execute( job, getContainer() );
-
-                if ( !job.getExternalResult().isOK() )
+                CreateEntryRunnable runnable = new CreateEntryRunnable( prototypeEntry, selectedConnection );
+                IStatus status = RunnableContextRunner.execute( runnable, getContainer(), true );
+                if ( !status.isOK() )
                 {
                     selectedConnection.getConnection().setReadOnly( true );
                     return false;

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/Project.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/Project.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/Project.java (original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/Project.java Sun Jun 22 22:20:21 2008
@@ -23,7 +23,7 @@
 import java.util.List;
 
 import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.schemaeditor.controller.SchemaHandler;
 import org.apache.directory.studio.schemaeditor.model.io.SchemaConnector;
 import org.apache.directory.studio.schemaeditor.model.schemachecker.SchemaChecker;

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/AbstractSchemaConnector.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/AbstractSchemaConnector.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/AbstractSchemaConnector.java (original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/AbstractSchemaConnector.java Sun Jun 22 22:20:21 2008
@@ -21,7 +21,7 @@
 
 
 import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
 
 
 /**

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java (original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/ApacheDsSchemaConnector.java Sun Jun 22 22:20:21 2008
@@ -32,7 +32,7 @@
 import org.apache.directory.shared.ldap.schema.ObjectClassTypeEnum;
 import org.apache.directory.shared.ldap.schema.UsageEnum;
 import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper;

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/SchemaConnector.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/SchemaConnector.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/SchemaConnector.java (original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/model/io/SchemaConnector.java Sun Jun 22 22:20:21 2008
@@ -23,7 +23,7 @@
 import java.util.List;
 
 import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.schemaeditor.model.Schema;
 
 

Modified: directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewProjectWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewProjectWizard.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewProjectWizard.java (original)
+++ directory/studio/trunk/schemaeditor/src/main/java/org/apache/directory/studio/schemaeditor/view/wizards/NewProjectWizard.java Sun Jun 22 22:20:21 2008
@@ -20,12 +20,6 @@
 package org.apache.directory.studio.schemaeditor.view.wizards;
 
 
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.StudioProgressMonitor;
 import org.apache.directory.studio.schemaeditor.Activator;
 import org.apache.directory.studio.schemaeditor.PluginUtils;
 import org.apache.directory.studio.schemaeditor.controller.ProjectsHandler;
@@ -33,11 +27,7 @@
 import org.apache.directory.studio.schemaeditor.model.Project;
 import org.apache.directory.studio.schemaeditor.model.ProjectType;
 import org.apache.directory.studio.schemaeditor.model.Schema;
-import org.apache.directory.studio.schemaeditor.model.io.SchemaConnector;
-import org.apache.directory.studio.schemaeditor.view.ViewUtils;
 import org.apache.directory.studio.schemaeditor.view.widget.CoreSchemasSelectionWidget.ServerTypeEnum;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.IWizardPage;
 import org.eclipse.jface.wizard.Wizard;

Modified: directory/studio/trunk/test-integration-core/src/main/java/org/apache/directory/studio/test/integration/core/JNDIConnectionWrapperTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-core/src/main/java/org/apache/directory/studio/test/integration/core/JNDIConnectionWrapperTest.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-core/src/main/java/org/apache/directory/studio/test/integration/core/JNDIConnectionWrapperTest.java (original)
+++ directory/studio/trunk/test-integration-core/src/main/java/org/apache/directory/studio/test/integration/core/JNDIConnectionWrapperTest.java Sun Jun 22 22:20:21 2008
@@ -38,7 +38,7 @@
 import org.apache.directory.studio.connection.core.Credentials;
 import org.apache.directory.studio.connection.core.IAuthHandler;
 import org.apache.directory.studio.connection.core.ICredentials;
-import org.apache.directory.studio.connection.core.StudioProgressMonitor;
+import org.apache.directory.studio.connection.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.connection.core.Connection.AliasDereferencingMethod;
 import org.apache.directory.studio.connection.core.Connection.ReferralHandlingMethod;
 import org.apache.directory.studio.connection.core.ConnectionParameter.AuthenticationMethod;

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java (original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/AutomatedSuite.java Sun Jun 22 22:20:21 2008
@@ -43,7 +43,7 @@
     public AutomatedSuite()
     {
         addTest( new TestSuite( PreparationTest.class ) );
-        
+
         addTest( new TestSuite( NewConnectionWizardTest.class ) );
         addTest( new TestSuite( NewEntryWizardTest.class ) );
         addTest( new TestSuite( RenameEntryDialogTest.class ) );

Modified: directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java (original)
+++ directory/studio/trunk/test-integration-ui/src/main/java/org/apache/directory/studio/test/integration/ui/NewConnectionWizardTest.java Sun Jun 22 22:20:21 2008
@@ -22,6 +22,7 @@
 
 
 import net.sf.swtbot.eclipse.finder.SWTEclipseBot;
+import net.sf.swtbot.wait.DefaultCondition;
 import net.sf.swtbot.widgets.SWTBotButton;
 import net.sf.swtbot.widgets.SWTBotCombo;
 import net.sf.swtbot.widgets.SWTBotMenu;
@@ -62,6 +63,11 @@
     }
 
 
+    /**
+     * Creates a new connection using the new connection wizard.
+     * 
+     * @throws Exception the exception
+     */
     public void testCreateConnection() throws Exception
     {
         // Select "Connections" view, ensure no connections exists yet
@@ -141,8 +147,97 @@
         connectionsTree.select( "NewConnectionWizardTest" );
         SWTBotMenu contextMenu = connectionsTree.contextMenu( "Close Connection" );
         contextMenu.click();
+    }
+
+
+    /**
+     * Tests the "Check Network Parameter" button.
+     * 
+     * @throws Exception the exception
+     */
+    public void testCheckNetworkParameterButtonOK() throws Exception
+    {
+        // Select "Connections" view, ensure no connections exists yet
+        SWTBotTree connectionsTree = SWTBotUtils.getConnectionsTree( bot );
+        assertEquals( 0, connectionsTree.rowCount() );
+
+        // open "New Connection" wizard
+        SWTBotMenu newConnectionMenu = connectionsTree.contextMenu( "New Connection..." );
+        newConnectionMenu.click();
 
-        Thread.sleep( 1000 );
+        // enter connection parameter
+        SWTBotText connText = bot.textWithLabel( "Connection name:" );
+        connText.setText( "NewConnectionWizardTest" );
+        SWTBotCombo hostnameCombo = bot.comboBox( "" );
+        hostnameCombo.setText( "localhost" );
+        SWTBotCombo portCombo = bot.comboBox( "" );
+        portCombo.setText( Integer.toString( ldapServer.getIpPort() ) );
+
+        // click "Check Network Parameter" button
+        SWTBotButton checkButton = bot.button( "Check Network Parameter" );
+        checkButton.click();
+
+        bot.waitUntil( new DefaultCondition()
+        {
+            public boolean test() throws Exception
+            {
+                return bot.activeShell().getText().equals( "Check Network Parameter" ) && bot.button( "OK" ) != null;
+            }
+
+
+            public String getFailureMessage()
+            {
+                return "Expected an dialog box 'Check Network Parameter' with an 'OK' button.";
+            }
+        } );
+
+        bot.button( "OK" ).click();
+        bot.button( "Cancel" ).click();
     }
 
+
+//    /**
+//     * Tests the "Check Network Parameter" button.
+//     * 
+//     * @throws Exception the exception
+//     */
+//    public void testCheckNetworkParameterButtonNOK() throws Exception
+//    {
+//        // Select "Connections" view, ensure no connections exists yet
+//        SWTBotTree connectionsTree = SWTBotUtils.getConnectionsTree( bot );
+//        assertEquals( 0, connectionsTree.rowCount() );
+//
+//        // open "New Connection" wizard
+//        SWTBotMenu newConnectionMenu = connectionsTree.contextMenu( "New Connection..." );
+//        newConnectionMenu.click();
+//
+//        // enter connection parameter
+//        SWTBotText connText = bot.textWithLabel( "Connection name:" );
+//        connText.setText( "NewConnectionWizardTest" );
+//        SWTBotCombo hostnameCombo = bot.comboBox( "" );
+//        hostnameCombo.setText( "localhost" );
+//        SWTBotCombo portCombo = bot.comboBox( "" );
+//        portCombo.setText( Integer.toString( ldapServer.getIpPort() + 1 ) );
+//
+//        // click "Check Network Parameter" button
+//        SWTBotButton checkButton = bot.button( "Check Network Parameter" );
+//        checkButton.click();
+//
+//        //TODO: error dialog does not pop up when using SWTBot???
+//        Thread.sleep( 2000 );
+//
+//        bot.waitUntil( new DefaultCondition()
+//        {
+//            public boolean test() throws Exception
+//            {
+//                return bot.activeShell().getText().equals( "Error" ) && bot.button( "OK" ) != null;
+//            }
+//
+//
+//            public String getFailureMessage()
+//            {
+//                return "Expected an dialog box 'Error' with an 'OK' button.";
+//            }
+//        } );
+//    }
 }

Modified: directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordDialog.java?rev=670449&r1=670448&r2=670449&view=diff
==============================================================================
--- directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordDialog.java (original)
+++ directory/studio/trunk/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/password/PasswordDialog.java Sun Jun 22 22:20:21 2008
@@ -25,14 +25,15 @@
 
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionParameter.AuthenticationMethod;
-import org.apache.directory.studio.connection.core.jobs.CheckBindJob;
-import org.apache.directory.studio.connection.ui.widgets.RunnableContextJobAdapter;
+import org.apache.directory.studio.connection.core.jobs.CheckBindRunnable;
+import org.apache.directory.studio.connection.ui.RunnableContextRunner;
 import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
 import org.apache.directory.studio.ldapbrowser.core.model.Password;
 import org.apache.directory.studio.ldapbrowser.core.utils.Utils;
 import org.apache.directory.studio.valueeditors.ValueEditorsActivator;
 import org.apache.directory.studio.valueeditors.ValueEditorsConstants;
+import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.MessageDialog;
@@ -492,9 +493,9 @@
             connection.setBindPassword( testPasswordText.getText() );
             connection.setAuthMethod( AuthenticationMethod.SIMPLE );
 
-            CheckBindJob job = new CheckBindJob( connection );
-            RunnableContextJobAdapter.execute( job );
-            if ( job.getExternalResult().isOK() )
+            CheckBindRunnable runnable = new CheckBindRunnable( connection );
+            IStatus status = RunnableContextRunner.execute( runnable, null, true );
+            if ( status.isOK() )
             {
                 MessageDialog.openInformation( Display.getDefault().getActiveShell(), "Check Authentication",
                     "The authentication was successful." );



Mime
View raw message