added file extension php5
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / model / JDBCDriver.java
index aff0f3c..8f28a75 100644 (file)
@@ -15,15 +15,14 @@ public class JDBCDriver {
        private String version;
        private String className;
        private String jarFileName;
+       private String type;
        private PropertyChangeSupport propertyChangeSupport = new PropertyChangeSupport(this);
        /**
         * @param className
         * @param jarFileName
         */
-       public JDBCDriver(String className, String jarFileName) {
-               super();
-               this.className = className;
-               this.jarFileName = jarFileName;
+       public JDBCDriver(String className, String jarFileName, String type) {
+               this(className, jarFileName, type, null, null);
        }
        /**
         * 
@@ -36,9 +35,10 @@ public class JDBCDriver {
         * @param name
         * @param version
         */
-       public JDBCDriver(String className, String jarFileName, String name, String version) {
+       public JDBCDriver(String className, String jarFileName, String type, String name, String version) {
                this.name = name;
                this.version = version;
+               this.type = type;
                this.className = className;
                this.jarFileName = jarFileName;
        }
@@ -125,6 +125,10 @@ public class JDBCDriver {
                                return false;
                        } else if (this.jarFileName != null && !this.jarFileName.equals(that.jarFileName)) {
                                return false;
+                       } else if (this.type == null && that.type != null) {
+                               return false;
+                       } else if (this.type != null && !this.type.equals(that.type)) {
+                               return false;
                        } else {
                                return true;
                        }
@@ -138,6 +142,9 @@ public class JDBCDriver {
                if (this.jarFileName != null) {
                        hashCode ^= this.jarFileName.hashCode();
                }
+               if (this.type != null) {
+                       hashCode ^= this.type.hashCode();
+               }
                return hashCode;
        }
        
@@ -170,4 +177,20 @@ public class JDBCDriver {
        public void removePropertyChangeListener(String arg0, PropertyChangeListener arg1) {
                this.propertyChangeSupport.removePropertyChangeListener(arg0, arg1);
        }
+       /**
+        * @return Returns the type.
+        */
+       public String getType() {
+               return this.type;
+       }
+       /**
+        * @param type The type to set.
+        */
+       public void setType(String type) {
+               if (type != null && !type.equals(this.type)) {
+                       String original = this.type;
+                       this.type = type;
+                       this.propertyChangeSupport.firePropertyChange("type", original, type);
+               }
+       }
 }