directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r657913 - in /directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations: ./ META-INF/ src/main/java/org/apache/directory/studio/apacheds/experimentations/ src/main/java/org/apache/directory/studio/apacheds/experim...
Date Mon, 19 May 2008 18:46:46 GMT
Author: pamarcelot
Date: Mon May 19 11:46:46 2008
New Revision: 657913

URL: http://svn.apache.org/viewvc?rev=657913&view=rev
Log:
o Added a new plugin dependency.
o Added a DoubleClickListener which opens the server.xml file within the Apache DS Server
Configuration Editor.

Modified:
    directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/META-INF/MANIFEST.MF
    directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/pom.xml
    directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ApacheDsPluginUtils.java
    directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/views/ServersView.java

Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/META-INF/MANIFEST.MF?rev=657913&r1=657912&r2=657913&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/META-INF/MANIFEST.MF
(original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/META-INF/MANIFEST.MF
Mon May 19 11:46:46 2008
@@ -11,9 +11,11 @@
  org.eclipse.jface.text,
  org.eclipse.jdt.launching,
  org.eclipse.debug.core,
- org.eclipse.debug.ui
+ org.eclipse.debug.ui,
+ org.apache.directory.studio.apacheds.configuration
 Eclipse-LazyStart: true
 Bundle-ClassPath: .,
+ lib/apacheds.configuration-1.2.0.SNAPSHOT.jar,
  lib/dom4j-1.6.1.jar,
  lib/log4j-1.2.14.jar,
  lib/mina-core-1.1.2.jar,

Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/pom.xml?rev=657913&r1=657912&r2=657913&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/pom.xml
(original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/pom.xml
Mon May 19 11:46:46 2008
@@ -97,7 +97,7 @@
               <goal>copy</goal>
             </goals>
             <configuration>
-              <outputDirectory>test</outputDirectory>
+              <outputDirectory>resources/libs</outputDirectory>
               <artifactItems>
                 <artifactItem>
                   <groupId>antlr</groupId>
@@ -642,5 +642,9 @@
         <version>0.0.1</version>
         <scope>provided</scope>
      </dependency>
+      <dependency>
+        <groupId>org.apache.directory.studio</groupId>
+        <artifactId>apacheds.configuration</artifactId>
+      </dependency>
   </dependencies>
 </project>

Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ApacheDsPluginUtils.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ApacheDsPluginUtils.java?rev=657913&r1=657912&r2=657913&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ApacheDsPluginUtils.java
(original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ApacheDsPluginUtils.java
Mon May 19 11:46:46 2008
@@ -54,19 +54,19 @@
         { "antlr-2.7.7.jar", "apacheds-bootstrap-extract-1.5.2.jar", "apacheds-bootstrap-partition-1.5.2.jar",
             "apacheds-btree-base-1.5.2.jar", "apacheds-core-1.5.2.jar", "apacheds-core-constants-1.5.2.jar",
             "apacheds-core-entry-1.5.2.jar", "apacheds-core-shared-1.5.2.jar", "apacheds-jdbm-store-1.5.2.jar",
-            "apacheds-kerberos-shared-1.5.2.jar", "apacheds-noarch-installer-1.5.2.jar",
-            "apacheds-protocol-changepw-1.5.2.jar", "apacheds-protocol-dns-1.5.2.jar",
-            "apacheds-protocol-kerberos-1.5.2.jar", "apacheds-protocol-ldap-1.5.2.jar",
-            "apacheds-protocol-ntp-1.5.2.jar", "apacheds-protocol-shared-1.5.2.jar",
-            "apacheds-schema-bootstrap-1.5.2.jar", "apacheds-schema-extras-1.5.2.jar",
-            "apacheds-schema-registries-1.5.2.jar", "apacheds-server-jndi-1.5.2.jar", "apacheds-server-xml-1.5.2.jar",
-            "apacheds-utils-1.5.2.jar", "apacheds-xbean-spring-1.5.2.jar", "bootstrapper.jar",
"commons-cli-1.1.jar",
-            "commons-collections-3.2.jar", "commons-daemon-1.0.1.jar", "commons-lang-2.3.jar",
+            "apacheds-kerberos-shared-1.5.2.jar", "apacheds-protocol-changepw-1.5.2.jar",
+            "apacheds-protocol-dns-1.5.2.jar", "apacheds-protocol-kerberos-1.5.2.jar",
+            "apacheds-protocol-ldap-1.5.2.jar", "apacheds-protocol-ntp-1.5.2.jar",
+            "apacheds-protocol-shared-1.5.2.jar", "apacheds-schema-bootstrap-1.5.2.jar",
+            "apacheds-schema-extras-1.5.2.jar", "apacheds-schema-registries-1.5.2.jar",
+            "apacheds-server-jndi-1.5.2.jar", "apacheds-server-xml-1.5.2.jar", "apacheds-utils-1.5.2.jar",
+            "apacheds-xbean-spring-1.5.2.jar", "commons-cli-1.1.jar", "commons-collections-3.2.jar",
+            "commons-daemon-1.0.1.jar", "commons-lang-2.3.jar", "daemon-bootstrappers-1.1.3.jar",
             "jcl104-over-slf4j-1.4.3.jar", "jdbm-1.0.jar", "log4j-1.2.14.jar", "mina-core-1.1.2.jar",
             "mina-filter-ssl-1.1.2.jar", "shared-asn1-0.9.10.jar", "shared-asn1-codec-0.9.10.jar",
             "shared-bouncycastle-reduced-0.9.10.jar", "shared-ldap-0.9.10.jar", "shared-ldap-constants-0.9.10.jar",
             "slf4j-api-1.4.3.jar", "slf4j-log4j12-1.4.3.jar", "spring-beans-2.0.6.jar", "spring-context-2.0.6.jar",
-            "spring-core-2.0.6.jar", "studio-apacheds-launcher-0.0.1.jar", "xbean-spring-3.2.jar"
};
+            "spring-core-2.0.6.jar", "studio-apacheds-launcher-0.0.1.jar", "xbean-spring-3.3.jar"
};
 
 
     /**

Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/views/ServersView.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/views/ServersView.java?rev=657913&r1=657912&r2=657913&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/views/ServersView.java
(original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/views/ServersView.java
Mon May 19 11:46:46 2008
@@ -20,23 +20,37 @@
 package org.apache.directory.studio.apacheds.experimentations.views;
 
 
+import org.apache.directory.studio.apacheds.configuration.editor.ServerConfigurationEditor;
 import org.apache.directory.studio.apacheds.experimentations.ApacheDsPlugin;
 import org.apache.directory.studio.apacheds.experimentations.ApacheDsPluginConstants;
+import org.apache.directory.studio.apacheds.experimentations.ApacheDsPluginUtils;
 import org.apache.directory.studio.apacheds.experimentations.actions.NewServerInstanceAction;
 import org.apache.directory.studio.apacheds.experimentations.actions.ServerInstanceRunAction;
 import org.apache.directory.studio.apacheds.experimentations.actions.ServerInstanceStopAction;
 import org.apache.directory.studio.apacheds.experimentations.model.ServerInstance;
 import org.apache.directory.studio.apacheds.experimentations.model.ServersHandler;
 import org.apache.directory.studio.apacheds.experimentations.model.ServersHandlerListener;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.action.IToolBarManager;
 import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
 import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TableViewer;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPathEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.part.ViewPart;
 
 
@@ -193,6 +207,32 @@
     {
         ServersHandler serversHandler = ServersHandler.getDefault();
         serversHandler.addListener( serversHandlerListener );
+
+        tableViewer.addDoubleClickListener( new IDoubleClickListener()
+        {
+            public void doubleClick( DoubleClickEvent event )
+            {
+                // What we get from the TableViewer is a StructuredSelection
+                StructuredSelection selection = ( StructuredSelection ) event.getSelection();
+
+                // Here's the real object
+                ServerInstance serverInstance = ( ServerInstance ) selection.getFirstElement();
+                IEditorInput input = null;
+                String editorId = null;
+
+                IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+                try
+                {
+                    page.openEditor( new PathEditorInput( ApacheDsPluginUtils.getApacheDsInstancesFolder().append(
+                        serverInstance.getId() ).append( "conf" ).append( "server.xml" )
),
+                        ServerConfigurationEditor.ID );
+                }
+                catch ( PartInitException e )
+                {
+                    // TODO
+                }
+            }
+        } );
     }
 
 
@@ -219,3 +259,144 @@
         super.dispose();
     }
 }
+
+/**
+ * This IEditorInput is used to open files that are located in the local file system.
+ * 
+ * Inspired from org.eclipse.ui.internal.editors.text.NonExistingFileEditorInput.java
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+class PathEditorInput implements IPathEditorInput
+{
+    /** The absolute path in local file system */
+    private IPath path;
+
+
+    /**
+     * 
+     * Creates a new instance of PathEditorInput.
+     *
+     * @param path the absolute path
+     */
+    public PathEditorInput( IPath path )
+    {
+        if ( path == null )
+        {
+            throw new IllegalArgumentException();
+        }
+
+        this.path = path;
+    }
+
+
+    /**
+     * Returns hash code of the path.
+     */
+    public int hashCode()
+    {
+        return path.hashCode();
+    }
+
+
+    /** 
+     * This implemention just compares the paths
+     */
+    public boolean equals( Object o )
+    {
+        if ( this == o )
+        {
+            return true;
+        }
+
+        if ( o instanceof PathEditorInput )
+        {
+            PathEditorInput input = ( PathEditorInput ) o;
+            return path.equals( input.path );
+        }
+
+        return false;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean exists()
+    {
+        return path.toFile().exists();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public ImageDescriptor getImageDescriptor()
+    {
+        return PlatformUI.getWorkbench().getEditorRegistry().getImageDescriptor( path.toString()
);
+    }
+
+
+    /**
+     * Returns the file name only.
+     */
+    public String getName()
+    {
+        return path.toFile().getName();
+        //return path.toString();
+    }
+
+
+    /**
+     * Returns the complete path. 
+     */
+    public String getToolTipText()
+    {
+        return path.makeRelative().toOSString();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public IPath getPath()
+    {
+        return path;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    @SuppressWarnings("unchecked")
+    public Object getAdapter( Class adapter )
+    {
+        return Platform.getAdapterManager().getAdapter( this, adapter );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public IPersistableElement getPersistable()
+    {
+        return null;
+    }
+
+
+    /**
+     * Returns the path.
+     */
+    public IPath getErrorMessage( Object element )
+    {
+        if ( element instanceof PathEditorInput )
+        {
+            PathEditorInput input = ( PathEditorInput ) element;
+            return input.getPath();
+        }
+
+        return null;
+    }
+
+}



Mime
View raw message