directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1058183 - in /directory/studio/trunk/plugins: apacheds.configuration.v2/ apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ apacheds.configuration/ apacheds.configuration/src/main/java/org...
Date Wed, 12 Jan 2011 15:23:47 GMT
Author: pamarcelot
Date: Wed Jan 12 15:23:46 2011
New Revision: 1058183

URL: http://svn.apache.org/viewvc?rev=1058183&view=rev
Log:
Moved the widely used (and duplicated) PathEditorInput class to the 'common.ui' plugin for
reusability.

Added:
    directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/filesystem/
    directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/filesystem/PathEditorInput.java
Removed:
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/PathEditorInput.java
    directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/PathEditorInput.java
Modified:
    directory/studio/trunk/plugins/apacheds.configuration.v2/pom.xml
    directory/studio/trunk/plugins/apacheds.configuration.v2/src/main/java/org/apache/directory/studio/apacheds/configuration/v2/editor/ServerConfigurationEditor.java
    directory/studio/trunk/plugins/apacheds.configuration/pom.xml
    directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
    directory/studio/trunk/plugins/common.ui/pom.xml
    directory/studio/trunk/plugins/ldapservers.apacheds.v153/pom.xml
    directory/studio/trunk/plugins/ldapservers.apacheds.v153/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v153/ApacheDS153LdapServerAdapter.java
    directory/studio/trunk/plugins/ldapservers.apacheds.v154/pom.xml
    directory/studio/trunk/plugins/ldapservers.apacheds.v154/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v154/ApacheDS154LdapServerAdapter.java
    directory/studio/trunk/plugins/ldapservers.apacheds.v155/pom.xml
    directory/studio/trunk/plugins/ldapservers.apacheds.v155/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v155/ApacheDS155LdapServerAdapter.java
    directory/studio/trunk/plugins/ldapservers.apacheds.v156/pom.xml
    directory/studio/trunk/plugins/ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v156/ApacheDS156LdapServerAdapter.java
    directory/studio/trunk/plugins/ldapservers.apacheds.v157/pom.xml
    directory/studio/trunk/plugins/ldapservers.apacheds.v157/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v157/ApacheDS157LdapServerAdapter.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/OpenConfigurationAction.java
    directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java

Modified: directory/studio/trunk/plugins/apacheds.configuration.v2/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration.v2/pom.xml?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration.v2/pom.xml (original)
+++ directory/studio/trunk/plugins/apacheds.configuration.v2/pom.xml Wed Jan 12 15:23:46 2011
@@ -126,6 +126,7 @@
  org.eclipse.core.runtime,
  org.eclipse.core.resources,
  org.eclipse.ui,
+ org.eclipse.ui.editors,
  org.eclipse.ui.forms,
  org.eclipse.ui.ide</Require-Bundle>
             <Export-Package>org.apache.directory.studio.apacheds.configuration.v2*</Export-Package>
@@ -277,6 +278,11 @@
     </dependency>
     <dependency>
       <groupId>org.eclipse.ui</groupId>
+      <artifactId>editors</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.ui</groupId>
       <artifactId>forms</artifactId>
       <scope>provided</scope>
     </dependency>

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=1058183&r1=1058182&r2=1058183&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
Wed Jan 12 15:23:46 2011
@@ -39,21 +39,18 @@ import org.apache.directory.studio.commo
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
 import org.apache.directory.studio.common.core.jobs.StudioRunnableWithProgress;
 import org.apache.directory.studio.common.ui.CommonUIUtils;
+import org.apache.directory.studio.common.ui.filesystem.PathEditorInput;
 import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
 import org.apache.directory.studio.ldapbrowser.core.jobs.ExecuteLdifRunnable;
-import org.apache.directory.studio.ldapbrowser.core.jobs.ImportLdifRunnable;
 import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.FileDialog;
@@ -61,9 +58,7 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.IPathEditorInput;
-import org.eclipse.ui.IPersistableElement;
 import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.dialogs.SaveAsDialog;
 import org.eclipse.ui.forms.editor.FormEditor;
 import org.eclipse.ui.part.FileEditorInput;
@@ -342,6 +337,7 @@ public class ServerConfigurationEditor e
         }
     }
 
+
     /**
      * Performs the "Save as..." action.
      *
@@ -581,141 +577,3 @@ public class ServerConfigurationEditor e
         return new ConfigWriter( ApacheDS2ConfigurationPlugin.getDefault().getSchemaManager(),
configBean );
     }
 }
-
-/**
- * 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>
- */
-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}
-     */
-    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;
-    }
-}

Modified: directory/studio/trunk/plugins/apacheds.configuration/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration/pom.xml?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration/pom.xml (original)
+++ directory/studio/trunk/plugins/apacheds.configuration/pom.xml Wed Jan 12 15:23:46 2011
@@ -116,6 +116,7 @@
  org.eclipse.core.runtime,
  org.eclipse.jface.text,
  org.eclipse.ui,
+ org.eclipse.ui.editors,
  org.eclipse.ui.forms,
  org.eclipse.ui.ide,
  org.dom4j.dom4j;bundle-version="${org.dom4j.version}"</Require-Bundle>
@@ -193,6 +194,11 @@
     </dependency>
     <dependency>
       <groupId>org.eclipse.ui</groupId>
+      <artifactId>editors</artifactId>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.eclipse.ui</groupId>
       <artifactId>forms</artifactId>
       <scope>provided</scope>
     </dependency>

Modified: directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
(original)
+++ directory/studio/trunk/plugins/apacheds.configuration/src/main/java/org/apache/directory/studio/apacheds/configuration/editor/ServerConfigurationEditor.java
Wed Jan 12 15:23:46 2011
@@ -44,19 +44,17 @@ import org.apache.directory.studio.apach
 import org.apache.directory.studio.apacheds.configuration.model.v156.ServerXmlIOV156;
 import org.apache.directory.studio.apacheds.configuration.model.v157.ServerXmlIOV157;
 import org.apache.directory.studio.common.ui.CommonUIUtils;
+import org.apache.directory.studio.common.ui.filesystem.PathEditorInput;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.ResourcesPlugin;
 import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.osgi.util.NLS;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.FileDialog;
@@ -65,7 +63,6 @@ import org.eclipse.swt.widgets.Shell;
 import org.eclipse.ui.IEditorInput;
 import org.eclipse.ui.IEditorSite;
 import org.eclipse.ui.IPathEditorInput;
-import org.eclipse.ui.IPersistableElement;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
 import org.eclipse.ui.dialogs.SaveAsDialog;
@@ -800,143 +797,3 @@ public class ServerConfigurationEditor e
         return errorMessage;
     }
 }
-
-/**
- * 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>
- */
-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;
-    }
-
-}

Modified: directory/studio/trunk/plugins/common.ui/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/common.ui/pom.xml?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/common.ui/pom.xml (original)
+++ directory/studio/trunk/plugins/common.ui/pom.xml Wed Jan 12 15:23:46 2011
@@ -113,7 +113,8 @@
             <Eclipse-LazyStart>true</Eclipse-LazyStart>
             <Bundle-Activator>org.apache.directory.studio.common.ui.CommonUIPlugin</Bundle-Activator>
             <Require-Bundle>org.eclipse.core.runtime,
- org.eclipse.ui</Require-Bundle>
+ org.eclipse.ui,
+ org.eclipse.ui.editors</Require-Bundle>
             <Export-Package>org.apache.directory.studio.*</Export-Package>
             <Import-Package>!</Import-Package>
             <Private-Package>!</Private-Package>
@@ -192,6 +193,11 @@
       <artifactId>ui</artifactId>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>org.eclipse.ui</groupId>
+      <artifactId>editors</artifactId>
+      <scope>provided</scope>
+    </dependency>
   </dependencies>
 
 </project>
\ No newline at end of file

Added: directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/filesystem/PathEditorInput.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/filesystem/PathEditorInput.java?rev=1058183&view=auto
==============================================================================
--- directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/filesystem/PathEditorInput.java
(added)
+++ directory/studio/trunk/plugins/common.ui/src/main/java/org/apache/directory/studio/common/ui/filesystem/PathEditorInput.java
Wed Jan 12 15:23:46 2011
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.apache.directory.studio.common.ui.filesystem;
+
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IPathEditorInput;
+import org.eclipse.ui.IPersistableElement;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.editors.text.ILocationProvider;
+
+
+/**
+ * This EditorInput 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>
+ */
+public class PathEditorInput implements IPathEditorInput, ILocationProvider
+{
+    /** 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 names
+     */
+    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();
+    }
+
+
+    /**
+     * Returns the path. 
+     */
+    public IPath getPath()
+    {
+        return path;
+    }
+
+
+    /**
+     * An EditorInput must return a good ILocationProvider, otherwise
+     * the editor is not editable.
+     */
+    public Object getAdapter( Class adapter )
+    {
+        if ( ILocationProvider.class.equals( adapter ) )
+        {
+            return this;
+        }
+
+        return Platform.getAdapterManager().getAdapter( this, adapter );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     * */
+    public IPersistableElement getPersistable()
+    {
+        return null;
+    }
+
+
+    /**
+     * Returns the path.
+     */
+    public IPath getPath( Object element )
+    {
+        if ( element instanceof PathEditorInput )
+        {
+            PathEditorInput input = ( PathEditorInput ) element;
+            return input.getPath();
+        }
+
+        return null;
+    }
+}

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v153/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v153/pom.xml?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v153/pom.xml (original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v153/pom.xml Wed Jan 12 15:23:46 2011
@@ -127,6 +127,7 @@
  org.eclipse.jdt.launching,
  org.eclipse.jface.text,
  org.eclipse.ui,
+ org.eclipse.ui.editors,
  org.eclipse.ui.ide</Require-Bundle>
             <Export-Package>org.apache.directory.studio.*</Export-Package>
             <Import-Package>!</Import-Package>

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v153/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v153/ApacheDS153LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v153/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v153/ApacheDS153LdapServerAdapter.java?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v153/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v153/ApacheDS153LdapServerAdapter.java
(original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v153/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v153/ApacheDS153LdapServerAdapter.java
Wed Jan 12 15:23:46 2011
@@ -32,9 +32,9 @@ import org.apache.directory.studio.apach
 import org.apache.directory.studio.apacheds.configuration.model.v153.ServerConfigurationV153;
 import org.apache.directory.studio.apacheds.configuration.model.v153.ServerXmlIOV153;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
+import org.apache.directory.studio.common.ui.filesystem.PathEditorInput;
 import org.apache.directory.studio.ldapservers.LdapServersManager;
 import org.apache.directory.studio.ldapservers.LdapServersUtils;
-import org.apache.directory.studio.ldapservers.jobs.PathEditorInput;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
 import org.eclipse.core.runtime.IPath;

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v154/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v154/pom.xml?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v154/pom.xml (original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v154/pom.xml Wed Jan 12 15:23:46 2011
@@ -127,6 +127,7 @@
  org.eclipse.jdt.launching,
  org.eclipse.jface.text,
  org.eclipse.ui,
+ org.eclipse.ui.editors,
  org.eclipse.ui.ide</Require-Bundle>
             <Export-Package>org.apache.directory.studio.*</Export-Package>
             <Import-Package>!</Import-Package>

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v154/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v154/ApacheDS154LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v154/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v154/ApacheDS154LdapServerAdapter.java?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v154/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v154/ApacheDS154LdapServerAdapter.java
(original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v154/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v154/ApacheDS154LdapServerAdapter.java
Wed Jan 12 15:23:46 2011
@@ -32,9 +32,9 @@ import org.apache.directory.studio.apach
 import org.apache.directory.studio.apacheds.configuration.model.v154.ServerConfigurationV154;
 import org.apache.directory.studio.apacheds.configuration.model.v154.ServerXmlIOV154;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
+import org.apache.directory.studio.common.ui.filesystem.PathEditorInput;
 import org.apache.directory.studio.ldapservers.LdapServersManager;
 import org.apache.directory.studio.ldapservers.LdapServersUtils;
-import org.apache.directory.studio.ldapservers.jobs.PathEditorInput;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
 import org.eclipse.core.runtime.IPath;

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v155/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v155/pom.xml?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v155/pom.xml (original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v155/pom.xml Wed Jan 12 15:23:46 2011
@@ -127,6 +127,7 @@
  org.eclipse.jdt.launching,
  org.eclipse.jface.text,
  org.eclipse.ui,
+ org.eclipse.ui.editors,
  org.eclipse.ui.ide</Require-Bundle>
             <Export-Package>org.apache.directory.studio.*</Export-Package>
             <Import-Package>!</Import-Package>

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v155/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v155/ApacheDS155LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v155/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v155/ApacheDS155LdapServerAdapter.java?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v155/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v155/ApacheDS155LdapServerAdapter.java
(original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v155/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v155/ApacheDS155LdapServerAdapter.java
Wed Jan 12 15:23:46 2011
@@ -32,9 +32,9 @@ import org.apache.directory.studio.apach
 import org.apache.directory.studio.apacheds.configuration.model.v155.ServerConfigurationV155;
 import org.apache.directory.studio.apacheds.configuration.model.v155.ServerXmlIOV155;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
+import org.apache.directory.studio.common.ui.filesystem.PathEditorInput;
 import org.apache.directory.studio.ldapservers.LdapServersManager;
 import org.apache.directory.studio.ldapservers.LdapServersUtils;
-import org.apache.directory.studio.ldapservers.jobs.PathEditorInput;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
 import org.eclipse.core.runtime.IPath;

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v156/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v156/pom.xml?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v156/pom.xml (original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v156/pom.xml Wed Jan 12 15:23:46 2011
@@ -127,6 +127,7 @@
  org.eclipse.jdt.launching,
  org.eclipse.jface.text,
  org.eclipse.ui,
+ org.eclipse.ui.editors,
  org.eclipse.ui.ide</Require-Bundle>
             <Export-Package>org.apache.directory.studio.*</Export-Package>
             <Import-Package>!</Import-Package>

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v156/ApacheDS156LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v156/ApacheDS156LdapServerAdapter.java?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v156/ApacheDS156LdapServerAdapter.java
(original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v156/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v156/ApacheDS156LdapServerAdapter.java
Wed Jan 12 15:23:46 2011
@@ -32,9 +32,9 @@ import org.apache.directory.studio.apach
 import org.apache.directory.studio.apacheds.configuration.model.v156.ServerConfigurationV156;
 import org.apache.directory.studio.apacheds.configuration.model.v156.ServerXmlIOV156;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
+import org.apache.directory.studio.common.ui.filesystem.PathEditorInput;
 import org.apache.directory.studio.ldapservers.LdapServersManager;
 import org.apache.directory.studio.ldapservers.LdapServersUtils;
-import org.apache.directory.studio.ldapservers.jobs.PathEditorInput;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
 import org.eclipse.core.runtime.IPath;

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v157/pom.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v157/pom.xml?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v157/pom.xml (original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v157/pom.xml Wed Jan 12 15:23:46 2011
@@ -127,6 +127,7 @@
  org.eclipse.jdt.launching,
  org.eclipse.jface.text,
  org.eclipse.ui,
+ org.eclipse.ui.editors,
  org.eclipse.ui.ide</Require-Bundle>
             <Export-Package>org.apache.directory.studio.*</Export-Package>
             <Import-Package>!</Import-Package>

Modified: directory/studio/trunk/plugins/ldapservers.apacheds.v157/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v157/ApacheDS157LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers.apacheds.v157/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v157/ApacheDS157LdapServerAdapter.java?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers.apacheds.v157/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v157/ApacheDS157LdapServerAdapter.java
(original)
+++ directory/studio/trunk/plugins/ldapservers.apacheds.v157/src/main/java/org/apache/directory/studio/ldapservers/apacheds/v157/ApacheDS157LdapServerAdapter.java
Wed Jan 12 15:23:46 2011
@@ -32,9 +32,9 @@ import org.apache.directory.studio.apach
 import org.apache.directory.studio.apacheds.configuration.model.v157.ServerConfigurationV157;
 import org.apache.directory.studio.apacheds.configuration.model.v157.ServerXmlIOV157;
 import org.apache.directory.studio.common.core.jobs.StudioProgressMonitor;
+import org.apache.directory.studio.common.ui.filesystem.PathEditorInput;
 import org.apache.directory.studio.ldapservers.LdapServersManager;
 import org.apache.directory.studio.ldapservers.LdapServersUtils;
-import org.apache.directory.studio.ldapservers.jobs.PathEditorInput;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
 import org.eclipse.core.runtime.IPath;

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/OpenConfigurationAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/OpenConfigurationAction.java?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/OpenConfigurationAction.java
(original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/OpenConfigurationAction.java
Wed Jan 12 15:23:46 2011
@@ -25,18 +25,12 @@ import org.apache.directory.studio.ldaps
 import org.apache.directory.studio.ldapservers.jobs.StudioLdapServerJob;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.views.ServersView;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Platform;
 import org.eclipse.jface.action.Action;
 import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.jface.viewers.ISelection;
 import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.ui.IPathEditorInput;
-import org.eclipse.ui.IPersistableElement;
 import org.eclipse.ui.IWorkbenchWindow;
 import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-import org.eclipse.ui.PlatformUI;
 
 
 /**
@@ -141,143 +135,4 @@ public class OpenConfigurationAction ext
     {
         // Nothing to do
     }
-
-    /**
-     * 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>
-     */
-    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;
-        }
-    }
 }

Modified: directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java?rev=1058183&r1=1058182&r2=1058183&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
(original)
+++ directory/studio/trunk/plugins/ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java
Wed Jan 12 15:23:46 2011
@@ -25,13 +25,13 @@ import java.io.File;
 import java.util.ResourceBundle;
 
 import org.apache.directory.studio.common.ui.CommonUIUtils;
+import org.apache.directory.studio.common.ui.filesystem.PathEditorInput;
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionFolder;
 import org.apache.directory.studio.connection.core.event.ConnectionEventRegistry;
 import org.apache.directory.studio.connection.core.event.ConnectionUpdateListener;
 import org.apache.directory.studio.connection.ui.ConnectionUIPlugin;
-import org.apache.directory.studio.ldapbrowser.common.BrowserCommonActivator;
 import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
 import org.apache.directory.studio.ldapbrowser.common.actions.ValueEditorPreferencesAction;
 import org.apache.directory.studio.ldapbrowser.common.widgets.WidgetModifyEvent;



Mime
View raw message