Browse files

CRLF shit

  • Loading branch information...
1 parent 450fc75 commit ceb912bf9aee080b7b62c200e55fd74c66c294e6 Pascal Rapicault committed with rgould Oct 7, 2010
Showing with 5,237 additions and 5,238 deletions.
  1. +15 −16 org.maven.ide.eclipse.io/META-INF/MANIFEST.MF
  2. +106 −106 org.maven.ide.eclipse.io/src/org/maven/ide/eclipse/io/S2IOFacade.java
  3. +69 −69 org.maven.ide.eclipse.io/src/org/maven/ide/eclipse/io/internal/S2IOPlugin.java
  4. +18 −18 org.maven.ide.eclipse.log/META-INF/MANIFEST.MF
  5. +25 −25 org.maven.ide.eclipse.log/src/org/maven/ide/eclipse/log/LogHelper.java
  6. +15 −15 org.maven.ide.eclipse.swtvalidation/.gitignore
  7. +9 −9 org.maven.ide.eclipse.swtvalidation/.settings/org.maven.ide.eclipse.prefs
  8. +30 −30 org.maven.ide.eclipse.swtvalidation/META-INF/MANIFEST.MF
  9. +18 −18 org.maven.ide.eclipse.swtvalidation/src/org/maven/ide/eclipse/swtvalidation/Messages.java
  10. +24 −24 org.maven.ide.eclipse.ui.common.editor/META-INF/MANIFEST.MF
  11. +5 −5 org.maven.ide.eclipse.ui.common.editor/build.properties
  12. +15 −15 org.maven.ide.eclipse.ui.common.editor/pom.xml
  13. +70 −70 ...pse.ui.common.editor/src/main/java/org/maven/ide/eclipse/ui/common/editor/internal/Activator.java
  14. +19 −19 org.maven.ide.eclipse.ui.common.test/META-INF/MANIFEST.MF
  15. +283 −283 ...ipse.ui.common.test/src/org/maven/ide/eclipse/ui/common/authentication/UrlInputCompositeTest.java
  16. +29 −29 org.maven.ide.eclipse.ui.common/.project
  17. +9 −9 org.maven.ide.eclipse.ui.common/.settings/org.maven.ide.eclipse.prefs
  18. +30 −30 org.maven.ide.eclipse.ui.common/META-INF/MANIFEST.MF
  19. +6 −6 org.maven.ide.eclipse.ui.common/build.properties
  20. +15 −15 org.maven.ide.eclipse.ui.common/pom.xml
  21. +70 −70 org.maven.ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/Activator.java
  22. +88 −88 ...maven.ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/ErrorHandlingUtils.java
  23. +21 −21 org.maven.ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/FormUtils.java
  24. +31 −31 org.maven.ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/Images.java
  25. +212 −212 org.maven.ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/Messages.java
  26. +6 −6 ....ui.common/src/main/java/org/maven/ide/eclipse/ui/common/authentication/IRealmChangeListener.java
  27. +378 −378 ...clipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/authentication/RealmComposite.java
  28. +614 −614 ...common/src/main/java/org/maven/ide/eclipse/ui/common/authentication/RealmManagementComposite.java
  29. +89 −89 ...ui.common/src/main/java/org/maven/ide/eclipse/ui/common/authentication/RealmManagementDialog.java
  30. +455 −455 ...e.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/authentication/RealmManagementPage.java
  31. +52 −52 ...pse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/authentication/RealmUrlCollector.java
  32. +237 −237 ...eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/composites/DropDownComposite.java
  33. +187 −187 ....ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/composites/GAVComposite.java
  34. +185 −185 ...lipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/composites/ValidatingComposite.java
  35. +422 −422 ...e.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/dialogs/RemoteResourceLookupDialog.java
  36. +111 −111 org.maven.ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/messages.properties
  37. +174 −174 ...clipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/validation/SonatypeValidators.java
  38. +353 −353 ...pse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/wizards/RemoteArtifactLookupPage.java
  39. +398 −398 ...pse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/wizards/RemoteResourceLookupPage.java
  40. +10 −10 org.maven.ide.eclipse.ui.tests.common/META-INF/MANIFEST.MF
  41. +4 −4 org.maven.ide.eclipse.ui.tests.common/build.properties
  42. +15 −15 org.maven.ide.eclipse.ui.tests.common/pom.xml
  43. +161 −161 ...e.ui.tests.common/src/main/java/org/maven/ide/eclipse/ui/tests/common/AbstractWizardPageTest.java
  44. +42 −42 pom.xml
  45. +15 −15 simplevalidation-swt/.gitignore
  46. +97 −97 simplevalidation-swt/src/main/java/org/openide/util/Lookup.java
View
31 org.maven.ide.eclipse.io/META-INF/MANIFEST.MF
@@ -1,16 +1,15 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: com.sonatype.s2.io
-Bundle-SymbolicName: org.maven.ide.eclipse.io;singleton:=true
-Bundle-Version: 1.1.5.qualifier
-Bundle-Vendor: Sonatype, Inc.
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.core.net, com.ning.async-http-client,
- org.maven.ide.eclipse.authentication
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,
- JavaSE-1.6
-Bundle-ActivationPolicy: lazy
-Import-Package: org.slf4j;version="[1.5,1.6)"
-Export-Package: org.maven.ide.eclipse.io
-Bundle-Activator: org.maven.ide.eclipse.io.internal.S2IOPlugin
-
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: com.sonatype.s2.io
+Bundle-SymbolicName: org.maven.ide.eclipse.io;singleton:=true
+Bundle-Version: 1.1.5.qualifier
+Bundle-Vendor: Sonatype, Inc.
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.net, com.ning.async-http-client,
+ org.maven.ide.eclipse.authentication
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+Bundle-ActivationPolicy: lazy
+Import-Package: org.slf4j;version="[1.5,1.6)"
+Export-Package: org.maven.ide.eclipse.io
+Bundle-Activator: org.maven.ide.eclipse.io.internal.S2IOPlugin
View
212 org.maven.ide.eclipse.io/src/org/maven/ide/eclipse/io/S2IOFacade.java
@@ -1,106 +1,106 @@
-package org.maven.ide.eclipse.io;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.eclipse.core.net.proxy.IProxyService;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.maven.ide.eclipse.authentication.AuthFacade;
-import org.maven.ide.eclipse.io.internal.S2IOPlugin;
-
-
-public class S2IOFacade
-{
- public static IProxyService getProxyService()
- {
- return S2IOPlugin.getDefault().getProxyService();
- }
-
- public static InputStream openStream( String uri, IProgressMonitor monitor )
- throws IOException, URISyntaxException
- {
- return new UrlFetcher().openStream( new URI( uri ), monitor, AuthFacade.getAuthService(),
- S2IOFacade.getProxyService() );
- }
-
- public static ServerResponse put( RequestEntity file, String uri, IProgressMonitor monitor )
- throws IOException, URISyntaxException
- {
- return put( file, uri, null /* default timeout */, monitor );
- }
-
- public static ServerResponse put( RequestEntity file, String uri, final Integer timeoutInMilliseconds,
- IProgressMonitor monitor, String monitorTaskName )
- throws IOException, URISyntaxException
- {
- UrlPublisher publisher = new UrlPublisher();
- publisher.setName( monitorTaskName );
- return publisher.putFile( file, new URI( uri ), monitor, AuthFacade.getAuthService(),
- S2IOFacade.getProxyService(), timeoutInMilliseconds );
- }
-
- public static ServerResponse put( RequestEntity file, String uri, final Integer timeoutInMilliseconds,
- IProgressMonitor monitor )
- throws IOException, URISyntaxException
- {
- return put( file, uri, timeoutInMilliseconds, monitor, null /* monitorTaskName */);
- }
-
- public static ServerResponse putFile( File file, String uri, IProgressMonitor monitor )
- throws IOException, URISyntaxException
- {
- return put( new FileRequestEntity( file ), uri, monitor );
- }
-
- public static ServerResponse delete( String uri, final Integer timeoutInMilliseconds, IProgressMonitor monitor,
- String monitorTaskName )
- throws IOException, URISyntaxException
- {
- UrlPublisher publisher = new UrlPublisher();
- publisher.setName( monitorTaskName );
- return publisher.delete( new URI( uri ), monitor, AuthFacade.getAuthService(), S2IOFacade.getProxyService(),
- timeoutInMilliseconds );
- }
-
- public static ServerResponse post( RequestEntity file, String uri, final Integer timeoutInMilliseconds,
- IProgressMonitor monitor, String monitorTaskName )
- throws IOException, URISyntaxException
- {
- UrlPublisher publisher = new UrlPublisher();
- publisher.setName( monitorTaskName );
- return publisher.postFile( file, new URI( uri ), monitor, AuthFacade.getAuthService(),
- S2IOFacade.getProxyService(), timeoutInMilliseconds );
- }
-
- public static ServerResponse head( String uri, final Integer timeoutInMilliseconds, IProgressMonitor monitor )
- throws IOException, URISyntaxException
- {
- UrlPublisher publisher = new UrlPublisher();
- return publisher.headFile( new URI( uri ), monitor, AuthFacade.getAuthService(),
- S2IOFacade.getProxyService(), timeoutInMilliseconds );
- }
-
- public static boolean exists( String uri, IProgressMonitor monitor )
- throws IOException, URISyntaxException
- {
- ServerResponse resp = head( uri, null, monitor );
- if ( resp.getStatusCode() == HttpURLConnection.HTTP_OK )
- {
- return true;
- }
- else if ( resp.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND )
- {
- return false;
- }
- else
- {
- int status = resp.getStatusCode();
- throw new TransferException( "HTTP status code " + status + /* ": " + HttpStatus.getMessage( status ) + */ ": "
- + uri, resp, null );
- }
- }
-}
+package org.maven.ide.eclipse.io;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.eclipse.core.net.proxy.IProxyService;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.maven.ide.eclipse.authentication.AuthFacade;
+import org.maven.ide.eclipse.io.internal.S2IOPlugin;
+
+
+public class S2IOFacade
+{
+ public static IProxyService getProxyService()
+ {
+ return S2IOPlugin.getDefault().getProxyService();
+ }
+
+ public static InputStream openStream( String uri, IProgressMonitor monitor )
+ throws IOException, URISyntaxException
+ {
+ return new UrlFetcher().openStream( new URI( uri ), monitor, AuthFacade.getAuthService(),
+ S2IOFacade.getProxyService() );
+ }
+
+ public static ServerResponse put( RequestEntity file, String uri, IProgressMonitor monitor )
+ throws IOException, URISyntaxException
+ {
+ return put( file, uri, null /* default timeout */, monitor );
+ }
+
+ public static ServerResponse put( RequestEntity file, String uri, final Integer timeoutInMilliseconds,
+ IProgressMonitor monitor, String monitorTaskName )
+ throws IOException, URISyntaxException
+ {
+ UrlPublisher publisher = new UrlPublisher();
+ publisher.setName( monitorTaskName );
+ return publisher.putFile( file, new URI( uri ), monitor, AuthFacade.getAuthService(),
+ S2IOFacade.getProxyService(), timeoutInMilliseconds );
+ }
+
+ public static ServerResponse put( RequestEntity file, String uri, final Integer timeoutInMilliseconds,
+ IProgressMonitor monitor )
+ throws IOException, URISyntaxException
+ {
+ return put( file, uri, timeoutInMilliseconds, monitor, null /* monitorTaskName */);
+ }
+
+ public static ServerResponse putFile( File file, String uri, IProgressMonitor monitor )
+ throws IOException, URISyntaxException
+ {
+ return put( new FileRequestEntity( file ), uri, monitor );
+ }
+
+ public static ServerResponse delete( String uri, final Integer timeoutInMilliseconds, IProgressMonitor monitor,
+ String monitorTaskName )
+ throws IOException, URISyntaxException
+ {
+ UrlPublisher publisher = new UrlPublisher();
+ publisher.setName( monitorTaskName );
+ return publisher.delete( new URI( uri ), monitor, AuthFacade.getAuthService(), S2IOFacade.getProxyService(),
+ timeoutInMilliseconds );
+ }
+
+ public static ServerResponse post( RequestEntity file, String uri, final Integer timeoutInMilliseconds,
+ IProgressMonitor monitor, String monitorTaskName )
+ throws IOException, URISyntaxException
+ {
+ UrlPublisher publisher = new UrlPublisher();
+ publisher.setName( monitorTaskName );
+ return publisher.postFile( file, new URI( uri ), monitor, AuthFacade.getAuthService(),
+ S2IOFacade.getProxyService(), timeoutInMilliseconds );
+ }
+
+ public static ServerResponse head( String uri, final Integer timeoutInMilliseconds, IProgressMonitor monitor )
+ throws IOException, URISyntaxException
+ {
+ UrlPublisher publisher = new UrlPublisher();
+ return publisher.headFile( new URI( uri ), monitor, AuthFacade.getAuthService(),
+ S2IOFacade.getProxyService(), timeoutInMilliseconds );
+ }
+
+ public static boolean exists( String uri, IProgressMonitor monitor )
+ throws IOException, URISyntaxException
+ {
+ ServerResponse resp = head( uri, null, monitor );
+ if ( resp.getStatusCode() == HttpURLConnection.HTTP_OK )
+ {
+ return true;
+ }
+ else if ( resp.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND )
+ {
+ return false;
+ }
+ else
+ {
+ int status = resp.getStatusCode();
+ throw new TransferException( "HTTP status code " + status + /* ": " + HttpStatus.getMessage( status ) + */ ": "
+ + uri, resp, null );
+ }
+ }
+}
View
138 org.maven.ide.eclipse.io/src/org/maven/ide/eclipse/io/internal/S2IOPlugin.java
@@ -1,69 +1,69 @@
-package org.maven.ide.eclipse.io.internal;
-
-
-import org.eclipse.core.net.proxy.IProxyService;
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-import org.osgi.util.tracker.ServiceTracker;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class S2IOPlugin
- extends Plugin
-{
- // The plug-in ID
- public static final String PLUGIN_ID = "com.sonatype.s2.io";
-
- private static S2IOPlugin plugin;
-
- private Logger log = LoggerFactory.getLogger( S2IOPlugin.class );
-
- private ServiceTracker proxyServiceTracker;
-
- @Override
- public void start( BundleContext context )
- throws Exception
- {
- log.debug( "Starting the S2IOPlugin..." );
- super.start( context );
- plugin = this;
-
- proxyServiceTracker = new ServiceTracker( context, IProxyService.class.getName(), null );
- proxyServiceTracker.open();
- }
-
- @Override
- public void stop( BundleContext context )
- throws Exception
- {
- log.debug( "Stoping the S2IOPlugin..." );
- try
- {
- proxyServiceTracker.close();
- proxyServiceTracker = null;
- }
- finally
- {
- plugin = null;
- super.stop( context );
- }
- }
-
- /**
- * Gets the proxy service if available.
- *
- * @return The proxy service or {@code null} if not available.
- */
- public IProxyService getProxyService()
- {
- return (IProxyService) proxyServiceTracker.getService();
- }
-
- public static S2IOPlugin getDefault()
- {
- return plugin;
- }
-}
+package org.maven.ide.eclipse.io.internal;
+
+
+import org.eclipse.core.net.proxy.IProxyService;
+import org.eclipse.core.runtime.Plugin;
+import org.osgi.framework.BundleContext;
+import org.osgi.util.tracker.ServiceTracker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class S2IOPlugin
+ extends Plugin
+{
+ // The plug-in ID
+ public static final String PLUGIN_ID = "com.sonatype.s2.io";
+
+ private static S2IOPlugin plugin;
+
+ private Logger log = LoggerFactory.getLogger( S2IOPlugin.class );
+
+ private ServiceTracker proxyServiceTracker;
+
+ @Override
+ public void start( BundleContext context )
+ throws Exception
+ {
+ log.debug( "Starting the S2IOPlugin..." );
+ super.start( context );
+ plugin = this;
+
+ proxyServiceTracker = new ServiceTracker( context, IProxyService.class.getName(), null );
+ proxyServiceTracker.open();
+ }
+
+ @Override
+ public void stop( BundleContext context )
+ throws Exception
+ {
+ log.debug( "Stoping the S2IOPlugin..." );
+ try
+ {
+ proxyServiceTracker.close();
+ proxyServiceTracker = null;
+ }
+ finally
+ {
+ plugin = null;
+ super.stop( context );
+ }
+ }
+
+ /**
+ * Gets the proxy service if available.
+ *
+ * @return The proxy service or {@code null} if not available.
+ */
+ public IProxyService getProxyService()
+ {
+ return (IProxyService) proxyServiceTracker.getService();
+ }
+
+ public static S2IOPlugin getDefault()
+ {
+ return plugin;
+ }
+}
View
36 org.maven.ide.eclipse.log/META-INF/MANIFEST.MF
@@ -1,18 +1,18 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Log
-Bundle-SymbolicName: org.maven.ide.eclipse.log;singleton:=true
-Bundle-Version: 1.1.5.qualifier
-Bundle-Vendor: Sonatype, Inc.
-Bundle-Activator: org.maven.ide.eclipse.log.internal.LogPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6
-Bundle-ClassPath: .,
- jars/slf4j-api-1.5.10.jar,
- jars/logback-core-0.9.18.jar,
- jars/logback-classic-0.9.18.jar
-Require-Bundle: org.eclipse.core.runtime,
- org.maven.ide.eclipse.pr;resolution:=optional
-Export-Package: org.maven.ide.eclipse.log,
- org.maven.ide.eclipse.log.internal;x-internal:=true,
- org.slf4j;provider=m2eclipse;version="1.5.10"
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Log
+Bundle-SymbolicName: org.maven.ide.eclipse.log;singleton:=true
+Bundle-Version: 1.1.5.qualifier
+Bundle-Vendor: Sonatype, Inc.
+Bundle-Activator: org.maven.ide.eclipse.log.internal.LogPlugin
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6
+Bundle-ClassPath: .,
+ jars/slf4j-api-1.5.10.jar,
+ jars/logback-core-0.9.18.jar,
+ jars/logback-classic-0.9.18.jar
+Require-Bundle: org.eclipse.core.runtime,
+ org.maven.ide.eclipse.pr;resolution:=optional
+Export-Package: org.maven.ide.eclipse.log,
+ org.maven.ide.eclipse.log.internal;x-internal:=true,
+ org.slf4j;provider=m2eclipse;version="1.5.10"
View
50 org.maven.ide.eclipse.log/src/org/maven/ide/eclipse/log/LogHelper.java
@@ -1,25 +1,25 @@
-package org.maven.ide.eclipse.log;
-
-import java.util.Properties;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.slf4j.Logger;
-
-public class LogHelper
-{
- public static void logJavaProperties( Logger log )
- {
- Properties javaProperties = System.getProperties();
- SortedMap<String, String> sortedProperties = new TreeMap<String, String>();
- for ( Object key : javaProperties.keySet() )
- {
- sortedProperties.put( (String) key, (String) javaProperties.get( key ) );
- }
- log.info( "Java properties:" );
- for ( String key : sortedProperties.keySet() )
- {
- log.info( " {}={}", key, sortedProperties.get( key ) );
- }
- }
-}
+package org.maven.ide.eclipse.log;
+
+import java.util.Properties;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+import org.slf4j.Logger;
+
+public class LogHelper
+{
+ public static void logJavaProperties( Logger log )
+ {
+ Properties javaProperties = System.getProperties();
+ SortedMap<String, String> sortedProperties = new TreeMap<String, String>();
+ for ( Object key : javaProperties.keySet() )
+ {
+ sortedProperties.put( (String) key, (String) javaProperties.get( key ) );
+ }
+ log.info( "Java properties:" );
+ for ( String key : sortedProperties.keySet() )
+ {
+ log.info( " {}={}", key, sortedProperties.get( key ) );
+ }
+ }
+}
View
30 org.maven.ide.eclipse.swtvalidation/.gitignore
@@ -1,15 +1,15 @@
-# Build output
-target
-
-# Local Eclipse junk, in case anyone's using eclipse
-.classpath
-.manager
-.project
-.settings
-
-# Local IntelliJ junk ...
-.idea
-*.iml
-
-# Mac stuff
-.DS_Store
+# Build output
+target
+
+# Local Eclipse junk, in case anyone's using eclipse
+.classpath
+.manager
+.project
+.settings
+
+# Local IntelliJ junk ...
+.idea
+*.iml
+
+# Mac stuff
+.DS_Store
View
18 org.maven.ide.eclipse.swtvalidation/.settings/org.maven.ide.eclipse.prefs
@@ -1,9 +1,9 @@
-#Wed May 26 13:46:38 EDT 2010
-activeProfiles=
-eclipse.preferences.version=1
-fullBuildGoals=process-test-resources
-includeModules=false
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-skipCompilerPlugin=true
-version=1
+#Wed May 26 13:46:38 EDT 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
View
60 org.maven.ide.eclipse.swtvalidation/META-INF/MANIFEST.MF
@@ -1,30 +1,30 @@
-Manifest-Version: 1.0
-Export-Package: org.maven.ide.eclipse.swtvalidation,
- org.netbeans.validation.api,
- org.netbeans.validation.api.builtin.indexvalidation,
- org.netbeans.validation.api.builtin.stringvalidation,
- org.netbeans.validation.api.conversion,
- org.netbeans.validation.api.ui,
- org.netbeans.validation.api.ui.swing,
- org.netbeans.validation.spi.accessibility,
- org.openide.util
-Bundle-ClassPath: jars/simplevalidation-swt-1.0-SNAPSHOT-all.jar,
- .
-MavenArtifact-BaseVersion: 1.0.0-SNAPSHOT
-Bundle-Version: 1.1.5.qualifier
-MavenArtifact-ArtifactId: org.maven.ide.eclipse.swtvalidation
-MavenArtifact-GroupId: org.maven.ide.eclipse.commons
-Bundle-Name: SWT Simple Validation Framework
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.maven.ide.eclipse.swtvalidation;singleton:=tr
- ue
-Bundle-Activator: org.maven.ide.eclipse.swtvalidation.Activator
-Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6
-Require-Bundle: org.eclipse.swt,
- org.eclipse.jface,
- org.eclipse.core.runtime,
- org.eclipse.ui.forms,
- org.eclipse.ui
-Bundle-ActivationPolicy: lazy
-Bundle-Vendor: Sonatype, Inc.
-
+Manifest-Version: 1.0
+Export-Package: org.maven.ide.eclipse.swtvalidation,
+ org.netbeans.validation.api,
+ org.netbeans.validation.api.builtin.indexvalidation,
+ org.netbeans.validation.api.builtin.stringvalidation,
+ org.netbeans.validation.api.conversion,
+ org.netbeans.validation.api.ui,
+ org.netbeans.validation.api.ui.swing,
+ org.netbeans.validation.spi.accessibility,
+ org.openide.util
+Bundle-ClassPath: jars/simplevalidation-swt-1.0-SNAPSHOT-all.jar,
+ .
+MavenArtifact-BaseVersion: 1.0.0-SNAPSHOT
+Bundle-Version: 1.1.5.qualifier
+MavenArtifact-ArtifactId: org.maven.ide.eclipse.swtvalidation
+MavenArtifact-GroupId: org.maven.ide.eclipse.commons
+Bundle-Name: SWT Simple Validation Framework
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.maven.ide.eclipse.swtvalidation;singleton:=tr
+ ue
+Bundle-Activator: org.maven.ide.eclipse.swtvalidation.Activator
+Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6
+Require-Bundle: org.eclipse.swt,
+ org.eclipse.jface,
+ org.eclipse.core.runtime,
+ org.eclipse.ui.forms,
+ org.eclipse.ui
+Bundle-ActivationPolicy: lazy
+Bundle-Vendor: Sonatype, Inc.
+
View
36 org.maven.ide.eclipse.swtvalidation/src/org/maven/ide/eclipse/swtvalidation/Messages.java
@@ -1,18 +1,18 @@
-package org.maven.ide.eclipse.swtvalidation;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages
- extends NLS
-{
- private static final String BUNDLE = Messages.class.getName().toLowerCase();
-
- static
- {
- NLS.initializeMessages( BUNDLE, Messages.class );
- }
-
- public static String ERR_Coordinate_Invalid;
-
-
-}
+package org.maven.ide.eclipse.swtvalidation;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages
+ extends NLS
+{
+ private static final String BUNDLE = Messages.class.getName().toLowerCase();
+
+ static
+ {
+ NLS.initializeMessages( BUNDLE, Messages.class );
+ }
+
+ public static String ERR_Coordinate_Invalid;
+
+
+}
View
48 org.maven.ide.eclipse.ui.common.editor/META-INF/MANIFEST.MF
@@ -1,24 +1,24 @@
-Manifest-Version: 1.0
-MavenArtifact-BaseVersion: 1.0.0-SNAPSHOT
-Bundle-Version: 1.1.5.qualifier
-MavenArtifact-ArtifactId: org.maven.ide.eclipse.ui.common
-MavenArtifact-GroupId: org.maven.ide.eclipse.commons
-Bundle-Name: Maven Eclipse UI Editor Commons
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.maven.ide.eclipse.ui.common.editor;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6
-Import-Package: org.slf4j;version="[1.5,1.6)"
-Require-Bundle: org.eclipse.osgi,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.ui,
- org.eclipse.ui.editors,
- org.eclipse.ui.forms,
- org.eclipse.ui.ide,
- org.eclipse.ui.workbench,
- org.maven.ide.eclipse.swtvalidation
-Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.maven.ide.eclipse.ui.common.editor.internal.Activator
-Bundle-Vendor: Sonatype, Inc.
-Export-Package: org.maven.ide.eclipse.ui.common.editor
-
+Manifest-Version: 1.0
+MavenArtifact-BaseVersion: 1.0.0-SNAPSHOT
+Bundle-Version: 1.1.5.qualifier
+MavenArtifact-ArtifactId: org.maven.ide.eclipse.ui.common
+MavenArtifact-GroupId: org.maven.ide.eclipse.commons
+Bundle-Name: Maven Eclipse UI Editor Commons
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.maven.ide.eclipse.ui.common.editor;singleton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6
+Import-Package: org.slf4j;version="[1.5,1.6)"
+Require-Bundle: org.eclipse.osgi,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.ui,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.forms,
+ org.eclipse.ui.ide,
+ org.eclipse.ui.workbench,
+ org.maven.ide.eclipse.swtvalidation
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.maven.ide.eclipse.ui.common.editor.internal.Activator
+Bundle-Vendor: Sonatype, Inc.
+Export-Package: org.maven.ide.eclipse.ui.common.editor
+
View
10 org.maven.ide.eclipse.ui.common.editor/build.properties
@@ -1,5 +1,5 @@
-source.. = src/main/java/
-output.. = target/classes/
-bin.includes = META-INF/,\
- .,\
- icons/
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ icons/
View
30 org.maven.ide.eclipse.ui.common.editor/pom.xml
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.maven.ide.eclipse.commons</groupId>
- <artifactId>eclipse-commons-parent</artifactId>
- <version>1.1.5-SNAPSHOT</version>
- <relativePath>../eclipse-commons-parent</relativePath>
- </parent>
-
- <artifactId>org.maven.ide.eclipse.ui.common.editor</artifactId>
- <packaging>eclipse-plugin</packaging>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.maven.ide.eclipse.commons</groupId>
+ <artifactId>eclipse-commons-parent</artifactId>
+ <version>1.1.5-SNAPSHOT</version>
+ <relativePath>../eclipse-commons-parent</relativePath>
+ </parent>
+
+ <artifactId>org.maven.ide.eclipse.ui.common.editor</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
View
140 ...ommon.editor/src/main/java/org/maven/ide/eclipse/ui/common/editor/internal/Activator.java
@@ -1,70 +1,70 @@
-package org.maven.ide.eclipse.ui.common.editor.internal;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-public class Activator
- extends AbstractUIPlugin
-{
- public static final String PLUGIN_ID = "org.maven.ide.eclipse.ui.common.editor";
-
- public static final String IMAGE_PATH = "icons/";
-
- private static Activator plugin;
-
- public void start( BundleContext context )
- throws Exception
- {
- super.start( context );
- plugin = this;
- }
-
- public void stop( BundleContext context )
- throws Exception
- {
- plugin = null;
- super.stop( context );
- }
-
- public static Activator getDefault()
- {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public ImageDescriptor getImageDescriptor( String path )
- {
- ImageRegistry imageRegistry = getImageRegistry();
- if ( imageRegistry != null )
- {
- ImageDescriptor imageDescriptor = imageRegistry.getDescriptor( path );
- if ( imageDescriptor == null )
- {
- imageDescriptor = imageDescriptorFromPlugin( PLUGIN_ID, IMAGE_PATH + path );
- imageRegistry.put( path, imageDescriptor );
- }
- return imageDescriptor;
- }
-
- return null;
- }
-
- public Image getImage( String path )
- {
- ImageRegistry imageRegistry = getImageRegistry();
- if ( imageRegistry != null )
- {
- getImageDescriptor( path );
- return imageRegistry.get( path );
- }
- return null;
- }
-}
+package org.maven.ide.eclipse.ui.common.editor.internal;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+public class Activator
+ extends AbstractUIPlugin
+{
+ public static final String PLUGIN_ID = "org.maven.ide.eclipse.ui.common.editor";
+
+ public static final String IMAGE_PATH = "icons/";
+
+ private static Activator plugin;
+
+ public void start( BundleContext context )
+ throws Exception
+ {
+ super.start( context );
+ plugin = this;
+ }
+
+ public void stop( BundleContext context )
+ throws Exception
+ {
+ plugin = null;
+ super.stop( context );
+ }
+
+ public static Activator getDefault()
+ {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public ImageDescriptor getImageDescriptor( String path )
+ {
+ ImageRegistry imageRegistry = getImageRegistry();
+ if ( imageRegistry != null )
+ {
+ ImageDescriptor imageDescriptor = imageRegistry.getDescriptor( path );
+ if ( imageDescriptor == null )
+ {
+ imageDescriptor = imageDescriptorFromPlugin( PLUGIN_ID, IMAGE_PATH + path );
+ imageRegistry.put( path, imageDescriptor );
+ }
+ return imageDescriptor;
+ }
+
+ return null;
+ }
+
+ public Image getImage( String path )
+ {
+ ImageRegistry imageRegistry = getImageRegistry();
+ if ( imageRegistry != null )
+ {
+ getImageDescriptor( path );
+ return imageRegistry.get( path );
+ }
+ return null;
+ }
+}
View
38 org.maven.ide.eclipse.ui.common.test/META-INF/MANIFEST.MF
@@ -1,19 +1,19 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: org.maven.ide.eclipse.ui.common.test
-Bundle-SymbolicName: org.maven.ide.eclipse.ui.common.test;singleton:=true
-Bundle-Version: 1.1.5.qualifier
-Bundle-Vendor: Sonatype, Inc.
-Bundle-RequiredExecutionEnvironment: J2SE-1.5,
- JavaSE-1.6
-Require-Bundle: org.junit4,
- org.eclipse.core.runtime,
- org.eclipse.ui,
- org.eclipse.ui.forms,
- org.maven.ide.eclipse.authentication,
- org.maven.ide.eclipse.ui.common,
- org.maven.ide.eclipse.io,
- org.maven.ide.eclipse.swtvalidation,
- org.maven.ide.eclipse.ui.tests.common
-Export-Package: org.maven.ide.eclipse.ui.common.test
-
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: org.maven.ide.eclipse.ui.common.test
+Bundle-SymbolicName: org.maven.ide.eclipse.ui.common.test;singleton:=true
+Bundle-Version: 1.1.5.qualifier
+Bundle-Vendor: Sonatype, Inc.
+Bundle-RequiredExecutionEnvironment: J2SE-1.5,
+ JavaSE-1.6
+Require-Bundle: org.junit4,
+ org.eclipse.core.runtime,
+ org.eclipse.ui,
+ org.eclipse.ui.forms,
+ org.maven.ide.eclipse.authentication,
+ org.maven.ide.eclipse.ui.common,
+ org.maven.ide.eclipse.io,
+ org.maven.ide.eclipse.swtvalidation,
+ org.maven.ide.eclipse.ui.tests.common
+Export-Package: org.maven.ide.eclipse.ui.common.test
+
View
566 ...common.test/src/org/maven/ide/eclipse/ui/common/authentication/UrlInputCompositeTest.java
@@ -1,283 +1,283 @@
-package org.maven.ide.eclipse.ui.common.authentication;
-
-import java.io.File;
-
-import junit.framework.Assert;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.maven.ide.eclipse.authentication.AnonymousAccessType;
-import org.maven.ide.eclipse.authentication.AuthFacade;
-import org.maven.ide.eclipse.authentication.IAuthData;
-import org.maven.ide.eclipse.authentication.internal.AuthData;
-import org.maven.ide.eclipse.swtvalidation.SwtValidationGroup;
-import org.maven.ide.eclipse.swtvalidation.SwtValidationUI;
-import org.maven.ide.eclipse.ui.common.layout.WidthGroup;
-import org.maven.ide.eclipse.ui.tests.common.AbstractWizardPageTest;
-
-public class UrlInputCompositeTest
- extends AbstractWizardPageTest
-{
- private WizardDialog dialog;
-
- private Display display;
-
- public void testNullUrlDisallowCertificate()
- {
- int style = UrlInputComposite.ALLOW_ANONYMOUS;
- DummyPage page = createTestPage( null /* url */, style );
- assertIt( page, "", new AuthData( "", "", AnonymousAccessType.ALLOWED ), style, "URL may not be empty" );
- }
-
- public void testNullUrlAllowCertificate()
- {
- int style = UrlInputComposite.CERTIFICATE_CONTROLS | UrlInputComposite.ALLOW_ANONYMOUS;
- DummyPage page = createTestPage( null /* url */, style );
- assertIt( page, "", new AuthData( "", "", null, null, AnonymousAccessType.ALLOWED ), style,
- "Certificate filename may not be empty" );
- }
-
- public void testUrlWithUsernamePassword()
- {
- String url = "http://UrlInputCompositeTest/testUrlWithUsernamePassword";
- IAuthData authData =
- new AuthData( "username testUrlWithUsernamePassword", "password testUrlWithUsernamePassword",
- AnonymousAccessType.ALLOWED );
- AuthFacade.getAuthService().save( url, authData );
- int style = 0;
- DummyPage page = createTestPage( url, style );
- assertIt( page, url, authData, style );
- }
-
- public void testUrlWithUsernamePasswordAnonymousNotAllowed()
- {
- String url =
- "http://UrlInputCompositeTest/testUrlWithUsernamePasswordAnonymousNotAllowed_" + System.currentTimeMillis();
- IAuthData authData = new AuthData( "", "", AnonymousAccessType.NOT_ALLOWED );
- // AuthFacade.getAuthService().save( url, authData );
- int style = 0;
- DummyPage page = createTestPage( url, style );
- assertIt( page, url, authData, style, "Username may not be empty" );
- authData =
- new AuthData( "username testUrlWithUsernamePasswordAnonymousNotAllowed",
- "password testUrlWithUsernamePasswordAnonymousNotAllowed", AnonymousAccessType.NOT_ALLOWED );
- AuthFacade.getAuthService().save( url, authData );
- page = createTestPage( url, style );
- assertIt( page, url, authData, style );
- }
-
- public void testUrlWithUsernamePasswordAnonymousRequired()
- {
- String url = "http://UrlInputCompositeTest/testUrlWithUsernamePasswordAnonymousRequired";
- IAuthData authData = new AuthData( "", "", AnonymousAccessType.REQUIRED );
- AuthFacade.getAuthService().save( url, authData );
- int style = 0;
- DummyPage page = createTestPage( url, style );
- assertIt( page, url, authData, style );
- }
-
- public void testUrlReadOnlyWithUsernamePassword()
- {
- String url = "http://UrlInputCompositeTest/testUrlReadOnlyWithUsernamePassword";
- IAuthData authData =
- new AuthData( "username testUrlReadOnlyWithUsernamePassword",
- "password testUrlReadOnlyWithUsernamePassword", AnonymousAccessType.ALLOWED );
- AuthFacade.getAuthService().save( url, authData );
- int style = UrlInputComposite.READ_ONLY_URL;
- DummyPage page = createTestPage( url, style );
- assertIt( page, url, authData, style );
- }
-
- public void testUrlWithCertificate()
- {
- String url = "http://UrlInputCompositeTest/testUrlWithCertificate";
- IAuthData authData = new AuthData( new File( "testUrlWithCertificate" ), "passphrase testUrlWithCertificate" );
- AuthFacade.getAuthService().save( url, authData );
- int style = 0;
- DummyPage page = createTestPage( url, style );
- assertIt( page, url, authData, style );
- }
-
- public void testUrlWithCertificateNoSavedCertificate()
- {
- String url =
- "http://UrlInputCompositeTest/testUrlWithCertificateNoSavedCertificate" + System.currentTimeMillis();
- int style = UrlInputComposite.CERTIFICATE_CONTROLS | UrlInputComposite.ALLOW_ANONYMOUS;
- DummyPage page = createTestPage( url, style );
- setText( page, UrlInputComposite.CERTIFICATE_TEXT_NAME,
- new File( "testUrlWithCertificateNoSavedCertificate" ).getAbsolutePath() );
- setText( page, UrlInputComposite.PASSPHRASE_TEXT_NAME, "passphrase testUrlWithCertificateNoSavedCertificate" );
- IAuthData authData =
- new AuthData( "", "", new File( "testUrlWithCertificateNoSavedCertificate" ),
- "passphrase testUrlWithCertificateNoSavedCertificate", AnonymousAccessType.ALLOWED );
- assertIt( page, url, authData, style );
- }
-
- public void testUrlWithUsernamePasswordAndCertificate()
- {
- String url = "http://UrlInputCompositeTest/testUrlWithUsernamePasswordAndCertificate";
- IAuthData authData =
- new AuthData( "username testUrlWithUsernamePasswordAndCertificate",
- "password testUrlWithUsernamePasswordAndCertificate",
- new File( "testUrlWithUsernamePasswordAndCertificate" ),
- "passphrase testUrlWithUsernamePasswordAndCertificate", AnonymousAccessType.ALLOWED );
- AuthFacade.getAuthService().save( url, authData );
- int style = 0;
- DummyPage page = createTestPage( url, style );
- assertIt( page, url, authData, style );
- }
-
- public void testInvalidUrl()
- {
- String url = "http://UrlInputCompositeTest/testInvalidUrl\\";
- int style = UrlInputComposite.ALLOW_ANONYMOUS;
- DummyPage page = createTestPage( url, style );
- assertIt( page, url, new AuthData( "", "", AnonymousAccessType.ALLOWED ), style, "'" + url
- + "' is not a valid URL: Illegal character in path at index 43: http://UrlInputCompositeTest/testInvalidUrl\\" );
- }
-
- public void testGitSshUrl()
- {
- String url = "scm:git:ssh://testGitSshUrl/foo";
- int style = UrlInputComposite.ALLOW_ANONYMOUS;
- DummyPage page = createTestPage( url, style );
- assertIt( page, url, new AuthData( "", "", AnonymousAccessType.ALLOWED ), style );
- }
-
- private void assertIt( DummyPage page, String expectedUrl, IAuthData authData, int style )
- {
- assertIt( page, expectedUrl, authData, style, null /* errorMessage */);
- }
-
- private void assertIt( DummyPage page, String expectedUrl, IAuthData authData, int style, String errorMessage )
- {
- // Verify url control
- Assert.assertEquals( "Incorrect expected URL", expectedUrl, page.urlInputComposite.getUrl() );
- if ( ( style & UrlInputComposite.READ_ONLY_URL ) != 0 )
- {
- assertText( page, UrlInputComposite.URL_CONTROL_NAME, expectedUrl, false /* isEnabled */, true /* isVisible */);
- }
- else
- {
- assertCombo( page, UrlInputComposite.URL_CONTROL_NAME, expectedUrl, true /* isEnabled */);
- }
-
- // Verify username and password controls
- assertText( page, UrlInputComposite.USERNAME_TEXT_NAME, authData.getUsername(),
- authData.allowsUsernameAndPassword()
- && !AnonymousAccessType.REQUIRED.equals( authData.getAnonymousAccessType() ),
- authData.allowsUsernameAndPassword() );
- assertText( page, UrlInputComposite.PASSWORD_TEXT_NAME, authData.getPassword(),
- authData.allowsUsernameAndPassword()
- && !AnonymousAccessType.REQUIRED.equals( authData.getAnonymousAccessType() ),
- authData.allowsUsernameAndPassword() );
- assertLabel( page, UrlInputComposite.ANONYMOUS_LABEL_NAME,
- authData.allowsUsernameAndPassword() && authData.allowsAnonymousAccess() );
-
- // Verify certificate controls
- String certificatePath = null;
- if ( authData.getCertificatePath() != null )
- {
- certificatePath = authData.getCertificatePath().getAbsolutePath();
- }
- if ( certificatePath == null )
- {
- certificatePath = "";
- }
- String certificatePassphrase = authData.getCertificatePassphrase();
- if ( certificatePassphrase == null )
- {
- certificatePassphrase = "";
- }
- assertText( page, UrlInputComposite.CERTIFICATE_TEXT_NAME, certificatePath, authData.allowsCertificate(),
- authData.allowsCertificate() );
- assertText( page, UrlInputComposite.PASSPHRASE_TEXT_NAME, certificatePassphrase, authData.allowsCertificate(),
- authData.allowsCertificate() );
- assertButton( page, UrlInputComposite.BROWSE_CERTIFICATE_BUTTON_NAME, authData.allowsCertificate(),
- authData.allowsCertificate() );
-
- // Verify error/validation message
- assertEquals( "error/validation message is incorrect", errorMessage, page.getMessage() );
-
- // Verify saved authentication data
- IAuthData savedAuthData = AuthFacade.getAuthService().select( expectedUrl );
- if ( errorMessage != null && errorMessage.trim().length() > 0 )
- {
- assertNull( "Saved authentication data is incorrect: expected null", savedAuthData );
- }
- else
- {
- assertEquals( "Saved authentication data is incorrect", authData, savedAuthData );
- }
- }
-
- private static class DummyWizard
- extends Wizard
- {
- @Override
- public boolean performFinish()
- {
- return false;
- }
- }
-
- private static class DummyPage
- extends WizardPage
- {
- private String url;
-
- private int style;
-
- UrlInputComposite urlInputComposite;
-
- protected DummyPage( String url, int style )
- {
- super( "" );
- this.url = url;
- this.style = style;
- }
-
- public void createControl( Composite parent )
- {
- WidthGroup widthGroup = new WidthGroup();
- SwtValidationGroup validationGroup = SwtValidationGroup.create( SwtValidationUI.createUI( this ) );
- urlInputComposite = new UrlInputComposite( parent, widthGroup, validationGroup, style );
- setControl( urlInputComposite );
- urlInputComposite.setUrl( url );
- }
-
- @Override
- public void setMessage( String newMessage, int newType )
- {
- super.setMessage( newMessage, newType );
- }
- }
-
- private DummyPage createTestPage( String url, int urlInputStyle )
- {
- if ( wizard != null )
- {
- wizard.dispose();
- }
-
- display = Display.getCurrent();
- if ( display == null )
- {
- display = new Display();
- }
-
- wizard = new DummyWizard();
- DummyPage page = new DummyPage( url, urlInputStyle );
- wizard.addPage( page );
- Shell shell = new Shell( display );
-
- dialog = new WizardDialog( shell, wizard );
- dialog.create();
- // dialog.open();
- return page;
- }
-}
+package org.maven.ide.eclipse.ui.common.authentication;
+
+import java.io.File;
+
+import junit.framework.Assert;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.maven.ide.eclipse.authentication.AnonymousAccessType;
+import org.maven.ide.eclipse.authentication.AuthFacade;
+import org.maven.ide.eclipse.authentication.IAuthData;
+import org.maven.ide.eclipse.authentication.internal.AuthData;
+import org.maven.ide.eclipse.swtvalidation.SwtValidationGroup;
+import org.maven.ide.eclipse.swtvalidation.SwtValidationUI;
+import org.maven.ide.eclipse.ui.common.layout.WidthGroup;
+import org.maven.ide.eclipse.ui.tests.common.AbstractWizardPageTest;
+
+public class UrlInputCompositeTest
+ extends AbstractWizardPageTest
+{
+ private WizardDialog dialog;
+
+ private Display display;
+
+ public void testNullUrlDisallowCertificate()
+ {
+ int style = UrlInputComposite.ALLOW_ANONYMOUS;
+ DummyPage page = createTestPage( null /* url */, style );
+ assertIt( page, "", new AuthData( "", "", AnonymousAccessType.ALLOWED ), style, "URL may not be empty" );
+ }
+
+ public void testNullUrlAllowCertificate()
+ {
+ int style = UrlInputComposite.CERTIFICATE_CONTROLS | UrlInputComposite.ALLOW_ANONYMOUS;
+ DummyPage page = createTestPage( null /* url */, style );
+ assertIt( page, "", new AuthData( "", "", null, null, AnonymousAccessType.ALLOWED ), style,
+ "Certificate filename may not be empty" );
+ }
+
+ public void testUrlWithUsernamePassword()
+ {
+ String url = "http://UrlInputCompositeTest/testUrlWithUsernamePassword";
+ IAuthData authData =
+ new AuthData( "username testUrlWithUsernamePassword", "password testUrlWithUsernamePassword",
+ AnonymousAccessType.ALLOWED );
+ AuthFacade.getAuthService().save( url, authData );
+ int style = 0;
+ DummyPage page = createTestPage( url, style );
+ assertIt( page, url, authData, style );
+ }
+
+ public void testUrlWithUsernamePasswordAnonymousNotAllowed()
+ {
+ String url =
+ "http://UrlInputCompositeTest/testUrlWithUsernamePasswordAnonymousNotAllowed_" + System.currentTimeMillis();
+ IAuthData authData = new AuthData( "", "", AnonymousAccessType.NOT_ALLOWED );
+ // AuthFacade.getAuthService().save( url, authData );
+ int style = 0;
+ DummyPage page = createTestPage( url, style );
+ assertIt( page, url, authData, style, "Username may not be empty" );
+ authData =
+ new AuthData( "username testUrlWithUsernamePasswordAnonymousNotAllowed",
+ "password testUrlWithUsernamePasswordAnonymousNotAllowed", AnonymousAccessType.NOT_ALLOWED );
+ AuthFacade.getAuthService().save( url, authData );
+ page = createTestPage( url, style );
+ assertIt( page, url, authData, style );
+ }
+
+ public void testUrlWithUsernamePasswordAnonymousRequired()
+ {
+ String url = "http://UrlInputCompositeTest/testUrlWithUsernamePasswordAnonymousRequired";
+ IAuthData authData = new AuthData( "", "", AnonymousAccessType.REQUIRED );
+ AuthFacade.getAuthService().save( url, authData );
+ int style = 0;
+ DummyPage page = createTestPage( url, style );
+ assertIt( page, url, authData, style );
+ }
+
+ public void testUrlReadOnlyWithUsernamePassword()
+ {
+ String url = "http://UrlInputCompositeTest/testUrlReadOnlyWithUsernamePassword";
+ IAuthData authData =
+ new AuthData( "username testUrlReadOnlyWithUsernamePassword",
+ "password testUrlReadOnlyWithUsernamePassword", AnonymousAccessType.ALLOWED );
+ AuthFacade.getAuthService().save( url, authData );
+ int style = UrlInputComposite.READ_ONLY_URL;
+ DummyPage page = createTestPage( url, style );
+ assertIt( page, url, authData, style );
+ }
+
+ public void testUrlWithCertificate()
+ {
+ String url = "http://UrlInputCompositeTest/testUrlWithCertificate";
+ IAuthData authData = new AuthData( new File( "testUrlWithCertificate" ), "passphrase testUrlWithCertificate" );
+ AuthFacade.getAuthService().save( url, authData );
+ int style = 0;
+ DummyPage page = createTestPage( url, style );
+ assertIt( page, url, authData, style );
+ }
+
+ public void testUrlWithCertificateNoSavedCertificate()
+ {
+ String url =
+ "http://UrlInputCompositeTest/testUrlWithCertificateNoSavedCertificate" + System.currentTimeMillis();
+ int style = UrlInputComposite.CERTIFICATE_CONTROLS | UrlInputComposite.ALLOW_ANONYMOUS;
+ DummyPage page = createTestPage( url, style );
+ setText( page, UrlInputComposite.CERTIFICATE_TEXT_NAME,
+ new File( "testUrlWithCertificateNoSavedCertificate" ).getAbsolutePath() );
+ setText( page, UrlInputComposite.PASSPHRASE_TEXT_NAME, "passphrase testUrlWithCertificateNoSavedCertificate" );
+ IAuthData authData =
+ new AuthData( "", "", new File( "testUrlWithCertificateNoSavedCertificate" ),
+ "passphrase testUrlWithCertificateNoSavedCertificate", AnonymousAccessType.ALLOWED );
+ assertIt( page, url, authData, style );
+ }
+
+ public void testUrlWithUsernamePasswordAndCertificate()
+ {
+ String url = "http://UrlInputCompositeTest/testUrlWithUsernamePasswordAndCertificate";
+ IAuthData authData =
+ new AuthData( "username testUrlWithUsernamePasswordAndCertificate",
+ "password testUrlWithUsernamePasswordAndCertificate",
+ new File( "testUrlWithUsernamePasswordAndCertificate" ),
+ "passphrase testUrlWithUsernamePasswordAndCertificate", AnonymousAccessType.ALLOWED );
+ AuthFacade.getAuthService().save( url, authData );
+ int style = 0;
+ DummyPage page = createTestPage( url, style );
+ assertIt( page, url, authData, style );
+ }
+
+ public void testInvalidUrl()
+ {
+ String url = "http://UrlInputCompositeTest/testInvalidUrl\\";
+ int style = UrlInputComposite.ALLOW_ANONYMOUS;
+ DummyPage page = createTestPage( url, style );
+ assertIt( page, url, new AuthData( "", "", AnonymousAccessType.ALLOWED ), style, "'" + url
+ + "' is not a valid URL: Illegal character in path at index 43: http://UrlInputCompositeTest/testInvalidUrl\\" );
+ }
+
+ public void testGitSshUrl()
+ {
+ String url = "scm:git:ssh://testGitSshUrl/foo";
+ int style = UrlInputComposite.ALLOW_ANONYMOUS;
+ DummyPage page = createTestPage( url, style );
+ assertIt( page, url, new AuthData( "", "", AnonymousAccessType.ALLOWED ), style );
+ }
+
+ private void assertIt( DummyPage page, String expectedUrl, IAuthData authData, int style )
+ {
+ assertIt( page, expectedUrl, authData, style, null /* errorMessage */);
+ }
+
+ private void assertIt( DummyPage page, String expectedUrl, IAuthData authData, int style, String errorMessage )
+ {
+ // Verify url control
+ Assert.assertEquals( "Incorrect expected URL", expectedUrl, page.urlInputComposite.getUrl() );
+ if ( ( style & UrlInputComposite.READ_ONLY_URL ) != 0 )
+ {
+ assertText( page, UrlInputComposite.URL_CONTROL_NAME, expectedUrl, false /* isEnabled */, true /* isVisible */);
+ }
+ else
+ {
+ assertCombo( page, UrlInputComposite.URL_CONTROL_NAME, expectedUrl, true /* isEnabled */);
+ }
+
+ // Verify username and password controls
+ assertText( page, UrlInputComposite.USERNAME_TEXT_NAME, authData.getUsername(),
+ authData.allowsUsernameAndPassword()
+ && !AnonymousAccessType.REQUIRED.equals( authData.getAnonymousAccessType() ),
+ authData.allowsUsernameAndPassword() );
+ assertText( page, UrlInputComposite.PASSWORD_TEXT_NAME, authData.getPassword(),
+ authData.allowsUsernameAndPassword()
+ && !AnonymousAccessType.REQUIRED.equals( authData.getAnonymousAccessType() ),
+ authData.allowsUsernameAndPassword() );
+ assertLabel( page, UrlInputComposite.ANONYMOUS_LABEL_NAME,
+ authData.allowsUsernameAndPassword() && authData.allowsAnonymousAccess() );
+
+ // Verify certificate controls
+ String certificatePath = null;
+ if ( authData.getCertificatePath() != null )
+ {
+ certificatePath = authData.getCertificatePath().getAbsolutePath();
+ }
+ if ( certificatePath == null )
+ {
+ certificatePath = "";
+ }
+ String certificatePassphrase = authData.getCertificatePassphrase();
+ if ( certificatePassphrase == null )
+ {
+ certificatePassphrase = "";
+ }
+ assertText( page, UrlInputComposite.CERTIFICATE_TEXT_NAME, certificatePath, authData.allowsCertificate(),
+ authData.allowsCertificate() );
+ assertText( page, UrlInputComposite.PASSPHRASE_TEXT_NAME, certificatePassphrase, authData.allowsCertificate(),
+ authData.allowsCertificate() );
+ assertButton( page, UrlInputComposite.BROWSE_CERTIFICATE_BUTTON_NAME, authData.allowsCertificate(),
+ authData.allowsCertificate() );
+
+ // Verify error/validation message
+ assertEquals( "error/validation message is incorrect", errorMessage, page.getMessage() );
+
+ // Verify saved authentication data
+ IAuthData savedAuthData = AuthFacade.getAuthService().select( expectedUrl );
+ if ( errorMessage != null && errorMessage.trim().length() > 0 )
+ {
+ assertNull( "Saved authentication data is incorrect: expected null", savedAuthData );
+ }
+ else
+ {
+ assertEquals( "Saved authentication data is incorrect", authData, savedAuthData );
+ }
+ }
+
+ private static class DummyWizard
+ extends Wizard
+ {
+ @Override
+ public boolean performFinish()
+ {
+ return false;
+ }
+ }
+
+ private static class DummyPage
+ extends WizardPage
+ {
+ private String url;
+
+ private int style;
+
+ UrlInputComposite urlInputComposite;
+
+ protected DummyPage( String url, int style )
+ {
+ super( "" );
+ this.url = url;
+ this.style = style;
+ }
+
+ public void createControl( Composite parent )
+ {
+ WidthGroup widthGroup = new WidthGroup();
+ SwtValidationGroup validationGroup = SwtValidationGroup.create( SwtValidationUI.createUI( this ) );
+ urlInputComposite = new UrlInputComposite( parent, widthGroup, validationGroup, style );
+ setControl( urlInputComposite );
+ urlInputComposite.setUrl( url );
+ }
+
+ @Override
+ public void setMessage( String newMessage, int newType )
+ {
+ super.setMessage( newMessage, newType );
+ }
+ }
+
+ private DummyPage createTestPage( String url, int urlInputStyle )
+ {
+ if ( wizard != null )
+ {
+ wizard.dispose();
+ }
+
+ display = Display.getCurrent();
+ if ( display == null )
+ {
+ display = new Display();
+ }
+
+ wizard = new DummyWizard();
+ DummyPage page = new DummyPage( url, urlInputStyle );
+ wizard.addPage( page );
+ Shell shell = new Shell( display );
+
+ dialog = new WizardDialog( shell, wizard );
+ dialog.create();
+ // dialog.open();
+ return page;
+ }
+}
View
58 org.maven.ide.eclipse.ui.common/.project
@@ -1,29 +1,29 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.maven.ide.eclipse.ui.common</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.maven.ide.eclipse.ui.common</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
18 org.maven.ide.eclipse.ui.common/.settings/org.maven.ide.eclipse.prefs
@@ -1,9 +1,9 @@
-#Tue Jun 22 20:08:07 EDT 2010
-activeProfiles=
-eclipse.preferences.version=1
-fullBuildGoals=process-test-resources
-includeModules=false
-resolveWorkspaceProjects=true
-resourceFilterGoals=process-resources resources\:testResources
-skipCompilerPlugin=true
-version=1
+#Tue Jun 22 20:08:07 EDT 2010
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
View
60 org.maven.ide.eclipse.ui.common/META-INF/MANIFEST.MF
@@ -1,30 +1,30 @@
-Manifest-Version: 1.0
-MavenArtifact-BaseVersion: 1.0.0-SNAPSHOT
-Bundle-Version: 1.1.5.qualifier
-MavenArtifact-ArtifactId: org.maven.ide.eclipse.ui.common
-MavenArtifact-GroupId: org.maven.ide.eclipse.commons
-Bundle-Name: Maven Eclipse UI Commons
-Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.maven.ide.eclipse.ui.common;singleton:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6
-Import-Package: org.eclipse.equinox.security.storage.provider,
- org.slf4j;version="[1.5,1.6)"
-Require-Bundle: org.eclipse.osgi,
- org.eclipse.core.runtime,
- org.eclipse.core.resources,
- org.eclipse.ui,
- org.eclipse.ui.forms,
- org.maven.ide.eclipse.authentication,
- org.maven.ide.eclipse.io,
- org.maven.ide.eclipse.swtvalidation
-Export-Package: org.maven.ide.eclipse.ui.common,
- org.maven.ide.eclipse.ui.common.authentication,
- org.maven.ide.eclipse.ui.common.composites,
- org.maven.ide.eclipse.ui.common.dialogs,
- org.maven.ide.eclipse.ui.common.layout,
- org.maven.ide.eclipse.ui.common.validation,
- org.maven.ide.eclipse.ui.common.wizards
-Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.maven.ide.eclipse.ui.common.Activator
-Bundle-Vendor: Sonatype, Inc.
-
+Manifest-Version: 1.0
+MavenArtifact-BaseVersion: 1.0.0-SNAPSHOT
+Bundle-Version: 1.1.5.qualifier
+MavenArtifact-ArtifactId: org.maven.ide.eclipse.ui.common
+MavenArtifact-GroupId: org.maven.ide.eclipse.commons
+Bundle-Name: Maven Eclipse UI Commons
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: org.maven.ide.eclipse.ui.common;singleton:=true
+Bundle-RequiredExecutionEnvironment: J2SE-1.5, JavaSE-1.6
+Import-Package: org.eclipse.equinox.security.storage.provider,
+ org.slf4j;version="[1.5,1.6)"
+Require-Bundle: org.eclipse.osgi,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.ui,
+ org.eclipse.ui.forms,
+ org.maven.ide.eclipse.authentication,
+ org.maven.ide.eclipse.io,
+ org.maven.ide.eclipse.swtvalidation
+Export-Package: org.maven.ide.eclipse.ui.common,
+ org.maven.ide.eclipse.ui.common.authentication,
+ org.maven.ide.eclipse.ui.common.composites,
+ org.maven.ide.eclipse.ui.common.dialogs,
+ org.maven.ide.eclipse.ui.common.layout,
+ org.maven.ide.eclipse.ui.common.validation,
+ org.maven.ide.eclipse.ui.common.wizards
+Bundle-ActivationPolicy: lazy
+Bundle-Activator: org.maven.ide.eclipse.ui.common.Activator
+Bundle-Vendor: Sonatype, Inc.
+
View
12 org.maven.ide.eclipse.ui.common/build.properties
@@ -1,6 +1,6 @@
-source.. = src/main/java/
-output.. = target/classes/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- icons/
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ icons/
View
30 org.maven.ide.eclipse.ui.common/pom.xml
@@ -1,15 +1,15 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.maven.ide.eclipse.commons</groupId>
- <artifactId>eclipse-commons-parent</artifactId>
- <version>1.1.5-SNAPSHOT</version>
- <relativePath>../eclipse-commons-parent</relativePath>
- </parent>
-
- <artifactId>org.maven.ide.eclipse.ui.common</artifactId>
- <packaging>eclipse-plugin</packaging>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.maven.ide.eclipse.commons</groupId>
+ <artifactId>eclipse-commons-parent</artifactId>
+ <version>1.1.5-SNAPSHOT</version>
+ <relativePath>../eclipse-commons-parent</relativePath>
+ </parent>
+
+ <artifactId>org.maven.ide.eclipse.ui.common</artifactId>
+ <packaging>eclipse-plugin</packaging>
+</project>
View
140 org.maven.ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/Activator.java
@@ -1,70 +1,70 @@
-package org.maven.ide.eclipse.ui.common;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-public class Activator
- extends AbstractUIPlugin
-{
- public static final String PLUGIN_ID = "org.maven.ide.eclipse.ui.common";
-
- public static final String IMAGE_PATH = "icons/";
-
- private static Activator plugin;
-
- public void start( BundleContext context )
- throws Exception
- {
- super.start( context );
- plugin = this;
- }
-
- public void stop( BundleContext context )
- throws Exception
- {
- plugin = null;
- super.stop( context );
- }
-
- public static Activator getDefault()
- {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given plug-in relative path
- *
- * @param path the path
- * @return the image descriptor
- */
- public ImageDescriptor getImageDescriptor( String path )
- {
- ImageRegistry imageRegistry = getImageRegistry();
- if ( imageRegistry != null )
- {
- ImageDescriptor imageDescriptor = imageRegistry.getDescriptor( path );
- if ( imageDescriptor == null )
- {
- imageDescriptor = imageDescriptorFromPlugin( PLUGIN_ID, IMAGE_PATH + path );
- imageRegistry.put( path, imageDescriptor );
- }
- return imageDescriptor;
- }
-
- return null;
- }
-
- public Image getImage( String path )
- {
- ImageRegistry imageRegistry = getImageRegistry();
- if ( imageRegistry != null )
- {
- getImageDescriptor( path );
- return imageRegistry.get( path );
- }
- return null;
- }
-}
+package org.maven.ide.eclipse.ui.common;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+public class Activator
+ extends AbstractUIPlugin
+{
+ public static final String PLUGIN_ID = "org.maven.ide.eclipse.ui.common";
+
+ public static final String IMAGE_PATH = "icons/";
+
+ private static Activator plugin;
+
+ public void start( BundleContext context )
+ throws Exception
+ {
+ super.start( context );
+ plugin = this;
+ }
+
+ public void stop( BundleContext context )
+ throws Exception
+ {
+ plugin = null;
+ super.stop( context );
+ }
+
+ public static Activator getDefault()
+ {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public ImageDescriptor getImageDescriptor( String path )
+ {
+ ImageRegistry imageRegistry = getImageRegistry();
+ if ( imageRegistry != null )
+ {
+ ImageDescriptor imageDescriptor = imageRegistry.getDescriptor( path );
+ if ( imageDescriptor == null )
+ {
+ imageDescriptor = imageDescriptorFromPlugin( PLUGIN_ID, IMAGE_PATH + path );
+ imageRegistry.put( path, imageDescriptor );
+ }
+ return imageDescriptor;
+ }
+
+ return null;
+ }
+
+ public Image getImage( String path )
+ {
+ ImageRegistry imageRegistry = getImageRegistry();
+ if ( imageRegistry != null )
+ {
+ getImageDescriptor( path );
+ return imageRegistry.get( path );
+ }
+ return null;
+ }
+}
View
176 ...e.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/ErrorHandlingUtils.java
@@ -1,88 +1,88 @@
-package org.maven.ide.eclipse.ui.common;
-
-import java.io.IOException;
-import java.nio.channels.UnresolvedAddressException;
-
-import org.maven.ide.eclipse.io.ForbiddenException;
-import org.maven.ide.eclipse.io.NotFoundException;
-import org.maven.ide.eclipse.io.TransferException;
-import org.maven.ide.eclipse.io.UnauthorizedException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ErrorHandlingUtils
-{
- private static Logger log = LoggerFactory.getLogger( ErrorHandlingUtils.class );
-
- private ErrorHandlingUtils()
- {
- }
-
- /**
- * Handle the different types of exceptions we have for various error responses in io plugin. If we introduce new
- * exception type, we shall add a new parameter to this method and "It's a good thing". if you intentionally choose
- * not to be interested in one or more exceptions just pass null in it's parameter Currently supported exception
- * types: ForbiddenException, NotFoundException, UnauthorizedException and TransferException
- *
- * @param exc exception passed in, null allowed
- * @return an error string or null if no matching error found
- */
- public static String convertNexusIOExceptionToUIText( Throwable exc, String auth, String forbidden, String notFound )
- {
- if ( exc == null )
- {
- return null;
- }
- if ( auth == null )
- {
- auth = Messages.errors_authFailed;
- }
- if ( forbidden == null )
- {
- forbidden = Messages.errors_forbidden;
- }
- if ( notFound == null )
- {
- notFound = Messages.errors_resourceNotFound;
- }
-
- log.debug( exc.getMessage(), exc );
-
- if ( exc instanceof ForbiddenException )
- {
- return forbidden;
- }
- if ( exc instanceof NotFoundException )
- {
- return notFound;
- }
- if ( exc instanceof UnauthorizedException )
- {
- return auth;
- }
- if ( exc instanceof TransferException )
- {
- TransferException te = (TransferException) exc;
- if ( te.hasNexusError() )
- {
- return te.getNexusError();
- }
- }
- if ( exc instanceof IOException && exc.getCause() instanceof UnresolvedAddressException )
- {
- return Messages.errors_unresolvedAddress;
- }
- if ( exc != null && exc.getCause() != null && exc != exc.getCause() )
- {
- return convertNexusIOExceptionToUIText( exc.getCause(), auth, forbidden, notFound );
- }
- return null;
- }
-
- public static String convertNexusIOExceptionToUIText( Throwable e )
- {
- return ErrorHandlingUtils.convertNexusIOExceptionToUIText( e, Messages.errors_authFailed,
- Messages.errors_forbidden,
- Messages.errors_resourceNotFound );
- }
-}
+package org.maven.ide.eclipse.ui.common;
+
+import java.io.IOException;
+import java.nio.channels.UnresolvedAddressException;
+
+import org.maven.ide.eclipse.io.ForbiddenException;
+import org.maven.ide.eclipse.io.NotFoundException;
+import org.maven.ide.eclipse.io.TransferException;
+import org.maven.ide.eclipse.io.UnauthorizedException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ErrorHandlingUtils
+{
+ private static Logger log = LoggerFactory.getLogger( ErrorHandlingUtils.class );
+
+ private ErrorHandlingUtils()
+ {
+ }
+
+ /**
+ * Handle the different types of exceptions we have for various error responses in io plugin. If we introduce new
+ * exception type, we shall add a new parameter to this method and "It's a good thing". if you intentionally choose
+ * not to be interested in one or more exceptions just pass null in it's parameter Currently supported exception
+ * types: ForbiddenException, NotFoundException, UnauthorizedException and TransferException
+ *
+ * @param exc exception passed in, null allowed
+ * @return an error string or null if no matching error found
+ */
+ public static String convertNexusIOExceptionToUIText( Throwable exc, String auth, String forbidden, String notFound )
+ {
+ if ( exc == null )
+ {
+ return null;
+ }
+ if ( auth == null )
+ {
+ auth = Messages.errors_authFailed;
+ }
+ if ( forbidden == null )
+ {
+ forbidden = Messages.errors_forbidden;
+ }
+ if ( notFound == null )
+ {
+ notFound = Messages.errors_resourceNotFound;
+ }
+
+ log.debug( exc.getMessage(), exc );
+
+ if ( exc instanceof ForbiddenException )
+ {
+ return forbidden;
+ }
+ if ( exc instanceof NotFoundException )
+ {
+ return notFound;
+ }
+ if ( exc instanceof UnauthorizedException )
+ {
+ return auth;
+ }
+ if ( exc instanceof TransferException )
+ {
+ TransferException te = (TransferException) exc;
+ if ( te.hasNexusError() )
+ {
+ return te.getNexusError();
+ }
+ }
+ if ( exc instanceof IOException && exc.getCause() instanceof UnresolvedAddressException )
+ {
+ return Messages.errors_unresolvedAddress;
+ }
+ if ( exc != null && exc.getCause() != null && exc != exc.getCause() )
+ {
+ return convertNexusIOExceptionToUIText( exc.getCause(), auth, forbidden, notFound );
+ }
+ return null;
+ }
+
+ public static String convertNexusIOExceptionToUIText( Throwable e )
+ {
+ return ErrorHandlingUtils.convertNexusIOExceptionToUIText( e, Messages.errors_authFailed,
+ Messages.errors_forbidden,
+ Messages.errors_resourceNotFound );
+ }
+}
View
42 org.maven.ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/FormUtils.java
@@ -1,21 +1,21 @@
-package org.maven.ide.eclipse.ui.common;
-
-import org.eclipse.swt.widgets.Text;
-
-public class FormUtils
-{
- public static String toNull( String s )
- {
- return s == null || s.length() == 0 ? null : s;
- }
-
- public static String toNull( Text text )
- {
- return toNull( text.getText().trim() );
- }
-
- public static String nvl( String s )
- {
- return s == null ? "" : s;
- }
-}
+package org.maven.ide.eclipse.ui.common;
+
+import org.eclipse.swt.widgets.Text;
+
+public class FormUtils
+{
+ public static String toNull( String s )
+ {
+ return s == null || s.length() == 0 ? null : s;
+ }
+
+ public static String toNull( Text text )
+ {
+ return toNull( text.getText().trim() );
+ }
+
+ public static String nvl( String s )
+ {
+ return s == null ? "" : s;
+ }
+}
View
62 org.maven.ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/Images.java
@@ -1,31 +1,31 @@
-package org.maven.ide.eclipse.ui.common;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.swt.graphics.Image;
-
-public class Images
-{
- public static final Image ARTIFACT = getImage( "artifact.gif" ); //$NON-NLS-1$
-
- public static final Image AUTH_REALM = getImage( "authrealm.png" ); //$NON-NLS-1$
-
- public static final Image GROUP = getImage( "group.gif" ); //$NON-NLS-1$
-
- public static final ImageDescriptor REFRESH_DESCRIPTOR = getImageDescriptor( "refresh.gif" ); //$NON-NLS-1$
-
- public static final Image VERSION = getImage( "version.gif" ); //$NON-NLS-1$
-
- private Images()
- {
- }
-
- public static Image getImage( String image )
- {
- return Activator.getDefault().getImage( image );
- }
-
- public static ImageDescriptor getImageDescriptor( String image )
- {
- return Activator.getDefault().getImageDescriptor( image );
- }
-}
+package org.maven.ide.eclipse.ui.common;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+
+public class Images
+{
+ public static final Image ARTIFACT = getImage( "artifact.gif" ); //$NON-NLS-1$
+
+ public static final Image AUTH_REALM = getImage( "authrealm.png" ); //$NON-NLS-1$
+
+ public static final Image GROUP = getImage( "group.gif" ); //$NON-NLS-1$
+
+ public static final ImageDescriptor REFRESH_DESCRIPTOR = getImageDescriptor( "refresh.gif" ); //$NON-NLS-1$
+
+ public static final Image VERSION = getImage( "version.gif" ); //$NON-NLS-1$
+
+ private Images()
+ {
+ }
+
+ public static Image getImage( String image )
+ {
+ return Activator.getDefault().getImage( image );
+ }
+
+ public static ImageDescriptor getImageDescriptor( String image )
+ {
+ return Activator.getDefault().getImageDescriptor( image );
+ }
+}
View
424 org.maven.ide.eclipse.ui.common/src/main/java/org/maven/ide/eclipse/ui/common/Messages.java
@@ -1,212 +1,212 @@
-package org.maven.ide.eclipse.ui.common;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages
- extends NLS
-{
- private static final String BUNDLE = "org.maven.ide.eclipse.ui.common.messages";
-
- static
- {
- NLS.initializeMessages( BUNDLE, Messages.class );
- }
-
- public static String errors_authFailed;
-
- public static String errors_forbidden;
-
- public static String errors_resourceNotFound;
-
- public static String errors_unresolvedAddress;
-
- public static String errors_not_valid_url;
-
- public static String errors_host_may_not_contain_space;
-
- public static String gavComposite_artifactId_label;
-
- public static String gavComposite_artifactId_name;
-
- public static String gavComposite_groupId_label;
-
- public static String gavComposite_groupId_name;
-
- public static String gavComposite_invalidOsgiVersion;
-
- public static String gavComposite_version_label;
-
- public static String gavComposite_version_name;
-
- public static String listEditorComposite_add;
-
- public static String listEditorComposite_edit;
-
- public static String listEditorComposite_find;
-
- public static String listEditorComposite_remove;
-
- public static String realmComposite_access_label;
-
- public static String realmComposite_anonymousAllowed;
-
- public static String realmComposite_anonymousOnly;
-
- public static String realmComposite_manageRealms;
-
- public static String realmComposite_noSelection;
-
- public static String realmComposite_passwordRequired;
-
- public static String realmComposite_selectRealmFor;
-
- public static String realmManagementComposite_addUrl;
-
- public static String realmManagementComposite_authenticationType_password;
-
- public static String realmManagementComposite_authenticationType_passwordAndSsl;
-
- public static String realmManagementComposite_authenticationType_ssl;
-
- public static String realmManagementComposite_realmAuthentication_label;
-
- public static String realmManagementComposite_realmDescription_label;
-
- public static String realmManagementComposite_realmId_exists;
-
- public static String realmManagementComposite_realmId_label;
-
- public static String realmManagementComposite_realmId_name;
-
- public static String realmManagementComposite_realmName_label;
-
- public static String realmManagementComposite_realmName_name;
-
- public static String realmManagementComposite_removeUrl;
-
- public static String realmManagementComposite_urlViewer_accessColumn;
-
- public static String realmManagementComposite_urlViewer_label;
-
- public static String realmManagementComposite_urlViewer_urlColumn;
-
- public static String realmManagementDialog_apply;
-
- public static String realmManagementDialog_errorSavingRealm;
-
- public static String realmManagementDialog_title;
-
- public static String realmManagementPage_add_action;
-
- public static String realmManagementPage_add_tooltip;
-
- public static String realmManagementPage_description;
-
- public static String realmManagementPage_newRealmNameTemplate;
-
- public static String realmManagementPage_realmChanged_cancel;
-
- public static String realmManagementPage_realmChanged_discard;
-
- public static String realmManagementPage_realmChanged_message;
-
- public static String realmManagementPage_realmChanged_title;
-
- public static String realmManagementPage_reload_error;
-
- public static String realmManagementPage_reload_tooltip;
-
- public static String realmManagementPage_remove_action;
-
- public static String realmManagementPage_remove_error;
-
- public static String realmManagementPage_remove_message;
-
- public static String realmManagementPage_remove_title;
-
- public static String realmManagementPage_remove_tooltip;
-
- public static String realmManagementPage_title;
-
- public static String remoteResourceLookupDialog_error_other;
-
- public static String remoteResourceLookupDialog_loading;
-
- public static String remoteResourceLookupDialog_server_collapsed;
-
- public static String remoteResourceLookupDialog_server_expanded;
-
- public static String remoteResourceLookupDialog_server_label;
-
- public static String remoteResourceLookupPage_error_other;
-
- public static String remoteResourceLookupPage_loading;
-
- public static String remoteResourceLookupPage_server_collapsed;
-
- public static String remoteResourceLookupPage_server_expanded;
-
- public static String remoteResourceLookupPage_server_label;
-
- public static String secureStorageDialog_errors_noMatch;
-
- public static String secureStorageDialog_errors_emptyPassword;
-
- public static String secureStorageDialog_label_confirm;
-
- public static String secureStorageDialog_label_password;
-
- public static String secureStorageDialog_messageLogin;
-
- public static String secureStorageDialog_messageLoginChange;
-
- public static String secureStorageDialog_title;
-
- public static String urlInput_anonymousIfEmpty;
-
- public static String urlInput_browse;
-
- public static String urlInput_certificateFile_label;
-
- public static String urlInput_certificateFile_name;
-
- public static String urlInput_fileSelect_empty;
-
- public static String urlInput_fileSelect_filter1;
-
- public static String urlInput_fileSelect_filter2;
-
- public static String urlInput_fileSelect_notFound;
-
- public static String urlInput_fileSelect_title;
-
- public static String urlInput_passphrase_label;
-
- public static String urlInput_passphrase_name;
-
- public static String urlInput_password_label;
-
- public static String urlInput_password_name;
-
- public static String urlInput_url_label;
-
- public static String urlInput_url_name;
-
- public static String urlInput_username_label;
-
- public static String urlInput_username_name;
-
- public static String urlInput_useCertificate;
-
- public static String urlInput_validation_enterUrl;
-
- public static String urlInput_validation_enterUserCredentials;
-
- public static String urlInput_validation_invalidUrl;
-
- public static String validation_errors_invalidCharacters;
-
- public static String validation_errors_projectExists;
-
- public static String validation_errors_remoteUrlRequired;
-}
+package org.maven.ide.eclipse.ui.common;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages
+ extends NLS
+{
+ private static final String BUNDLE = "org.maven.ide.eclipse.ui.common.messages";
+
+ static
+ {
+ NLS.initializeMessages( BUNDLE, Messages.class );
+ }
+
+ public static String errors_authFailed;
+
+ public static String errors_forbidden;