SQL Plugin copied from Quantum plugin and refactored for PHPEclipse
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.sql / src / net / sourceforge / phpdt / sql / bookmarks / Bookmark.java
diff --git a/archive/net.sourceforge.phpeclipse.sql/src/net/sourceforge/phpdt/sql/bookmarks/Bookmark.java b/archive/net.sourceforge.phpeclipse.sql/src/net/sourceforge/phpdt/sql/bookmarks/Bookmark.java
new file mode 100644 (file)
index 0000000..e746898
--- /dev/null
@@ -0,0 +1,219 @@
+package net.sourceforge.phpdt.sql.bookmarks;
+
+/**
+ * @author root
+ *
+ * To change this generated comment edit the template variable "typecomment":
+ * Window>Preferences>Java>Templates.
+ * To enable and disable the creation of type comments go to
+ * Window>Preferences>Java>Code Generation.
+ */
+public class Bookmark {
+       String name = "";
+       String username = "";
+       String password = "";
+       String connect = "";
+       String driver = "";
+       String type = "";
+       String driverFile = "";
+       String schema = "";
+       
+       public Bookmark() {
+       }
+
+       public Bookmark(Bookmark data) {
+               setName(data.getName());
+               setUsername(data.getUsername());
+               setPassword(data.getPassword());
+               setConnect(data.getConnect());
+               setDriver(data.getDriver());
+               setType(data.getType());
+               setDriverFile(data.getDriverFile());
+       }
+
+       public Bookmark(
+               String name,
+               String username,
+               String password,
+               String connect,
+               String driver,
+               String type,
+               String driverFile) {
+               this.name = username;
+               this.username = username;
+               this.password = password;
+               this.connect = connect;
+               this.driver = driver;
+               this.type = type;
+               this.driverFile = driverFile;
+       }
+
+       /**
+        * Returns the connect.
+        * @return String
+        */
+       public String getConnect() {
+               return connect;
+       }
+
+       /**
+        * Returns the driver.
+        * @return String
+        */
+       public String getDriver() {
+               return driver;
+       }
+
+       /**
+        * Returns the driverFile.
+        * @return String
+        */
+       public String getDriverFile() {
+               return driverFile;
+       }
+
+       /**
+        * Returns the password.
+        * @return String
+        */
+       public String getPassword() {
+               return password;
+       }
+
+       /**
+        * Returns the username.
+        * @return String
+        */
+       public String getUsername() {
+               return username;
+       }
+
+       /**
+        * Sets the connect.
+        * @param connect The connect to set
+        */
+       public void setConnect(String connect) {
+               if (connect == null) {
+                       connect = "";
+               }
+               this.connect = connect;
+       }
+
+       /**
+        * Sets the driver.
+        * @param driver The driver to set
+        */
+       public void setDriver(String driver) {
+               if (driver == null) {
+                       driver = "";
+               }
+               this.driver = driver;
+       }
+
+       /**
+        * Sets the driverFile.
+        * @param driverFile The driverFile to set
+        */
+       public void setDriverFile(String driverFile) {
+               if (driverFile == null) {
+                       driverFile = "";
+               }
+               this.driverFile = driverFile;
+       }
+
+       /**
+        * Sets the password.
+        * @param password The password to set
+        */
+       public void setPassword(String password) {
+               if (password == null) {
+                       password = "";
+               }
+               this.password = password;
+       }
+
+       /**
+        * Sets the username.
+        * @param username The username to set
+        */
+       public void setUsername(String username) {
+               if (username == null) {
+                       username = "";
+               }
+               this.username = username;
+       }
+
+       /**
+        * Returns the name.
+        * @return String
+        */
+       public String getName() {
+               return name;
+       }
+
+       /**
+        * Sets the name.
+        * @param name The name to set
+        */
+       public void setName(String name) {
+               if (name == null) {
+                       name = "";
+               }
+               this.name = name;
+       }
+
+       public boolean isEmpty() {
+               if (name.equals("") &&
+               username.equals("") &&
+               password.equals("") &&
+               connect.equals("") &&
+               driver.equals("") &&
+               type.equals("") &&
+               driverFile.equals("")) {
+                       return true;
+               }
+               return false;
+       }
+       public String toString() {
+               StringBuffer buffer = new StringBuffer();
+               buffer.append("[");
+               buffer.append("name=");
+               buffer.append(name);
+               buffer.append(", ");
+               buffer.append("username=");
+               buffer.append(username);
+               buffer.append(", ");
+               buffer.append("password=****");
+               buffer.append(", ");
+               buffer.append("connect=");
+               buffer.append(connect);
+               buffer.append(", ");
+               buffer.append("driver=");
+               buffer.append(driver);
+               buffer.append(", ");
+               buffer.append("type=");
+               buffer.append(type);
+               buffer.append(", ");
+               buffer.append("driverFile=");
+               buffer.append(driverFile);
+               buffer.append("]");
+               return buffer.toString();
+       }
+       
+       public String getType() {
+               return type;
+       }
+
+       public void setType(String type) {
+               this.type = type;
+       }
+
+       public String getSchema() {
+               return schema;
+       }
+
+       public void setSchema(String schema) {
+               this.schema = schema;
+       }
+
+}