directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1063288 - in /directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor: OverviewPage.java ServerConfigurationEditor.java
Date Tue, 25 Jan 2011 14:13:06 GMT
Author: pamarcelot
Date: Tue Jan 25 14:13:06 2011
New Revision: 1063288

URL: http://svn.apache.org/viewvc?rev=1063288&view=rev
Log:
Added link listeners that move the user to the dedicated page.

Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java?rev=1063288&r1=1063287&r2=1063288&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/OverviewPage.java
Tue Jan 25 14:13:06 2011
@@ -42,6 +42,9 @@ import org.eclipse.swt.widgets.Composite
 import org.eclipse.swt.widgets.Label;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
 import org.eclipse.ui.forms.widgets.FormToolkit;
 import org.eclipse.ui.forms.widgets.Hyperlink;
 import org.eclipse.ui.forms.widgets.Section;
@@ -153,6 +156,13 @@ public class OverviewPage extends Server
             "Advanced LDAP/LDAPS configuration...", SWT.NONE );
         openLdapConfigurationLink.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true,
false,
             gridLayout.numColumns, 1 ) );
+        openLdapConfigurationLink.addHyperlinkListener( new HyperlinkAdapter()
+        {
+            public void linkActivated( HyperlinkEvent e )
+            {
+                getServerConfigurationEditor().showPage( LdapLdapsServersPage.class );
+            }
+        } );
     }
 
 
@@ -189,6 +199,13 @@ public class OverviewPage extends Server
             "Advanced Kerberos configuration...", SWT.NONE );
         openKerberosConfigurationLink.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true,
false,
             gridLayout.numColumns, 1 ) );
+        openKerberosConfigurationLink.addHyperlinkListener( new HyperlinkAdapter()
+        {
+            public void linkActivated( HyperlinkEvent e )
+            {
+                getServerConfigurationEditor().showPage( KerberosServerPage.class );
+            }
+        } );
     }
 
 
@@ -226,6 +243,13 @@ public class OverviewPage extends Server
             "Advanced Partitions configuration...", SWT.NONE );
         openPartitionsConfigurationLink.setLayoutData( new GridData( SWT.FILL, SWT.NONE,
true, false,
             gridLayout.numColumns, 1 ) );
+        openPartitionsConfigurationLink.addHyperlinkListener( new HyperlinkAdapter()
+        {
+            public void linkActivated( HyperlinkEvent e )
+            {
+                getServerConfigurationEditor().showPage( PartitionsPage.class );
+            }
+        } );
     }
 
 
@@ -253,6 +277,13 @@ public class OverviewPage extends Server
             "Advanced Options configuration...", SWT.NONE );
         openOptionsConfigurationLink.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true,
false,
             gridLayout.numColumns, 1 ) );
+        openOptionsConfigurationLink.addHyperlinkListener( new HyperlinkAdapter()
+        {
+            public void linkActivated( HyperlinkEvent e )
+            {
+                getServerConfigurationEditor().showPage( null );
+            }
+        } );
     }
 
 

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java?rev=1063288&r1=1063287&r2=1063288&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
Tue Jan 25 14:13:06 2011
@@ -21,6 +21,7 @@ package org.apache.directory.studio.apac
 
 
 import java.lang.reflect.InvocationTargetException;
+import java.util.Enumeration;
 
 import org.apache.directory.server.config.ConfigWriter;
 import org.apache.directory.server.config.beans.ConfigBean;
@@ -109,8 +110,6 @@ public class ServerConfigurationEditor e
         }
         catch ( PartInitException e )
         {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
         }
 
         showOrHideTabFolder();
@@ -387,8 +386,6 @@ public class ServerConfigurationEditor e
         }
         catch ( PartInitException e )
         {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
         }
 
         // Activating the first page
@@ -399,6 +396,27 @@ public class ServerConfigurationEditor e
 
 
     /**
+     * Set a particular page as active if it is found in the pages vector.
+     *
+     * @param pageClass
+     *      the class of the page
+     */
+    public void showPage( Class<?> pageClass )
+    {
+        Enumeration<Object> enumeration = pages.elements();
+        while ( enumeration.hasMoreElements() )
+        {
+            Object page = enumeration.nextElement();
+            if ( pageClass.isInstance( page ) )
+            {
+                setActivePage( pages.indexOf( page ) );
+                return;
+            }
+        }
+    }
+
+
+    /**
      * Gets the configuration writer.
      *
      * @return



Mime
View raw message