directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r581738 - in /directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets: ConnectionContentProvider.java ConnectionUniversalListener.java
Date Wed, 03 Oct 2007 22:03:45 GMT
Author: seelmann
Date: Wed Oct  3 15:03:44 2007
New Revision: 581738

URL: http://svn.apache.org/viewvc?rev=581738&view=rev
Log:
DIRSTUDIO-187: expand connection folder when adding a new connection

Modified:
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionContentProvider.java
    directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionContentProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionContentProvider.java?rev=581738&r1=581737&r2=581738&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionContentProvider.java
(original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionContentProvider.java
Wed Oct  3 15:03:44 2007
@@ -44,9 +44,7 @@
 {
 
     /**
-     * {@inheritDoc}
-     * 
-     * This implementation does nothing.
+     * @see org.eclipse.jface.viewers.IContentProvider#inputChanged(org.eclipse.jface.viewers.Viewer,
java.lang.Object, java.lang.Object)
      */
     public void inputChanged( Viewer viewer, Object oldInput, Object newInput )
     {
@@ -54,9 +52,7 @@
 
 
     /**
-     * {@inheritDoc}
-     * 
-     * This implementation does nothing.
+     * @see org.eclipse.jface.viewers.IContentProvider#dispose()
      */
     public void dispose()
     {
@@ -64,9 +60,7 @@
 
 
     /**
-     * {@inheritDoc}
-     * 
-     * This implementation accepts the ConnectionFolderManager and returns its connections.
+     * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
      */
     public Object[] getElements( Object inputElement )
     {
@@ -84,6 +78,9 @@
     }
 
 
+    /**
+     * @see org.eclipse.jface.viewers.ITreeContentProvider#getChildren(java.lang.Object)
+     */
     public Object[] getChildren( Object parentElement )
     {
         if ( parentElement != null && parentElement instanceof ConnectionFolder )
@@ -119,12 +116,31 @@
     }
 
 
+    /**
+     * @see org.eclipse.jface.viewers.ITreeContentProvider#getParent(java.lang.Object)
+     */
     public Object getParent( Object element )
     {
-        return null;
+        if ( element instanceof ConnectionFolder )
+        {
+            return ConnectionCorePlugin.getDefault().getConnectionFolderManager().getParentConnectionFolder(
+                ( ConnectionFolder ) element );
+        }
+        else if ( element instanceof Connection )
+        {
+            return ConnectionCorePlugin.getDefault().getConnectionFolderManager().getParentConnectionFolder(
+                ( Connection ) element );
+        }
+        else
+        {
+            return null;
+        }
     }
 
 
+    /**
+     * @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
+     */
     public boolean hasChildren( Object element )
     {
         Object[] children = getChildren( element );

Modified: directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java?rev=581738&r1=581737&r2=581738&view=diff
==============================================================================
--- directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
(original)
+++ directory/studio/trunk/studio-connection-ui/src/main/java/org/apache/directory/studio/connection/ui/widgets/ConnectionUniversalListener.java
Wed Oct  3 15:03:44 2007
@@ -116,7 +116,7 @@
         connectionUpdated( connection );
         if ( viewer != null )
         {
-            viewer.setSelection( new StructuredSelection( connection ) );
+            viewer.setSelection( new StructuredSelection( connection ), true );
         }
     }
 



Mime
View raw message