Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 7626 invoked from network); 21 Nov 2006 16:02:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Nov 2006 16:02:12 -0000 Received: (qmail 42116 invoked by uid 500); 21 Nov 2006 16:02:22 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 42074 invoked by uid 500); 21 Nov 2006 16:02:22 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 42063 invoked by uid 99); 21 Nov 2006 16:02:22 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Nov 2006 08:02:22 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Nov 2006 08:02:11 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 963781A9846; Tue, 21 Nov 2006 08:01:37 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r477719 - in /directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser: resources/icons/ src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/ src/main/java/org/apache/directory/ldapstudio/browser/view/ src/main/java/o... Date: Tue, 21 Nov 2006 16:01:37 -0000 To: commits@directory.apache.org From: pamarcelot@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061121160137.963781A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: pamarcelot Date: Tue Nov 21 08:01:36 2006 New Revision: 477719 URL: http://svn.apache.org/viewvc?view=rev&rev=477719 Log: Adding a new 'Running' state for a ConnectionWrapper that add a green triangle when a connection is currently running. Connections Icons have been updated too. Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/resources/icons/connection_error.gif directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/ConnectionEditAction.java directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/ImageKeys.java directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/ConnectionWizardInformationPage.java directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/wrappers/ConnectionWrapper.java Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/resources/icons/connection_error.gif URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/resources/icons/connection_error.gif?view=diff&rev=477719&r1=477718&r2=477719 ============================================================================== Binary files - no diff available. Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/ConnectionEditAction.java URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/ConnectionEditAction.java?view=diff&rev=477719&r1=477718&r2=477719 ============================================================================== --- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/ConnectionEditAction.java (original) +++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/controller/actions/ConnectionEditAction.java Tue Nov 21 08:01:36 2006 @@ -28,6 +28,7 @@ import org.apache.directory.ldapstudio.browser.view.views.ConnectionWizard; import org.apache.directory.ldapstudio.browser.view.views.ConnectionWizard.ConnectionWizardType; import org.apache.directory.ldapstudio.browser.view.views.wrappers.ConnectionWrapper; +import org.apache.directory.ldapstudio.browser.view.views.wrappers.ConnectionWrapper.ConnectionWrapperState; import org.eclipse.jface.action.Action; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TreeSelection; @@ -79,7 +80,7 @@ } // Updating the state of the Connection since it has changed (this causes the icon to change) - connectionWrapper.setHasError( false ); + connectionWrapper.setState( ConnectionWrapperState.NONE ); connectionWrapper.connectionChanged(); selectedConnection.notifyListeners(); Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/ImageKeys.java URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/ImageKeys.java?view=diff&rev=477719&r1=477718&r2=477719 ============================================================================== --- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/ImageKeys.java (original) +++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/ImageKeys.java Tue Nov 21 08:01:36 2006 @@ -31,6 +31,7 @@ public static final String CONNECTION_DELETE = "resources/icons/connection_delete.gif"; //$NON-NLS-1$ public static final String CONNECTION_EDIT = "resources/icons/connection_edit.gif"; //$NON-NLS-1$ public static final String CONNECTION_NEW = "resources/icons/connection_new.gif"; //$NON-NLS-1$ + public static final String CONNECTION_RUNNING = "resources/icons/connection_running.gif"; //$NON-NLS-1$ public static final String ENTRY = "resources/icons/entry.gif"; //$NON-NLS-1$ public static final String ENTRY_NEW = "resources/icons/entry_new.gif"; //$NON-NLS-1$ public static final String ENTRY_DELETE = "resources/icons/entry_delete.gif"; //$NON-NLS-1$ Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/ConnectionWizardInformationPage.java URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/ConnectionWizardInformationPage.java?view=diff&rev=477719&r1=477718&r2=477719 ============================================================================== --- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/ConnectionWizardInformationPage.java (original) +++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/ConnectionWizardInformationPage.java Tue Nov 21 08:01:36 2006 @@ -161,7 +161,7 @@ // Prefix User DN with Base DN Label prefixUserDNLabel = new Label( userGroup, SWT.NONE ); prefixUserDN = new Button( userGroup, SWT.CHECK ); - prefixUserDN.setText( "Prefix User DN with Base DN" ); + prefixUserDN.setText( "Append Base DN to User DN" ); prefixUserDN.setLayoutData( new GridData( GridData.FILL, SWT.NONE, true, false ) ); // Password Modified: directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/wrappers/ConnectionWrapper.java URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/wrappers/ConnectionWrapper.java?view=diff&rev=477719&r1=477718&r2=477719 ============================================================================== --- directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/wrappers/ConnectionWrapper.java (original) +++ directory/sandbox/pamarcelot/ldapstudio/ldapstudio-browser/src/main/java/org/apache/directory/ldapstudio/browser/view/views/wrappers/ConnectionWrapper.java Tue Nov 21 08:01:36 2006 @@ -47,22 +47,38 @@ */ public class ConnectionWrapper implements Comparable, DisplayableTreeViewerElement { + /** + * This enum represents the different states of a ConnectionWrapper + * + * @author Apache Directory Project + */ + public enum ConnectionWrapperState{ NONE, RUNNING, ERROR } + + /** The parent element */ private Object parent; - + + /** The children list */ private List children; - + /** The wrapped conneection */ private Connection connection; + + /** The state of the ConnectionWrapper*/ + private ConnectionWrapperState state; - /** The hasError Flag */ - private boolean hasError = false; - + /** The DSML Engine used to connect to the server*/ private Dsmlv2Engine engine; + /** + * Creates a new instance of ConnectionWrapper. + * + * @param connection the connection to wrap + */ public ConnectionWrapper( Connection connection ) { this.connection = connection; + this.state = ConnectionWrapperState.NONE; } @@ -80,11 +96,24 @@ */ public Image getDisplayImage() { - if ( hasError() ) + if ( state == ConnectionWrapperState.NONE ) + { + return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.CONNECTION ).createImage(); + } + else if ( state == ConnectionWrapperState.RUNNING ) + { + return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.CONNECTION_RUNNING ).createImage(); + } + else if ( state == ConnectionWrapperState.ERROR ) { - return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.CONNECTION_ERROR ) - .createImage(); + return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.CONNECTION_ERROR ).createImage(); } + +// if ( hasError() ) +// { +// return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.CONNECTION_ERROR ) +// .createImage(); +// } return AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID, ImageKeys.CONNECTION ).createImage(); } @@ -175,14 +204,6 @@ if ( ldapResult.getResultCode() == 0 ) { - // Updating the HasError Flag and updating the UI - if ( hasError() ) - { - setHasError( false ); - - browserView.getViewer().update( this, null ); - } - // Getting the Base DN SearchResultEntry baseDN = ( ( SearchResponse ) ldapResponse ).getCurrentSearchResultEntry(); @@ -191,32 +212,33 @@ baseDNWrapper.setIsBaseDN( true ); children.add( baseDNWrapper ); + + setState( ConnectionWrapperState.RUNNING ); + browserView.getViewer().update( this, null ); } else { + setState( ConnectionWrapperState.ERROR ); + clearChildren(); + browserView.getViewer().update( this, null ); + // Displaying an error MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error !", "An error has ocurred.\n" + ldapResult.getErrorMessage() ); - - setHasError( true ); - clearChildren(); - - browserView.getViewer().update( this, null ); return null; } } else if ( ldapResponse instanceof ErrorResponse ) { - setHasError( true ); + setState( ConnectionWrapperState.ERROR ); clearChildren(); + browserView.getViewer().update( this, null ); ErrorResponse errorResponse = ( ErrorResponse ) ldapResponse; // Displaying an error MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error !", "An error has ocurred.\n" + errorResponse.getMessage() ); - browserView.getViewer().update( this, null ); - return null; } } @@ -250,24 +272,23 @@ engine = null; } - + /** - * Gets the hasError Flag - * @return + * Sets the current state of the ConnectionWrapper + * @param state the state to set */ - public boolean hasError() + public void setState( ConnectionWrapperState state ) { - return hasError; + this.state = state; } - - + /** - * Sets the hasError Flag - * @param hasError the value of the flag + * Gets the current state of the ConnectionWrapper + * @return the state of the ConnectionWrapper */ - public void setHasError( boolean hasError ) + public ConnectionWrapperState getState() { - this.hasError = hasError; + return this.state; } /**