[Schmitzm-commits] r1558 - trunk/schmitzm-core/src/test/java/de/schmitzm/testing

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Apr 18 14:13:29 CEST 2011


Author: alfonx
Date: 2011-04-18 14:13:29 +0200 (Mon, 18 Apr 2011)
New Revision: 1558

Modified:
   trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingUtil.java
Log:


Modified: trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingUtil.java
===================================================================
--- trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingUtil.java	2011-04-18 11:27:36 UTC (rev 1557)
+++ trunk/schmitzm-core/src/test/java/de/schmitzm/testing/TestingUtil.java	2011-04-18 12:13:29 UTC (rev 1558)
@@ -4,6 +4,7 @@
 
 import java.awt.Color;
 import java.awt.Component;
+import java.awt.Desktop;
 import java.awt.Dialog.ModalExclusionType;
 import java.awt.GraphicsEnvironment;
 import java.awt.Image;
@@ -253,4 +254,16 @@
 		assertTrue(file.mkdir());
 		return file;
 	}
+
+	/**
+	 * Wenn Desktop supported, und GUI available, dann die Datei öffnen. z.B.
+	 * eine .xls mit OpenOffice
+	 * 
+	 * @throws IOException
+	 */
+	public static void open(File file) throws IOException {
+		if (hasGui() && Desktop.isDesktopSupported()) {
+			Desktop.getDesktop().open(file);
+		}
+	}
 }



More information about the Schmitzm-commits mailing list