Index: /trunk/de.ugoe.cs.swe.exercises/plugin.xml
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/plugin.xml	(revision 19)
+++ /trunk/de.ugoe.cs.swe.exercises/plugin.xml	(revision 20)
@@ -93,7 +93,7 @@
          point="org.eclipse.ui.commands">
       <command
-            defaultHandler="de.ugoe.cs.swe.exercises.settings.Settings"
-            id="de.ugoe.cs.swe.exercises.commands.svnSettings"
-            name="SVN Settings">
+            defaultHandler="de.ugoe.cs.swe.exercises.settings.SettingsHandler"
+            id="de.ugoe.cs.swe.exercises.commands.settings"
+            name="Settings">
       </command>
    </extension>
@@ -105,5 +105,5 @@
                label="Options">
             <command
-                  commandId="de.ugoe.cs.swe.exercises.commands.svnSettings"
+                  commandId="de.ugoe.cs.swe.exercises.commands.settings"
                   icon="icons/system-run16.png"
                   label="Settings"
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/Application.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/Application.java	(revision 19)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/Application.java	(revision 20)
@@ -21,4 +21,5 @@
 import de.ugoe.cs.swe.exercises.exercise.ExerciseSVN;
 import de.ugoe.cs.swe.exercises.misc.Model;
+import de.ugoe.cs.swe.exercises.settings.Settings;
 import de.ugoe.cs.swe.exercises.settings.SettingsDialog;
 
@@ -38,5 +39,5 @@
 		SettingsDialog settingsDialog = new SettingsDialog(new Shell());
 		/* try{ */
-		if (!settingsDialog.hasSettings())
+		if (!Settings.getInstance().isInitialized())
 			settingsDialog.open();
 		/*
@@ -47,10 +48,11 @@
 		try {
 			DAVRepositoryFactory.setup();
-			SVNURL url = SVNURL
-					.parseURIDecoded(settingsDialog.getSVNLocation());
+			SVNURL url = SVNURL.parseURIDecoded(Settings.getInstance()
+					.getSvnLocation());
 			SVNRepository repository = SVNRepositoryFactory.create(url);
 			ISVNAuthenticationManager authManager = SVNWCUtil
-					.createDefaultAuthenticationManager(settingsDialog
-							.getSVNUsername(), settingsDialog.getSVNPassword());
+					.createDefaultAuthenticationManager(Settings.getInstance()
+							.getSvnUsername(), Settings.getInstance()
+							.getSvnPassword());
 			((SVNRepository) repository).setAuthenticationManager(authManager);
 			repository.testConnection();
@@ -59,11 +61,9 @@
 			try {
 				DAVRepositoryFactory.setup();
-				SVNURL url = SVNURL.parseURIDecoded(settingsDialog
-						.getSVNLocation());
+				SVNURL url = SVNURL.parseURIDecoded(Settings.getInstance().getSvnLocation());
 				SVNRepository repository = SVNRepositoryFactory.create(url);
 				ISVNAuthenticationManager authManager = SVNWCUtil
-						.createDefaultAuthenticationManager(settingsDialog
-								.getSVNUsername(), settingsDialog
-								.getSVNPassword());
+						.createDefaultAuthenticationManager(Settings.getInstance().getSvnUsername(), 
+								Settings.getInstance().getSvnPassword());
 				((SVNRepository) repository)
 						.setAuthenticationManager(authManager);
@@ -74,6 +74,5 @@
 		}
 
-		System.setProperty("javax.net.ssl.trustStorePassword", settingsDialog
-				.getMySQLPassword());
+		System.setProperty("javax.net.ssl.trustStorePassword", Settings.getInstance().getMysqlPassword());
 		String path = Model.class.getProtectionDomain().getCodeSource()
 				.getLocation().getPath();
@@ -87,9 +86,9 @@
 			Class.forName("com.mysql.jdbc.Driver").newInstance();
 			// Step 2: Establish the connection to the database.
-			String url = "jdbc:mysql://" + settingsDialog.getMySQLHost() + "/"
-					+ settingsDialog.getMySQLDb() + "?useSSL="
-					+ String.valueOf(settingsDialog.isMySQLcheckSSL());
-			DriverManager.getConnection(url, settingsDialog
-					.getMySQLUsername(), settingsDialog.getMySQLPassword());
+			String url = "jdbc:mysql://" + Settings.getInstance().getMysqlHost() + "/"
+					+ Settings.getInstance().getMysqlDb() + "?useSSL="
+					+ String.valueOf(Settings.getInstance().isMysqlSSL());
+			DriverManager.getConnection(url, Settings.getInstance().getMysqlUsername(),
+					Settings.getInstance().getMysqlPassword());
 		} catch (SQLException ex) {
 			settingsDialog.open();
@@ -98,10 +97,8 @@
 				Class.forName("com.mysql.jdbc.Driver").newInstance();
 				// Step 2: Establish the connection to the database.
-				String url = "jdbc:mysql://" + settingsDialog.getMySQLHost()
-						+ "/" + settingsDialog.getMySQLDb() + "?useSSL="
-						+ String.valueOf(settingsDialog.isMySQLcheckSSL());
-				DriverManager.getConnection(url,
-						settingsDialog.getMySQLUsername(), settingsDialog
-								.getMySQLPassword());
+				String url = "jdbc:mysql://" + Settings.getInstance().getMysqlHost()
+						+ "/" + Settings.getInstance().getMysqlDb() + "?useSSL="
+						+ String.valueOf(Settings.getInstance().isMysqlSSL());
+				DriverManager.getConnection(url, Settings.getInstance().getMysqlUsername(), Settings.getInstance().getMysqlPassword());
 			} catch (SQLException ex2) {
 				return null;
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercise/Exercise.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercise/Exercise.java	(revision 19)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercise/Exercise.java	(revision 20)
@@ -20,4 +20,5 @@
 import de.ugoe.cs.swe.exercises.lecture.Lecture;
 import de.ugoe.cs.swe.exercises.misc.Model;
+import de.ugoe.cs.swe.exercises.settings.Settings;
 
 public class Exercise extends Model {
@@ -300,5 +301,5 @@
 
 		SVNClientManager ourClientManager = SVNClientManager.newInstance(
-				options, ExerciseSVN.getUserName(), ExerciseSVN.getPassWord());
+				options, Settings.getInstance().getSvnUsername(), Settings.getInstance().getSvnPassword());
 
 		SVNWCClient ourWCClient = new SVNWCClient(ourClientManager, options);
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercise/ExerciseSVN.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercise/ExerciseSVN.java	(revision 19)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercise/ExerciseSVN.java	(revision 20)
@@ -3,5 +3,5 @@
 import java.io.File;
 import java.io.IOException;
-import org.eclipse.swt.widgets.Shell;
+
 import org.tmatesoft.svn.core.SVNCommitInfo;
 import org.tmatesoft.svn.core.SVNDepth;
@@ -19,15 +19,11 @@
 
 import de.ugoe.cs.swe.exercises.misc.FileUtils;
-import de.ugoe.cs.swe.exercises.settings.*;
+import de.ugoe.cs.swe.exercises.settings.Settings;
 
 public class ExerciseSVN {
-	private static SettingsDialog svnSettings = new SettingsDialog(new Shell());
-	private static String url = svnSettings.getSVNLocation();
-	private static String userName = svnSettings.getSVNUsername();
-	private static String passWord = svnSettings.getSVNPassword();
 	public static String SVNpathRev = System.getProperty("user.home") + "/"
-			+ svnSettings.getWorkingDirectory() + "-REVISION";
+			+ Settings.getInstance().getWorkingDirectory() + "-REVISION";
 	public static String SVNpath = System.getProperty("user.home") + "/"
-			+ svnSettings.getWorkingDirectory() + "/";
+			+ Settings.getInstance().getWorkingDirectory() + "/";
 
 	public static void SVNCheckout(int revnumber) {
@@ -38,5 +34,5 @@
 
 		SVNClientManager ourClientManager = SVNClientManager.newInstance(
-				options, userName, passWord);
+				options, Settings.getInstance().getSvnUsername(), Settings.getInstance().getSvnPassword());
 		SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
 
@@ -47,5 +43,5 @@
 		try {
 
-			updateClient.doCheckout(SVNURL.parseURIDecoded(url), dstPath,
+			updateClient.doCheckout(SVNURL.parseURIDecoded(Settings.getInstance().getSvnLocation()), dstPath,
 					SVNRevision.parse(tmp), SVNRevision.parse(tmp),
 					SVNDepth.INFINITY, true);
@@ -62,5 +58,5 @@
 
 		SVNClientManager ourClientManager = SVNClientManager.newInstance(
-				options, userName, passWord);
+				options, Settings.getInstance().getSvnUsername(), Settings.getInstance().getSvnPassword());
 		SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
 
@@ -70,5 +66,5 @@
 
 			updateClient
-					.doCheckout(SVNURL.parseURIDecoded(url), dstPath,
+					.doCheckout(SVNURL.parseURIDecoded(Settings.getInstance().getSvnLocation()), dstPath,
 							SVNRevision.HEAD, SVNRevision.HEAD,
 							SVNDepth.INFINITY, true);
@@ -88,5 +84,5 @@
 
 		SVNClientManager ourClientManager = SVNClientManager.newInstance(
-				options, userName, passWord);
+				options, Settings.getInstance().getSvnUsername(), Settings.getInstance().getSvnPassword());
 
 		SVNCommitClient commitClient = ourClientManager.getCommitClient();
@@ -118,5 +114,5 @@
 
 		SVNClientManager ourClientManager = SVNClientManager.newInstance(
-				options, userName, passWord);
+				options, Settings.getInstance().getSvnUsername(), Settings.getInstance().getSvnPassword());
 
 		SVNWCClient ourWCClient = new SVNWCClient(ourClientManager, options);
@@ -157,5 +153,5 @@
 
 		SVNClientManager ourClientManager = SVNClientManager.newInstance(
-				options, userName, passWord);
+				options, Settings.getInstance().getSvnUsername(), Settings.getInstance().getSvnPassword());
 
 		SVNWCClient ourWCClient = new SVNWCClient(ourClientManager, options);
@@ -178,5 +174,5 @@
 
 		SVNClientManager ourClientManager = SVNClientManager.newInstance(
-				options, userName, passWord);
+				options, Settings.getInstance().getSvnUsername(), Settings.getInstance().getSvnPassword());
 		SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
 
@@ -198,5 +194,5 @@
 
 		SVNClientManager ourClientManager = SVNClientManager.newInstance(
-				options, userName, passWord);
+				options, Settings.getInstance().getSvnUsername(), Settings.getInstance().getSvnPassword());
 		SVNUpdateClient updateClient = ourClientManager.getUpdateClient();
 
@@ -212,28 +208,4 @@
 			e.printStackTrace();
 		}
-	}
-
-	public static void setPassWord(String passWord) {
-		ExerciseSVN.passWord = passWord;
-	}
-
-	public static String getPassWord() {
-		return passWord;
-	}
-
-	public static void setUserName(String userName) {
-		ExerciseSVN.userName = userName;
-	}
-
-	public static String getUserName() {
-		return userName;
-	}
-
-	public static void setUrl(String url) {
-		ExerciseSVN.url = url;
-	}
-
-	public static String getUrl() {
-		return url;
 	}
 
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercise/ViewExercise.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercise/ViewExercise.java	(revision 19)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercise/ViewExercise.java	(revision 20)
@@ -4,22 +4,5 @@
 import java.util.ArrayList;
 import java.util.Iterator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.FileStoreEditorInput;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
+
 import org.eclipse.core.filesystem.EFS;
 import org.eclipse.core.filesystem.IFileStore;
@@ -29,14 +12,31 @@
 import org.eclipse.jface.viewers.StructuredSelection;
 import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.SashForm;
 import org.eclipse.swt.events.KeyAdapter;
 import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.FileStoreEditorInput;
+import org.eclipse.ui.part.ViewPart;
+
 import de.ugoe.cs.swe.exercises.lecture.Lecture;
 import de.ugoe.cs.swe.exercises.lecture.LectureLabelProvider;
 import de.ugoe.cs.swe.exercises.misc.CKeyword;
 import de.ugoe.cs.swe.exercises.misc.KeywordLabelProvider;
-import de.ugoe.cs.swe.exercises.settings.SettingsDialog;
-
-import org.eclipse.swt.custom.SashForm;
+import de.ugoe.cs.swe.exercises.settings.Settings;
 
 public class ViewExercise extends ViewPart {
@@ -279,9 +279,8 @@
 			@Override
 			public void widgetSelected(SelectionEvent e) {
-				SettingsDialog settings = new SettingsDialog(new Shell());
 				PlatformUI.getWorkbench().getActiveWorkbenchWindow()
 						.getActivePage().setEditorAreaVisible(true);
 				File file = new File(System.getProperty("user.home") + "/"
-						+ settings.getWorkingDirectory() + "/exercises/"
+						+ Settings.getInstance().getWorkingDirectory() + "/exercises/"
 						+ String.valueOf(selected.getId()) + "solution.tex");
 				if (file != null) {
@@ -301,5 +300,5 @@
 
 				file = new File(String.valueOf(System.getProperty("user.home")
-						+ "/" + settings.getWorkingDirectory() + "/exercises/"
+						+ "/" + Settings.getInstance().getWorkingDirectory() + "/exercises/"
 						+ selected.getId())
 						+ ".tex");
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercisesheet/ExerciseSheet.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercisesheet/ExerciseSheet.java	(revision 19)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercisesheet/ExerciseSheet.java	(revision 20)
@@ -18,4 +18,5 @@
 import de.ugoe.cs.swe.exercises.lectureevent.LectureEvent;
 import de.ugoe.cs.swe.exercises.misc.Model;
+import de.ugoe.cs.swe.exercises.settings.Settings;
 
 public class ExerciseSheet extends Model {
@@ -297,5 +298,5 @@
 
 		SVNClientManager ourClientManager = SVNClientManager.newInstance(
-				options, ExerciseSVN.getUserName(), ExerciseSVN.getPassWord());
+				options, Settings.getInstance().getSvnUsername(), Settings.getInstance().getSvnPassword());
 
 		SVNWCClient ourWCClient = new SVNWCClient(ourClientManager, options);
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercisesheet/PdfGenerator.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercisesheet/PdfGenerator.java	(revision 19)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/exercisesheet/PdfGenerator.java	(revision 20)
@@ -18,5 +18,4 @@
 
 import org.eclipse.jface.util.Util;
-import org.eclipse.swt.widgets.Shell;
 
 import de.ugoe.cs.swe.exercises.exercise.Exercise;
@@ -25,5 +24,5 @@
 import de.ugoe.cs.swe.exercises.lecturer.Lecturer;
 import de.ugoe.cs.swe.exercises.misc.FileUtils;
-import de.ugoe.cs.swe.exercises.settings.SettingsDialog;
+import de.ugoe.cs.swe.exercises.settings.Settings;
 
 public class PdfGenerator {
@@ -35,13 +34,12 @@
 			path += ".pdf";
 
-		SettingsDialog settings = new SettingsDialog(new Shell());
 		ArrayList<String> cmdList = new ArrayList<String>();
 
-		String cmd = "\"" + settings.getmyPDFLatexPath() + "\""
+		String cmd = "\"" + Settings.getInstance().getPdfLatexPath() + "\""
 				+ " -halt-on-error -output-directory=\"";
 		try {
 			File latexFile = File.createTempFile("exercise", ".tex");
 
-			cmdList.add(settings.getmyPDFLatexPath());
+			cmdList.add(Settings.getInstance().getPdfLatexPath());
 			cmdList.add("-halt-on-error");
 			cmdList.add("-output-directory=" + latexFile.getParent());
@@ -140,7 +138,7 @@
 					+ Matcher.quoteReplacement(dueDateString) + "$2");
 			template = template.replaceAll("(\\W)RESEARCHGROUP(\\W)", "$1"
-					+ Matcher.quoteReplacement(settings.getMyResearchGroup()) + "$2");
+					+ Matcher.quoteReplacement(Settings.getInstance().getResearchGroup()) + "$2");
 			template = template.replaceAll("(\\W)RESEARCHGROUPURL(\\W)", "$1"
-					+ Matcher.quoteReplacement(settings.getMyResearchGroupUrl()) + "$2");
+					+ Matcher.quoteReplacement(Settings.getInstance().getResearchGroupUrl()) + "$2");
 
 			// write temporary .tex file to temp directory
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/misc/Model.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/misc/Model.java	(revision 19)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/misc/Model.java	(revision 20)
@@ -2,18 +2,15 @@
 
 import java.sql.Connection;
-import java.sql.SQLException;
-
 import java.sql.DatabaseMetaData;
 import java.sql.DriverManager;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
+import java.sql.SQLException;
 import java.sql.Statement;
-import org.eclipse.swt.widgets.Shell;
 
 import de.ugoe.cs.swe.exercises.exercise.Exercise;
-import de.ugoe.cs.swe.exercises.settings.*;
+import de.ugoe.cs.swe.exercises.settings.Settings;
 
 public abstract class Model {
-	private static SettingsDialog mysqlSettings = new SettingsDialog(new Shell());
 	public static int UNDEFINED = -1;
 	private int id = Model.UNDEFINED;
@@ -37,5 +34,5 @@
 		// connect to DB
 		// -Djavax.net.ssl.trustStorePassword=datenbank -Djavax.net.ssl.trustStore=${project_loc}/keystore
-		System.setProperty("javax.net.ssl.trustStorePassword", mysqlSettings.getMySQLPassword());
+		System.setProperty("javax.net.ssl.trustStorePassword", Settings.getInstance().getMysqlPassword());
         String path = Model.class.getProtectionDomain().getCodeSource().getLocation().getPath();
         if (path.endsWith("bin/"))
@@ -52,8 +49,8 @@
 				// Step 2: Establish the connection to the database.
 				//System.out.println("jdbc:mysql://" + mysqlSettings.getMySQLHost() + "/" + mysqlSettings.getMySQLDb() + "test?useSSL="+mysqlSettings.isMySQLcheckSSL());
-				String url = "jdbc:mysql://" + mysqlSettings.getMySQLHost() + "/" + mysqlSettings.getMySQLDb() + "test";//?useSSL="+mysqlSettings.isMySQLcheckSSL();
+				String url = "jdbc:mysql://" + Settings.getInstance().getMysqlHost() + "/" + Settings.getInstance().getMysqlDb() + "test";//?useSSL="+mysqlSettings.isMySQLcheckSSL();
 
-				Connection conn = DriverManager.getConnection(url, mysqlSettings.getMySQLUsername(),
-						mysqlSettings.getMySQLPassword());
+				Connection conn = DriverManager.getConnection(url, Settings.getInstance().getMysqlUsername(),
+						Settings.getInstance().getMysqlPassword());
 				System.out.println("Connection successful");
 				//url.wait(500);
@@ -69,7 +66,7 @@
 
 				// Step 2: Establish the connection to the database.
-				String url = "jdbc:mysql://" + mysqlSettings.getMySQLHost() + "/" + mysqlSettings.getMySQLDb() + "?useSSL="+mysqlSettings.isMySQLcheckSSL();
-				Connection conn = DriverManager.getConnection(url, mysqlSettings.getMySQLUsername(),
-						mysqlSettings.getMySQLPassword());
+				String url = "jdbc:mysql://" + Settings.getInstance().getMysqlHost() + "/" + Settings.getInstance().getMysqlDb() + "?useSSL="+Settings.getInstance().isMysqlSSL();
+				Connection conn = DriverManager.getConnection(url, Settings.getInstance().getMysqlUsername(),
+						Settings.getInstance().getMysqlPassword());
 				return conn;
 			} catch (Exception e) {
@@ -157,5 +154,5 @@
 			DatabaseMetaData metaData;
 			metaData = Model.getConnection().getMetaData();
-			ResultSet rs = metaData.getTables(mysqlSettings.getMySQLDb()+"test", null, null, null);
+			ResultSet rs = metaData.getTables(Settings.getInstance().getMysqlDb()+"test", null, null, null);
 			PreparedStatement statement;
 			while (rs.next()) {
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/Settings.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/Settings.java	(revision 19)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/Settings.java	(revision 20)
@@ -1,19 +1,134 @@
 package de.ugoe.cs.swe.exercises.settings;
 
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
+public class Settings {
+	private String svnLocation;
+	private String workingDirectory;
+	private String svnUsername;
+	private String svnPassword;
+	private String mysqlHost;
+	private String mysqlDb;
+	private String mysqlUsername;
+	private String mysqlPassword;
+	private String pdfLatexPath;
+	private String researchGroup;
+	private String researchGroupUrl;
+	private boolean mysqlSSL = false;
+	private static Settings settings;
 
-public class Settings extends AbstractHandler {
+	private Settings() {
+	}
 
-	@Override
-	public Object execute(ExecutionEvent event) throws ExecutionException {
-		IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
-		SettingsDialog dialog = new SettingsDialog(window.getShell());
-		dialog.setTitle("Settings");
-		dialog.open();
-		return null;
+	public static Settings getInstance() {
+		if (settings == null)
+			settings = new Settings();
+
+		return settings;
+	}
+
+	public boolean isInitialized() {
+		if (svnLocation == "" || workingDirectory == "" || svnUsername == ""
+				|| svnPassword == "" || mysqlHost == "" || mysqlDb == ""
+				|| mysqlUsername == "" || mysqlPassword == ""
+				|| pdfLatexPath == "") {
+			return false;
+		}
+		return true;
+
+	}
+
+	public String getSvnLocation() {
+		return svnLocation;
+	}
+
+	public void setSvnLocation(String svnLocation) {
+		this.svnLocation = svnLocation;
+	}
+
+	public String getWorkingDirectory() {
+		return workingDirectory;
+	}
+
+	public void setWorkingDirectory(String workingDirectory) {
+		this.workingDirectory = workingDirectory;
+	}
+
+	public String getSvnUsername() {
+		return svnUsername;
+	}
+
+	public void setSvnUsername(String svnUsername) {
+		this.svnUsername = svnUsername;
+	}
+
+	public String getSvnPassword() {
+		return svnPassword;
+	}
+
+	public void setSvnPassword(String svnPassword) {
+		this.svnPassword = svnPassword;
+	}
+
+	public String getMysqlHost() {
+		return mysqlHost;
+	}
+
+	public void setMysqlHost(String mysqlHost) {
+		this.mysqlHost = mysqlHost;
+	}
+
+	public String getMysqlDb() {
+		return mysqlDb;
+	}
+
+	public void setMysqlDb(String mysqlDb) {
+		this.mysqlDb = mysqlDb;
+	}
+
+	public String getMysqlUsername() {
+		return mysqlUsername;
+	}
+
+	public void setMysqlUsername(String mysqlUsername) {
+		this.mysqlUsername = mysqlUsername;
+	}
+
+	public String getMysqlPassword() {
+		return mysqlPassword;
+	}
+
+	public void setMysqlPassword(String mysqlPassword) {
+		this.mysqlPassword = mysqlPassword;
+	}
+
+	public String getPdfLatexPath() {
+		return pdfLatexPath;
+	}
+
+	public void setPdfLatexPath(String pdfLatexPath) {
+		this.pdfLatexPath = pdfLatexPath;
+	}
+
+	public String getResearchGroup() {
+		return researchGroup;
+	}
+
+	public void setResearchGroup(String researchGroup) {
+		this.researchGroup = researchGroup;
+	}
+
+	public String getResearchGroupUrl() {
+		return researchGroupUrl;
+	}
+
+	public void setResearchGroupUrl(String researchGroupUrl) {
+		this.researchGroupUrl = researchGroupUrl;
+	}
+
+	public boolean isMysqlSSL() {
+		return mysqlSSL;
+	}
+
+	public void setMysqlSSL(boolean mysqlSSL) {
+		this.mysqlSSL = mysqlSSL;
 	}
 
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsDialog.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsDialog.java	(revision 19)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsDialog.java	(revision 20)
@@ -49,70 +49,4 @@
 	private Text textResearchGroupUrl;
 	private Combo cboUseSSL;
-	private String svnLocation = "";
-	private String workingDirectory = "";
-	private String svnUsername = "";
-	private String svnPassword = "";
-	private String mySQLHost = "";
-	private String mySQLDb = "";
-	private String mySQLUsername = "";
-	private String mySQLPassword = "";
-	private String myPDFLatexPath = "";
-	private String myResearchGroup = "";
-	private String myResearchGroupUrl = "";
-	private boolean mySQLcheckSSL = false;
-
-	public boolean hasSettings() {
-		if (svnLocation == "" || workingDirectory == "" || svnUsername == ""
-				|| svnPassword == "" || mySQLHost == "" || mySQLDb == ""
-				|| mySQLUsername == "" || mySQLPassword == ""
-				|| myPDFLatexPath == "") {
-			return false;
-		}
-		return true;
-	}
-
-	public String getmyPDFLatexPath() {
-		return myPDFLatexPath;
-	}
-
-	public void setmyPDFLatexPath(String myPDFLatexPath) {
-		this.myPDFLatexPath = myPDFLatexPath;
-	}
-
-	public String getSVNLocation() {
-		return svnLocation;
-	}
-
-	public String getWorkingDirectory() {
-		return workingDirectory;
-	}
-
-	public String getSVNUsername() {
-		return svnUsername;
-	}
-
-	public String getSVNPassword() {
-		return svnPassword;
-	}
-
-	public String getMySQLHost() {
-		return mySQLHost;
-	}
-
-	public String getMySQLDb() {
-		return mySQLDb;
-	}
-
-	public String getMySQLUsername() {
-		return mySQLUsername;
-	}
-
-	public String getMySQLPassword() {
-		return mySQLPassword;
-	}
-
-	public boolean isMySQLcheckSSL() {
-		return mySQLcheckSSL;
-	}
 
 	public SettingsDialog(Shell parentShell) {
@@ -220,20 +154,21 @@
 				GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
 
-		if (mySQLcheckSSL)
+		Settings settings = Settings.getInstance();
+		if (settings.isMysqlSSL())
 			cboUseSSL.select(1);
 		else
 			cboUseSSL.select(0);
 
-		textSVNLocation.setText(svnLocation);
-		textWorkingDirectory.setText(workingDirectory);
-		textSVNUsername.setText(svnUsername);
-		textSVNPassword.setText(svnPassword);
-		textMySQLHost.setText(mySQLHost);
-		textMySQLDb.setText(mySQLDb);
-		textMySQLUsername.setText(mySQLUsername);
-		textMySQLPassword.setText(mySQLPassword);
-		textPdflatex.setText(myPDFLatexPath);
-		textResearchGroup.setText(myResearchGroup);
-		textResearchGroupUrl.setText(myResearchGroupUrl);
+		textSVNLocation.setText(settings.getSvnLocation());
+		textWorkingDirectory.setText(settings.getWorkingDirectory());
+		textSVNUsername.setText(settings.getSvnUsername());
+		textSVNPassword.setText(settings.getSvnPassword());
+		textMySQLHost.setText(settings.getMysqlHost());
+		textMySQLDb.setText(settings.getMysqlDb());
+		textMySQLUsername.setText(settings.getMysqlUsername());
+		textMySQLPassword.setText(settings.getMysqlPassword());
+		textPdflatex.setText(settings.getPdfLatexPath());
+		textResearchGroup.setText(settings.getResearchGroup());
+		textResearchGroupUrl.setText(settings.getResearchGroupUrl());
 
 		GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
@@ -261,29 +196,32 @@
 						&& textSVNUsername.getText().length() != 0
 						&& textSVNPassword.getText().length() != 0) {
-					svnLocation = textSVNLocation.getText();
-					workingDirectory = textWorkingDirectory.getText();
-					svnUsername = textSVNUsername.getText();
-					svnPassword = textSVNPassword.getText();
-					mySQLHost = textMySQLHost.getText();
-					mySQLDb = textMySQLDb.getText();
-					mySQLUsername = textMySQLUsername.getText();
-					mySQLPassword = textMySQLPassword.getText();
-					myPDFLatexPath = textPdflatex.getText();
-					myResearchGroup = textResearchGroup.getText();
-					myResearchGroupUrl = textResearchGroupUrl.getText();
-
+		
+					Settings settings = Settings.getInstance();
+					
+					settings.setSvnLocation(textSVNLocation.getText());
+					settings.setWorkingDirectory(textWorkingDirectory.getText());
+					settings.setSvnUsername(textSVNUsername.getText());
+					settings.setSvnPassword(textSVNPassword.getText());
+					settings.setMysqlHost(textMySQLHost.getText());
+					settings.setMysqlDb(textMySQLDb.getText());
+					settings.setMysqlUsername(textMySQLUsername.getText());
+					settings.setMysqlPassword(textMySQLPassword.getText());
+					settings.setPdfLatexPath(textPdflatex.getText());
+					settings.setResearchGroup(textResearchGroup.getText());
+					settings.setResearchGroupUrl(textResearchGroupUrl.getText());
+					
 					if (cboUseSSL.getSelectionIndex() == 1)
-						mySQLcheckSSL = true;
+						settings.setMysqlSSL(true);
 					else
-						mySQLcheckSSL = false;
+						settings.setMysqlSSL(false);
 
 					try {
 						DAVRepositoryFactory.setup();
-						SVNURL url = SVNURL.parseURIDecoded(svnLocation);
+						SVNURL url = SVNURL.parseURIDecoded(settings.getSvnLocation());
 						SVNRepository repository = SVNRepositoryFactory
 								.create(url);
 						ISVNAuthenticationManager authManager = SVNWCUtil
 								.createDefaultAuthenticationManager(
-										svnUsername, svnPassword);
+										settings.getSvnUsername(), settings.getSvnPassword());
 						((SVNRepository) repository)
 								.setAuthenticationManager(authManager);
@@ -296,5 +234,5 @@
 
 					System.setProperty("javax.net.ssl.trustStorePassword",
-							mySQLPassword);
+							settings.getMysqlPassword());
 					String path = Model.class.getProtectionDomain()
 							.getCodeSource().getLocation().getPath();
@@ -308,9 +246,9 @@
 						Class.forName("com.mysql.jdbc.Driver").newInstance();
 						// Step 2: Establish the connection to the database.
-						String url = "jdbc:mysql://" + mySQLHost + "/"
-								+ mySQLDb + "?useSSL="
-								+ String.valueOf(mySQLcheckSSL);
-						DriverManager.getConnection(url, mySQLUsername,
-								mySQLPassword);
+						String url = "jdbc:mysql://" + settings.getMysqlHost() + "/"
+								+ settings.getMysqlDb() + "?useSSL="
+								+ String.valueOf(settings.isMysqlSSL());
+						DriverManager.getConnection(url, settings.getMysqlUsername(),
+								settings.getMysqlPassword());
 					} catch (SQLException ex) {
 						setErrorMessage(ex.getMessage());
@@ -340,23 +278,10 @@
 
 	private void getFileContents() {
-		Properties settings = new Properties();
+		Properties properties = new Properties();
 		File file = new File(System.getProperty("user.home")
 				+ "/.exerciseSettings");
-		if (!file.exists()) {
-			svnLocation = "";
-			workingDirectory = "";
-			svnUsername = "";
-			svnPassword = "";
-			mySQLHost = "";
-			mySQLDb = "";
-			mySQLUsername = "";
-			mySQLPassword = "";
-			mySQLcheckSSL = false;
-			myPDFLatexPath = "";
-			myResearchGroup = "";
-			myResearchGroupUrl = "";
-		} else {
+		if (file.exists()) {
 			try {
-				settings.load(new FileInputStream(file));
+				properties.load(new FileInputStream(file));
 			} catch (FileNotFoundException e) {
 				e.printStackTrace();
@@ -365,44 +290,19 @@
 			}
 			try {
-				if (settings.getProperty("svnLocation") != null)
-					svnLocation = settings.getProperty("svnLocation");
-				if (settings.getProperty("workingDirectory") != null)
-					workingDirectory = settings.getProperty("workingDirectory");
-				if (settings.getProperty("svnUsername") != null)
-					svnUsername = settings.getProperty("svnUsername");
-				if (settings.getProperty("svnPassword") != null)
-					svnPassword = settings.getProperty("svnPassword");
-				if (settings.getProperty("mySQLHost") != null)
-					mySQLHost = settings.getProperty("mySQLHost");
-				if (settings.getProperty("mySQLDb") != null)
-					mySQLDb = settings.getProperty("mySQLDb");
-				if (settings.getProperty("mySQLUsername") != null)
-					mySQLUsername = settings.getProperty("mySQLUsername");
-				if (settings.getProperty("mySQLPassword") != null)
-					mySQLPassword = settings.getProperty("mySQLPassword");
-				if (settings.getProperty("mySQLcheckSSL") != null)
-					mySQLcheckSSL = Boolean.parseBoolean(settings
-							.getProperty("mySQLcheckSSL"));
-				if (settings.getProperty("mySQLcheckSSL") != null)
-					myPDFLatexPath = settings.getProperty("myPDFLatexPath");
-				if (settings.getProperty("myResearchGroup") != null)
-					myResearchGroup = settings.getProperty("myResearchGroup");
-				if (settings.getProperty("myResearchGroupUrl") != null)
-					myResearchGroupUrl = settings
-							.getProperty("myResearchGroupUrl");
-
+				Settings settings = Settings.getInstance();
+				settings.setSvnLocation(properties.getProperty("svnLocation"));
+				settings.setWorkingDirectory(properties.getProperty("workingDirectory"));
+				settings.setSvnUsername(properties.getProperty("svnUsername"));
+				settings.setSvnPassword(properties.getProperty("svnPassword"));
+				settings.setMysqlHost(properties.getProperty("mySQLHost"));
+				settings.setMysqlDb(properties.getProperty("mySQLDb"));
+				settings.setMysqlUsername(properties.getProperty("mySQLUsername"));
+				settings.setMysqlPassword(properties.getProperty("mySQLPassword"));
+				settings.setMysqlSSL(Boolean.parseBoolean(properties
+						.getProperty("mySQLcheckSSL")));
+				settings.setPdfLatexPath(properties.getProperty("pdfLatexPath"));
+				settings.setResearchGroup(properties.getProperty("researchGroup"));
+				settings.setResearchGroupUrl(properties.getProperty("researchGroupUrl"));
 			} catch (Exception ex) {
-				svnLocation = "";
-				workingDirectory = "";
-				svnUsername = "";
-				svnPassword = "";
-				mySQLHost = "";
-				mySQLDb = "";
-				mySQLUsername = "";
-				mySQLPassword = "";
-				mySQLcheckSSL = false;
-				myPDFLatexPath = "";
-				myResearchGroup = "";
-				myResearchGroupUrl = "";
 			}
 		}
@@ -410,5 +310,5 @@
 
 	private void setFileContents() {
-		Properties settings = new Properties();
+		Properties properties = new Properties();
 		File file = new File(System.getProperty("user.home")
 				+ "/.exerciseSettings");
@@ -421,20 +321,21 @@
 			}
 		}
-
-		settings.setProperty("svnLocation", svnLocation);
-		settings.setProperty("workingDirectory", workingDirectory);
-		settings.setProperty("svnUsername", svnUsername);
-		settings.setProperty("svnPassword", svnPassword);
-		settings.setProperty("mySQLHost", mySQLHost);
-		settings.setProperty("mySQLDb", mySQLDb);
-		settings.setProperty("mySQLUsername", mySQLUsername);
-		settings.setProperty("mySQLPassword", mySQLPassword);
-		settings.setProperty("mySQLcheckSSL", String.valueOf(mySQLcheckSSL));
-		settings.setProperty("myPDFLatexPath", myPDFLatexPath);
-		settings.setProperty("myResearchGroup", myResearchGroup);
-		settings.setProperty("myResearchGroupUrl", myResearchGroupUrl);
+		Settings settings = Settings.getInstance();
+
+		properties.setProperty("svnLocation", settings.getSvnLocation());
+		properties.setProperty("workingDirectory", settings.getWorkingDirectory());
+		properties.setProperty("svnUsername", settings.getSvnUsername());
+		properties.setProperty("svnPassword", settings.getSvnPassword());
+		properties.setProperty("mySQLHost", settings.getMysqlHost());
+		properties.setProperty("mySQLDb", settings.getMysqlDb());
+		properties.setProperty("mySQLUsername", settings.getMysqlUsername());
+		properties.setProperty("mySQLPassword", settings.getMysqlPassword());
+		properties.setProperty("mySQLcheckSSL", String.valueOf(settings.isMysqlSSL()));
+		properties.setProperty("pdfLatexPath", settings.getPdfLatexPath());
+		properties.setProperty("researchGroup", settings.getResearchGroup());
+		properties.setProperty("researchGroupUrl", settings.getResearchGroupUrl());
 
 		try {
-			settings.store(new FileOutputStream(file),
+			properties.store(new FileOutputStream(file),
 					"SVN and other Settings included");
 		} catch (FileNotFoundException e) {
@@ -445,11 +346,3 @@
 	}
 
-	public String getMyResearchGroup() {
-		return myResearchGroup;
-	}
-
-	public String getMyResearchGroupUrl() {
-		return myResearchGroupUrl;
-	}
-
 }
Index: /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsHandler.java
===================================================================
--- /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsHandler.java	(revision 20)
+++ /trunk/de.ugoe.cs.swe.exercises/src/de/ugoe/cs/swe/exercises/settings/SettingsHandler.java	(revision 20)
@@ -0,0 +1,20 @@
+package de.ugoe.cs.swe.exercises.settings;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.handlers.HandlerUtil;
+
+public class SettingsHandler extends AbstractHandler {
+
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
+		SettingsDialog dialog = new SettingsDialog(window.getShell());
+		dialog.setTitle("Settings");
+		dialog.open();
+		return null;
+	}
+
+}
