Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAchim Loerke2011-01-13 05:17:12 -0500
committerAchim Loerke2011-01-13 05:17:12 -0500
commit2615336c69753f4ea10fc012bf2bb67eb96ab064 (patch)
treeda50e4562678e6021ce4e150dca2231dd5392c26 /org.eclipse.jubula.examples.aut.dvdtool
parent2bc525c7989ba89477ec7ee9014d64ed1c3ad56e (diff)
downloadorg.eclipse.jubula.core-2615336c69753f4ea10fc012bf2bb67eb96ab064.tar.gz
org.eclipse.jubula.core-2615336c69753f4ea10fc012bf2bb67eb96ab064.tar.xz
org.eclipse.jubula.core-2615336c69753f4ea10fc012bf2bb67eb96ab064.zip
Initial contribution
Diffstat (limited to 'org.eclipse.jubula.examples.aut.dvdtool')
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/.checkstyle7
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/.classpath6
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/.gitignore2
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/.project23
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/about.html28
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/buildScript.xml64
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/resources/launcher/DVDTool.cmd3
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/resources/launcher/DVDTool.sh13
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/DVDTool.java42
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAbstractDialogAction.java77
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddCategoryAction.java43
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddDvdAction.java50
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddLanguageAction.java44
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdChangeTabSelectionAction.java55
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdClearDescriptionAction.java53
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyBonusValueToClipboardAction.java65
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyChapterLabelToClipboardAction.java62
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyChapterTextToClipboardAction.java44
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk16RadioButtonToClipboardAction.java45
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk18RadioButtonToClipboardAction.java45
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk6RadioButtonToClipboardAction.java45
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyRadioButtonToClipboardAction.java76
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyTextToClipboardAction.java75
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdDisableOrEnableCategoryAction.java55
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdExitAction.java88
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdInfoAction.java53
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdLabelPlacementAction.java54
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdListTransferHandler.java66
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdMainFrameController.java988
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdManager.java243
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdOpenAction.java100
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveCategoryAction.java79
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveDvdAction.java46
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveLanguageAction.java46
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdSaveAction.java74
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdShowWaitingDialogAction.java99
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTabPlacementAction.java53
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTableController.java284
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTableTransferHandler.java57
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeController.java445
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeDragSource.java127
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeDropTarget.java208
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/PopupListener.java65
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/StringArrayTransferHandler.java89
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/StringTransferHandler.java87
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/exception/DvdException.java41
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/Constants.java44
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdContentPanel.java197
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdDialogs.java133
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdFileChooser.java100
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdMainFrame.java544
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTableModel.java175
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTechMainPanel.java75
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTechPanel.java128
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTreeCellRenderer.java68
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTreePanel.java58
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/EvenOddTableCellRenderer.java129
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/Dvd.java311
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdCategory.java235
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdDataObject.java148
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdGuiConfiguration.java64
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdTransferableCategory.java103
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/StringArraySelection.java95
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdInvalidContentException.java29
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdInvalidObjectException.java29
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdPersistenceException.java31
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdPersistenceManager.java173
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/Resources.java142
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/messages.properties103
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/messages_de.properties103
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/resources/category.gifbin0 -> 967 bytes
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvd.jpgbin0 -> 3196 bytes
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvdtool.html10
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvdtool_de.html10
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/resources/empty_category.gifbin0 -> 902 bytes
-rw-r--r--org.eclipse.jubula.examples.aut.dvdtool/src/resources/icon.gifbin0 -> 1181 bytes
77 files changed, 7663 insertions, 0 deletions
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/.checkstyle b/org.eclipse.jubula.examples.aut.dvdtool/.checkstyle
new file mode 100644
index 000000000..0afff8669
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/.checkstyle
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+ <fileset name="all" enabled="true" check-config-name="Jubula" local="false">
+ <file-match-pattern match-pattern="." include-pattern="true"/>
+ </fileset>
+</fileset-config>
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/.classpath b/org.eclipse.jubula.examples.aut.dvdtool/.classpath
new file mode 100644
index 000000000..bed49dfc0
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/.classpath
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.4"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/.gitignore b/org.eclipse.jubula.examples.aut.dvdtool/.gitignore
new file mode 100644
index 000000000..348c102af
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/.gitignore
@@ -0,0 +1,2 @@
+/build
+/bin
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/.project b/org.eclipse.jubula.examples.aut.dvdtool/.project
new file mode 100644
index 000000000..52b369205
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.jubula.examples.aut.dvdtool</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.jubula.examples.aut.dvdtool/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..3b4ff4bcf
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,12 @@
+#Mon Feb 23 14:21:39 CET 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.4
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/about.html b/org.eclipse.jubula.examples.aut.dvdtool/about.html
new file mode 100644
index 000000000..8728d9a97
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 28, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/buildScript.xml b/org.eclipse.jubula.examples.aut.dvdtool/buildScript.xml
new file mode 100644
index 000000000..a1a627d00
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/buildScript.xml
@@ -0,0 +1,64 @@
+<!--
+ Copyright (c) 2004, 2010 BREDEX GmbH.
+ All rights reserved. This program and the accompanying materials
+ are made available under the terms of the Eclipse Public License v1.0
+ which accompanies this distribution, and is available at
+ http://www.eclipse.org/legal/epl-v10.html
+ -->
+<project name="DVDTool" basedir="." default="build">
+
+ <!-- properties -->
+ <property name="srcdir" value="src"/>
+ <property name="resourcedir" value="resources"/>
+ <property name="build" value="build"/>
+ <property name="classes" value="${build}/classes/DVD" />
+ <property name="jars" value="${build}/jars"/>
+ <property name="javac.debug" value="off"/>
+ <property name="lib" value="lib"/>
+
+ <!-- internal properties -->
+ <property name="app.name" value="DVDTool" />
+ <property name="javac" value="javac"/>
+
+ <!-- compilation -->
+ <target name="compile" depends="clean, mkdir" description="compile">
+ <javac srcdir="${srcdir}"
+ destdir="${classes}"
+ includes="**/*.java"
+ excludes="**/test/*"
+ source="1.4"
+ target="1.4"
+ debug="${javac.debug}"
+ fork="true"
+ executable="${javac}"/>
+ </target>
+
+ <!-- create directories, if not existing -->
+ <target name="mkdir">
+ <mkdir dir="${build}"/>
+ <mkdir dir="${classes}"/>
+ <mkdir dir="${jars}"/>
+ </target>
+
+ <!-- cleaning -->
+ <target name="clean" description="clean">
+ <delete dir="${build}"/>
+ </target>
+
+ <!-- create a jar -->
+ <target name="build" depends="compile">
+ <jar basedir="${classes}" destfile="${jars}/${app.name}.jar">
+ <fileset dir="${srcdir}"
+ includes="**/*"
+ excludes="**/*.java"
+ />
+ <fileset dir="${srcdir}"
+ includes="${resourcedir}/*"
+ />
+ <manifest>
+ <attribute name="Main-Class" value="org.eclipse.jubula.examples.aut.dvdtool.DVDTool"/>
+ </manifest>
+ </jar>
+ </target>
+</project>
+
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/resources/launcher/DVDTool.cmd b/org.eclipse.jubula.examples.aut.dvdtool/resources/launcher/DVDTool.cmd
new file mode 100644
index 000000000..cc7f29633
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/resources/launcher/DVDTool.cmd
@@ -0,0 +1,3 @@
+@echo off
+
+..\..\..\jre\bin\javaw -jar DVDTool.jar
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/resources/launcher/DVDTool.sh b/org.eclipse.jubula.examples.aut.dvdtool/resources/launcher/DVDTool.sh
new file mode 100644
index 000000000..bb881e923
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/resources/launcher/DVDTool.sh
@@ -0,0 +1,13 @@
+#*******************************************************************************
+# Copyright (c) 2004, 2010 BREDEX GmbH.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+# BREDEX GmbH - initial API and implementation and/or initial documentation
+#*******************************************************************************
+#! /bin/sh
+
+../../../jre/bin/java -jar ./DVDTool.jar \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/DVDTool.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/DVDTool.java
new file mode 100644
index 000000000..62aed4f3e
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/DVDTool.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool;
+
+import org.eclipse.jubula.examples.aut.dvdtool.control.DvdMainFrameController;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdMainFrame;
+
+
+/**
+ * This is the main class of the dvd tool.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DVDTool {
+
+ /**
+ * private constructor, do not instantiate this class
+ */
+ private DVDTool() {
+ // empty
+ }
+
+ /**
+ * main method
+ * @param args the given arguments, if any
+ */
+ public static void main(String[] args) {
+ DvdMainFrame frame = new DvdMainFrameController().getDvdMainFrame();
+ frame.setLocation(100, 90);
+ frame.pack();
+ frame.show();
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAbstractDialogAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAbstractDialogAction.java
new file mode 100644
index 000000000..adcf4b902
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAbstractDialogAction.java
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdDialogs;
+
+
+/**
+ * This is the base class for action classes using dialogs.
+ *
+ * @author BREDEX GmbH
+ * @created 18.02.2008
+ */
+public abstract class DvdAbstractDialogAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /** the key of message to display in the dialog */
+ private transient String m_dialogMessageKey;
+
+ /**
+ * public constructor
+ * @param name the text to display for the action
+ * @param controller the controller of the main frame
+ * @param dialogMessageKey the key of message to display in the dialog
+ */
+ public DvdAbstractDialogAction(String name,
+ DvdMainFrameController controller, String dialogMessageKey) {
+ super(name);
+ m_controller = controller;
+ m_dialogMessageKey = dialogMessageKey;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public final void actionPerformed(ActionEvent e) {
+ boolean done = false;
+ while (!done) {
+ // ask for input
+ String inputValue = DvdDialogs.getInput(m_controller
+ .getDvdMainFrame(), m_dialogMessageKey);
+
+ if (inputValue != null) {
+ inputValue = inputValue.trim();
+ if (inputValue.equals("")) { //$NON-NLS-1$
+ continue;
+ }
+ done = true;
+ handleDialogInput(inputValue);
+ } else {
+ done = true;
+ }
+ }
+ }
+
+ /**
+ * Handles the input value from the dialog.
+ *
+ * @param inputValue the value that was entered in the dialog
+ */
+ public abstract void handleDialogInput(String inputValue);
+
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddCategoryAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddCategoryAction.java
new file mode 100644
index 000000000..de38f489f
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddCategoryAction.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+
+/**
+ * This is the action class for adding a category
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdAddCategoryAction extends DvdAbstractDialogAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller; // see findBugs
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdAddCategoryAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name, controller, "new.category.input.message"); //$NON-NLS-1$
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void handleDialogInput(String inputValue) {
+ // add a category to current selection of the tree
+ m_controller.addCategory(inputValue);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddDvdAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddDvdAction.java
new file mode 100644
index 000000000..8e09b6c5c
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddDvdAction.java
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+import org.eclipse.jubula.examples.aut.dvdtool.model.Dvd;
+
+
+/**
+ * This is the action class for adding a dvd.
+ *
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdAddDvdAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller; // see findBugs
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdAddDvdAction(String name,
+ DvdMainFrameController controller) {
+ super(name);
+
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ m_controller.addDvd(new Dvd());
+ m_controller.updateDisableOrEnableActions();
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddLanguageAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddLanguageAction.java
new file mode 100644
index 000000000..9b842bf79
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdAddLanguageAction.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+
+/**
+ * This is the action class for adding a language.
+ *
+ * @author BREDEX GmbH
+ * @created 18.02.2008
+ */
+public class DvdAddLanguageAction extends DvdAbstractDialogAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdAddLanguageAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name, controller, "new.language.input.message"); //$NON-NLS-1$
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void handleDialogInput(String inputValue) {
+ // add a category to current selection of the tree
+ m_controller.addLanguage(inputValue);
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdChangeTabSelectionAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdChangeTabSelectionAction.java
new file mode 100644
index 000000000..5e85ca017
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdChangeTabSelectionAction.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JTabbedPane;
+
+/**
+ * This is the action class for clearing the description text area.
+ *
+ * @author BREDEX GmbH
+ * @created 26.02.2008
+ */
+public class DvdChangeTabSelectionAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdChangeTabSelectionAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ JTabbedPane tabbedPane =
+ m_controller.getDvdMainFrame().getDvdDetailTabbedPane();
+ int indexToSelect = (tabbedPane.getSelectedIndex() + 1);
+
+ if (indexToSelect >= tabbedPane.getTabCount()) {
+ indexToSelect = 0;
+ }
+
+ tabbedPane.setSelectedIndex(indexToSelect);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdClearDescriptionAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdClearDescriptionAction.java
new file mode 100644
index 000000000..7f708dbac
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdClearDescriptionAction.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JTextArea;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdContentPanel;
+
+
+/**
+ * This is the action class for clearing the description text area.
+ *
+ * @author BREDEX GmbH
+ * @created 20.02.2008
+ */
+public class DvdClearDescriptionAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdClearDescriptionAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ DvdContentPanel contentPanel =
+ m_controller.getDvdMainFrame().getDvdContentPanel();
+ JTextArea descriptionTextArea = contentPanel.getTextAreaDescription();
+ descriptionTextArea.setText(""); //$NON-NLS-1$
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyBonusValueToClipboardAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyBonusValueToClipboardAction.java
new file mode 100644
index 000000000..f2b0feb70
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyBonusValueToClipboardAction.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JCheckBox;
+import javax.swing.JTextField;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdTechPanel;
+
+
+/**
+ * This is the action class for copy of selection value from the bonus checkbox
+ * to the clipboard.
+ * A selected checkbox is represented by the string "TRUE".
+ * A deselected checkbox is represented by the string "FALSE".
+ *
+ * @author BREDEX GmbH
+ * @created 25.02.2008
+ */
+public class DvdCopyBonusValueToClipboardAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+ /** the dummy textfield needed only for copying to clipboard */
+ private transient JTextField m_dummyTextField = new JTextField();
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdCopyBonusValueToClipboardAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ DvdTechPanel techPanel = m_controller.getDvdMainFrame()
+ .getDvdTechMainPanel().getDvdTechPanel();
+ JCheckBox bonusCheckBox = techPanel.getCheckBoxBonus();
+ String valueStr =
+ bonusCheckBox.isSelected() ? "TRUE" : "FALSE"; //$NON-NLS-1$ //$NON-NLS-2$
+
+ // copy value string to clipboard
+ m_dummyTextField.setText(valueStr);
+ m_dummyTextField.selectAll();
+ m_dummyTextField.copy();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyChapterLabelToClipboardAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyChapterLabelToClipboardAction.java
new file mode 100644
index 000000000..a21d20f3b
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyChapterLabelToClipboardAction.java
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JLabel;
+import javax.swing.JTextField;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdContentPanel;
+
+
+/**
+ * This is the action class for copy of text from the chapter label to
+ * the clipboard.
+ *
+ * @author BREDEX GmbH
+ * @created 27.02.2008
+ */
+public class DvdCopyChapterLabelToClipboardAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+ /** the dummy textfield needed only for copying to clipboard */
+ private transient JTextField m_dummyTextField = new JTextField();
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdCopyChapterLabelToClipboardAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ DvdContentPanel contentPanel =
+ m_controller.getDvdMainFrame().getDvdContentPanel();
+ JLabel label = contentPanel.getLabelChapters();
+ String text = label.getText();
+
+ // copy text to clipboard
+ m_dummyTextField.setText(text);
+ m_dummyTextField.selectAll();
+ m_dummyTextField.copy();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyChapterTextToClipboardAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyChapterTextToClipboardAction.java
new file mode 100644
index 000000000..48662fbf0
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyChapterTextToClipboardAction.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import javax.swing.text.JTextComponent;
+
+/**
+ * This is the action class for copy of text from the chapter textfield to
+ * the clipboard.
+ * The whole text of the JTextComponent is copied. The selection is not changed.
+ *
+ * @author BREDEX GmbH
+ * @created 22.02.2008
+ */
+public class DvdCopyChapterTextToClipboardAction
+ extends DvdCopyTextToClipboardAction {
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdCopyChapterTextToClipboardAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name, controller);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ JTextComponent getTextComponent() {
+ return getController().getDvdMainFrame()
+ .getDvdContentPanel().getTextFieldChapters();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk16RadioButtonToClipboardAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk16RadioButtonToClipboardAction.java
new file mode 100644
index 000000000..1f351f9ff
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk16RadioButtonToClipboardAction.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import javax.swing.JRadioButton;
+
+/**
+ * This is the action class for copy of fsk16 radiobutton to the clipboard.
+ *
+ * The string that is copied to the clipboard has the format "{label}:{value}".
+ * The value is "true" if the JRadioButton is selected and "false" otherwise.
+ *
+ * @author BREDEX GmbH
+ * @created 25.02.2008
+ */
+public class DvdCopyFsk16RadioButtonToClipboardAction
+ extends DvdCopyRadioButtonToClipboardAction {
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdCopyFsk16RadioButtonToClipboardAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name, controller);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ JRadioButton getRadioButton() {
+ return getController().getDvdMainFrame()
+ .getDvdContentPanel().getRadioButtonFsk16();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk18RadioButtonToClipboardAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk18RadioButtonToClipboardAction.java
new file mode 100644
index 000000000..6dbb6addd
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk18RadioButtonToClipboardAction.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import javax.swing.JRadioButton;
+
+/**
+ * This is the action class for copy of fsk18 radiobutton to the clipboard.
+ *
+ * The string that is copied to the clipboard has the format "{label}:{value}".
+ * The value is "true" if the JRadioButton is selected and "false" otherwise.
+ *
+ * @author BREDEX GmbH
+ * @created 25.02.2008
+ */
+public class DvdCopyFsk18RadioButtonToClipboardAction
+ extends DvdCopyRadioButtonToClipboardAction {
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdCopyFsk18RadioButtonToClipboardAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name, controller);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ JRadioButton getRadioButton() {
+ return getController().getDvdMainFrame()
+ .getDvdContentPanel().getRadioButtonFsk18();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk6RadioButtonToClipboardAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk6RadioButtonToClipboardAction.java
new file mode 100644
index 000000000..e37bf833c
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyFsk6RadioButtonToClipboardAction.java
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import javax.swing.JRadioButton;
+
+/**
+ * This is the action class for copy of fsk6 radiobutton to the clipboard.
+ *
+ * The string that is copied to the clipboard has the format "{label}:{value}".
+ * The value is "true" if the JRadioButton is selected and "false" otherwise.
+ *
+ * @author BREDEX GmbH
+ * @created 25.02.2008
+ */
+public class DvdCopyFsk6RadioButtonToClipboardAction
+ extends DvdCopyRadioButtonToClipboardAction {
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdCopyFsk6RadioButtonToClipboardAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name, controller);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ JRadioButton getRadioButton() {
+ return getController().getDvdMainFrame()
+ .getDvdContentPanel().getRadioButtonFsk6();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyRadioButtonToClipboardAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyRadioButtonToClipboardAction.java
new file mode 100644
index 000000000..cea3ec998
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyRadioButtonToClipboardAction.java
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+
+/**
+ * This is the base action class for copy of JRadioButtons to the clipboard.
+ * The extending class must provide that JRadioButton.
+ *
+ * The string that is copied to the clipboard has the format "{label}:{value}".
+ * The value is "true" if the JRadioButton is selected and "false" otherwise.
+ *
+ * @author BREDEX GmbH
+ * @created 25.02.2008
+ */
+abstract class DvdCopyRadioButtonToClipboardAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+ /** the dummy textfield needed only for copying to clipboard */
+ private transient JTextField m_dummyTextField = new JTextField();
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdCopyRadioButtonToClipboardAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ JRadioButton button = getRadioButton();
+ String text =
+ button.getLabel() + ":" //$NON-NLS-1$
+ + (button.isSelected() ? "true" : "false"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // copy text to clipboard
+ m_dummyTextField.setText(text);
+ m_dummyTextField.selectAll();
+ m_dummyTextField.copy();
+ }
+
+ /**
+ * Returns the controller of the main frame
+ * @return the controller of the main frame
+ */
+ DvdMainFrameController getController() {
+ return m_controller;
+ }
+
+ /**
+ * Returns the corresponding RadioButton
+ * @return the corresponding RadioButton
+ */
+ abstract JRadioButton getRadioButton();
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyTextToClipboardAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyTextToClipboardAction.java
new file mode 100644
index 000000000..75a44115c
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdCopyTextToClipboardAction.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.text.JTextComponent;
+
+/**
+ * This is the base action class for copy of text from a JTextComponent to
+ * the clipboard. The extending class must provide that JTextComponent.
+ * The whole text of the JTextComponent is copied. The selection is not changed.
+ *
+ * @author BREDEX GmbH
+ * @created 21.02.2008
+ */
+abstract class DvdCopyTextToClipboardAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdCopyTextToClipboardAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ JTextComponent textComp = getTextComponent();
+
+ // memorize current selection
+ int startIx = textComp.getSelectionStart();
+ int endIx = textComp.getSelectionEnd();
+
+ // copy whole text to clipboard
+ textComp.selectAll();
+ textComp.copy();
+
+ // restore memorized selection
+ textComp.setSelectionStart(startIx);
+ textComp.setSelectionEnd(endIx);
+ }
+
+ /**
+ * Returns the controller of the main frame
+ * @return the controller of the main frame
+ */
+ DvdMainFrameController getController() {
+ return m_controller;
+ }
+
+ /**
+ * Returns the corresponding JTextComponent
+ * @return the corresponding JTextComponent
+ */
+ abstract JTextComponent getTextComponent();
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdDisableOrEnableCategoryAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdDisableOrEnableCategoryAction.java
new file mode 100644
index 000000000..737b946f0
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdDisableOrEnableCategoryAction.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+/**
+ * This is the action class for disabling or enabling of categories.
+ * The corresponding dvds are also set disabled or enabled accordingly.
+ *
+ * @author BREDEX GmbH
+ * @created 12.02.2008
+ */
+public class DvdDisableOrEnableCategoryAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /** the enable state to be set */
+ private transient boolean m_enableState;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ * @param enableState the enable state to set
+ */
+ public DvdDisableOrEnableCategoryAction(String name,
+ DvdMainFrameController controller, boolean enableState) {
+
+ super(name);
+
+ m_controller = controller;
+ m_enableState = enableState;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ m_controller.setCurrentCategoryEnableState(m_enableState);
+ m_controller.updateDisableOrEnableActions();
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdExitAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdExitAction.java
new file mode 100644
index 000000000..1e02d4e62
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdExitAction.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.AbstractAction;
+import javax.swing.JFrame;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdDialogs;
+
+
+/**
+ * This is the action class for closing the program.
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdExitAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdExitAction(String name, DvdMainFrameController controller) {
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ boolean close = true;
+ if (m_controller.isChanged()) {
+ boolean save = true;
+ List keys = new Vector();
+ keys.add("exit.library.has.changed"); //$NON-NLS-1$
+ keys.add("exit.question.save"); //$NON-NLS-1$
+ int choice = DvdDialogs.confirm3(m_controller.getDvdMainFrame(),
+ "dialog.confirm.exit.needs.save.title", //$NON-NLS-1$
+ keys);
+ switch (choice) {
+ case DvdDialogs.YES:
+ save = true;
+ close = true;
+ break;
+ case DvdDialogs.NO:
+ save = false;
+ close = true;
+ break;
+ case DvdDialogs.CANCEL:
+ save = false;
+ close = false;
+ break;
+ default:
+ save = true;
+ close = false;
+ }
+ if (save) {
+ m_controller.getSaveAction().actionPerformed(e);
+ if (m_controller.isChanged()) {
+ // saving cancelled -> don't exit
+ close = false;
+ }
+ }
+ }
+ if (close) {
+ JFrame frame = m_controller.getDvdMainFrame();
+ frame.setVisible(false);
+ frame.dispose();
+ System.exit(0);
+ }
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdInfoAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdInfoAction.java
new file mode 100644
index 000000000..03a00d264
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdInfoAction.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This is the action class for closing the program.
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdInfoAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller; // see findBugs
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdInfoAction(String name, DvdMainFrameController controller) {
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ JFrame frame = m_controller.getDvdMainFrame();
+ JOptionPane.showMessageDialog(
+ frame,
+ Resources.getString("application.name"), //$NON-NLS-1$
+ Resources.getString("dialog.about.title"), //$NON-NLS-1$
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdLabelPlacementAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdLabelPlacementAction.java
new file mode 100644
index 000000000..565a1dd23
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdLabelPlacementAction.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+/**
+ * This is the action class for setting label placement in the rating panel.
+ *
+ * @author BREDEX GmbH
+ * @created 19.02.2008
+ */
+public class DvdLabelPlacementAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /** the label placement defined by constant from AbstractButton */
+ private transient int m_labelPlacement;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ * @param labelPlacement the label placement to set using constant
+ * from AbstractButton
+ */
+ public DvdLabelPlacementAction(String name,
+ DvdMainFrameController controller, int labelPlacement) {
+
+ super(name);
+ m_controller = controller;
+ m_labelPlacement = labelPlacement;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ DvdManager.singleton()
+ .changeLabelPlacement(m_controller, m_labelPlacement);
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdListTransferHandler.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdListTransferHandler.java
new file mode 100644
index 000000000..ae0a41db3
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdListTransferHandler.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import javax.swing.JComponent;
+import javax.swing.JList;
+import javax.swing.ListModel;
+
+/**
+ * The instances of this class handle transfer operations of Strings in JList
+ * objects that have non-empty Strings as elements.
+ * The source and target element of the transfer operation swap their position.
+ *
+ * (Needed for supporting 'drag and drop' feature in the language list.)
+ *
+ * @author BREDEX GmbH
+ * @created 06.02.2008
+ */
+public class DvdListTransferHandler extends StringTransferHandler {
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String exportString(JComponent c) {
+ JList listComp = (JList)c;
+ String selectedString = (String) listComp.getSelectedValue();
+
+ return selectedString;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void importString(JComponent c, String draggedStr) {
+ JList listComp = (JList)c;
+ int selectedIndex = listComp.getSelectedIndex();
+ String selectedString = (String) listComp.getSelectedValue();
+ ListModel currentModel = listComp.getModel();
+
+ // build new model
+ String[] newModel = new String[currentModel.getSize()];
+ for (int i = 0; i < newModel.length; i++) {
+ String currentStr = (String) currentModel.getElementAt(i);
+
+ if (currentStr.equals(draggedStr)) {
+ newModel[i] = selectedString;
+ } else {
+ newModel[i] = currentStr;
+ }
+ }
+ newModel[selectedIndex] = draggedStr;
+
+ // update model of listComp
+ listComp.setListData(newModel);
+ listComp.setSelectedIndex(selectedIndex);
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdMainFrameController.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdMainFrameController.java
new file mode 100644
index 000000000..837ea7748
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdMainFrameController.java
@@ -0,0 +1,988 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.InputEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPopupMenu;
+import javax.swing.JRadioButton;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.JTree;
+import javax.swing.KeyStroke;
+import javax.swing.ListModel;
+import javax.swing.SwingConstants;
+import javax.swing.WindowConstants;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreePath;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdContentPanel;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdMainFrame;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdTableModel;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdTechPanel;
+import org.eclipse.jubula.examples.aut.dvdtool.model.Dvd;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdCategory;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdDataObject;
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This is the controller class for the main frame.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DvdMainFrameController {
+ /** flag if some changes was made */
+ private boolean m_changed;
+
+ /** the frame */
+ private DvdMainFrame m_frame = new DvdMainFrame();
+
+ /** the tree controller */
+ private DvdTreeController m_treeController;
+
+ /** the table controller */
+ private DvdTableController m_tableController;
+
+ /** the save action */
+ private DvdSaveAction m_saveAction =
+ new DvdSaveAction(Resources.getString("menu.file.save"), this); //$NON-NLS-1$
+
+ /** the open action */
+ private DvdOpenAction m_openAction =
+ new DvdOpenAction(Resources.getString("menu.file.open"), this); //$NON-NLS-1$
+
+ /** the exit action */
+ private DvdExitAction m_exitAction =
+ new DvdExitAction(Resources.getString("menu.file.exit"), this); //$NON-NLS-1$
+
+ /** the info action */
+ private DvdInfoAction m_infoAction =
+ new DvdInfoAction(Resources.getString("menu.help.about"), this); //$NON-NLS-1$
+
+ /** the action for adding a category */
+ private DvdAddCategoryAction m_addCategoryAction =
+ new DvdAddCategoryAction(Resources.getString("menu.edit.add.category"), this); //$NON-NLS-1$
+
+ /** the action for enabling a category */
+ private DvdDisableOrEnableCategoryAction m_enableCategoryAction =
+ new DvdDisableOrEnableCategoryAction(
+ Resources.getString("menu.edit.enable.category"), //$NON-NLS-1$
+ this, true);
+
+ /** the action for disabling a category */
+ private DvdDisableOrEnableCategoryAction m_disableCategoryAction =
+ new DvdDisableOrEnableCategoryAction(
+ Resources.getString("menu.edit.disable.category"), //$NON-NLS-1$
+ this, false);
+
+ /** the action for removing a category */
+ private DvdRemoveCategoryAction m_removeCategoryAction =
+ new DvdRemoveCategoryAction(Resources.getString("menu.edit.remove.category"), this); //$NON-NLS-1$
+
+ /** the action for adding a dvd */
+ private DvdAddDvdAction m_addDvdAction =
+ new DvdAddDvdAction(Resources.getString("menu.edit.add.dvd"), this); //$NON-NLS-1$
+
+ /** the action for removing a dvd */
+ private DvdRemoveDvdAction m_removeDvdAction =
+ new DvdRemoveDvdAction(Resources.getString("menu.edit.remove.dvd"), this); //$NON-NLS-1$
+
+ /** the action for adding a language */
+ private DvdAddLanguageAction m_addLanguageAction =
+ new DvdAddLanguageAction(
+ Resources.getString("menu.edit.add.language"), //$NON-NLS-1$
+ this);
+
+ /** the action for removing a language */
+ private DvdRemoveLanguageAction m_removeLanguageAction =
+ new DvdRemoveLanguageAction(
+ Resources.getString("menu.edit.remove.language"), //$NON-NLS-1$
+ this);
+
+ /** the action for setting the dvd detail tab placement to top */
+ private DvdTabPlacementAction m_tabPlacementTopAction =
+ new DvdTabPlacementAction(
+ Resources.getString("menu.config.dvddetails.tabstotop"), //$NON-NLS-1$
+ this, SwingConstants.TOP);
+
+ /** the action for setting the dvd detail tab placement to bottom */
+ private DvdTabPlacementAction m_tabPlacementBottomAction =
+ new DvdTabPlacementAction(
+ Resources.getString("menu.config.dvddetails.tabstobottom"), //$NON-NLS-1$
+ this, SwingConstants.BOTTOM);
+
+ /** the action for setting the dvd detail tab placement to left */
+ private DvdTabPlacementAction m_tabPlacementLeftAction =
+ new DvdTabPlacementAction(
+ Resources.getString("menu.config.dvddetails.tabstoleft"), //$NON-NLS-1$
+ this, SwingConstants.LEFT);
+
+ /** the action for setting the dvd detail tab placement to right */
+ private DvdTabPlacementAction m_tabPlacementRightAction =
+ new DvdTabPlacementAction(
+ Resources.getString("menu.config.dvddetails.tabstoright"), //$NON-NLS-1$
+ this, SwingConstants.RIGHT);
+
+ /** the action for setting the rating panel label placement to top */
+ private DvdLabelPlacementAction m_labelPlacementTopAction =
+ new DvdLabelPlacementAction(
+ Resources.getString(
+ "menu.config.dvddetails.content.labelstotop"), //$NON-NLS-1$
+ this, SwingConstants.TOP);
+
+ /** the action for setting the rating panel label placement to bottom */
+ private DvdLabelPlacementAction m_labelPlacementBottomAction =
+ new DvdLabelPlacementAction(
+ Resources.getString(
+ "menu.config.dvddetails.content.labelstobottom"), //$NON-NLS-1$
+ this, SwingConstants.BOTTOM);
+
+ /** the action for setting the rating panel label placement to left */
+ private DvdLabelPlacementAction m_labelPlacementLeftAction =
+ new DvdLabelPlacementAction(
+ Resources.getString(
+ "menu.config.dvddetails.content.labelstoleft"), //$NON-NLS-1$
+ this, SwingConstants.LEFT);
+
+ /** the action for setting the rating panel label placement to right */
+ private DvdLabelPlacementAction m_labelPlacementRightAction =
+ new DvdLabelPlacementAction(
+ Resources.getString(
+ "menu.config.dvddetails.content.labelstoright"), //$NON-NLS-1$
+ this, SwingConstants.RIGHT);
+
+ /** the action for clearing the description text area */
+ private DvdClearDescriptionAction m_clearDescriptionAction =
+ new DvdClearDescriptionAction(
+ Resources.getString("action.clear.description"), //$NON-NLS-1$
+ this);
+
+ /** the action for copying of text from the chapter field to clipboard */
+ private DvdCopyChapterTextToClipboardAction m_copyChapterTextAction =
+ new DvdCopyChapterTextToClipboardAction(
+ Resources.getString("action.copy.to.clipboard"), //$NON-NLS-1$
+ this);
+
+ /** the action for copying of text from the chapter label to clipboard */
+ private DvdCopyChapterLabelToClipboardAction m_copyChapterLabelAction =
+ new DvdCopyChapterLabelToClipboardAction(
+ Resources.getString("action.copy.to.clipboard"), //$NON-NLS-1$
+ this);
+
+ /** the action for copying of value from bonus checkbox to clipboard */
+ private DvdCopyBonusValueToClipboardAction m_copyBonusValueAction =
+ new DvdCopyBonusValueToClipboardAction(
+ Resources.getString("action.copy.to.clipboard"), //$NON-NLS-1$
+ this);
+
+ /** the action for copying of fsk6 radiobutton to clipboard */
+ private DvdCopyFsk6RadioButtonToClipboardAction m_copyFsk6ButtonAction =
+ new DvdCopyFsk6RadioButtonToClipboardAction(
+ Resources.getString("action.copy.to.clipboard"), //$NON-NLS-1$
+ this);
+
+ /** the action for copying of fsk16 radiobutton to clipboard */
+ private DvdCopyFsk16RadioButtonToClipboardAction m_copyFsk16ButtonAction =
+ new DvdCopyFsk16RadioButtonToClipboardAction(
+ Resources.getString("action.copy.to.clipboard"), //$NON-NLS-1$
+ this);
+
+ /** the action for copying of fsk18 radiobutton to clipboard */
+ private DvdCopyFsk18RadioButtonToClipboardAction m_copyFsk18ButtonAction =
+ new DvdCopyFsk18RadioButtonToClipboardAction(
+ Resources.getString("action.copy.to.clipboard"), //$NON-NLS-1$
+ this);
+
+ /** the action for changing of tab selection */
+ private DvdChangeTabSelectionAction m_changeTabSelectionAction =
+ new DvdChangeTabSelectionAction(
+ Resources.getString("action.change.tab.selection"), //$NON-NLS-1$
+ this);
+
+ /** the action for showing of a waiting dialog */
+ private DvdShowWaitingDialogAction m_showWaitingDialogAction =
+ new DvdShowWaitingDialogAction(
+ Resources.getString("action.show.waiting.dialog"), //$NON-NLS-1$
+ this);
+
+ /**
+ * inner class listening for window closing events
+ */
+ private class MyWindowListener extends WindowAdapter {
+ /**
+ * activates a DvdExitAction
+ * @param e the raised WindowEvent
+ */
+ public void windowClosing(WindowEvent e) {
+ m_frame.getMenuItemExit().doClick();
+ }
+ }
+
+ /**
+ * inner class used as ListSelectionListener for language list component
+ */
+ private class LanguageListSelectionListener
+ implements ListSelectionListener {
+
+ /**
+ * {@inheritDoc}
+ */
+ public void valueChanged(ListSelectionEvent e) {
+ if (!e.getValueIsAdjusting()) {
+ boolean removeLanguage = isRemoveLanguageAllowed();
+ getRemoveLanguageAction().setEnabled(removeLanguage);
+ }
+ }
+ }
+
+ /**
+ * constructor, initialises this controller
+ */
+ public DvdMainFrameController() {
+ init();
+ }
+
+ /**
+ * private method for initialisation, initialisise the actions and then
+ * creates the other controller
+ */
+ private void init() {
+ // no changes at program start
+ setChanged(false);
+
+ // initialize the actions
+ initActions();
+
+ // initialize the menu items
+ initMenuItems();
+
+ // initialize the shortcuts
+ initShortcuts();
+
+ // initialize the listeners
+ initListeners();
+
+ // set an empty model for the table
+ m_frame.getTable().setModel(new DvdTableModel());
+
+ // create controller for the table
+ m_tableController = new DvdTableController(this);
+
+ // create controller for the tree
+ m_treeController = new DvdTreeController(this);
+ }
+
+ /**
+ * private method for initialisation of the actions
+ */
+ private void initActions() {
+ // the default enable state of the actions
+ m_addCategoryAction.setEnabled(false);
+ m_enableCategoryAction.setEnabled(false);
+ m_disableCategoryAction.setEnabled(false);
+ m_removeCategoryAction.setEnabled(false);
+ m_addDvdAction.setEnabled(false);
+ m_removeDvdAction.setEnabled(false);
+ m_addLanguageAction.setEnabled(false);
+ m_removeLanguageAction.setEnabled(false);
+ m_saveAction.setEnabled(true);
+ m_openAction.setEnabled(true);
+ m_exitAction.setEnabled(true);
+ m_infoAction.setEnabled(true);
+ m_clearDescriptionAction.setEnabled(false);
+ m_copyChapterTextAction.setEnabled(false);
+ m_copyChapterLabelAction.setEnabled(false);
+ m_copyBonusValueAction.setEnabled(false);
+ m_copyFsk6ButtonAction.setEnabled(false);
+ m_copyFsk16ButtonAction.setEnabled(false);
+ m_copyFsk18ButtonAction.setEnabled(false);
+ m_changeTabSelectionAction.setEnabled(false);
+ m_showWaitingDialogAction.setEnabled(true);
+
+ // set default configuration for tab placement and
+ // the enable state of the corresponding actions
+ DvdManager.singleton().changeTabPlacement(this, SwingConstants.TOP);
+
+ // set default configuration for radio button label placement and
+ // the enable state of the corresponding actions
+ DvdManager.singleton().changeLabelPlacement(this, SwingConstants.RIGHT);
+ }
+
+ /**
+ * private method for initialisation of the menu items
+ */
+ private void initMenuItems() {
+ // set the actions
+ m_frame.getMenuItemAddCategory().setAction(m_addCategoryAction);
+ m_frame.getMenuItemEnableCategory().setAction(m_enableCategoryAction);
+ m_frame.getMenuItemDisableCategory().setAction(m_disableCategoryAction);
+ m_frame.getMenuItemRemoveCategory().setAction(m_removeCategoryAction);
+ m_frame.getMenuItemAddDvd().setAction(m_addDvdAction);
+ m_frame.getMenuItemRemoveDvd().setAction(m_removeDvdAction);
+ m_frame.getMenuItemAddLanguage().setAction(m_addLanguageAction);
+ m_frame.getMenuItemRemoveLanguage().setAction(m_removeLanguageAction);
+ m_frame.getMenuItemSave().setAction(m_saveAction);
+ m_frame.getMenuItemOpen().setAction(m_openAction);
+ m_frame.getMenuItemExit().setAction(m_exitAction);
+ m_frame.getMenuItemInfo().setAction(m_infoAction);
+
+ m_frame.getMenuItemDvdDetailsTabsToTop()
+ .setAction(m_tabPlacementTopAction);
+ m_frame.getMenuItemDvdDetailsTabsToBottom()
+ .setAction(m_tabPlacementBottomAction);
+ m_frame.getMenuItemDvdDetailsTabsToLeft()
+ .setAction(m_tabPlacementLeftAction);
+ m_frame.getMenuItemDvdDetailsTabsToRight()
+ .setAction(m_tabPlacementRightAction);
+
+ m_frame.getMenuItemRatingPanelLabelsToTop()
+ .setAction(m_labelPlacementTopAction);
+ m_frame.getMenuItemRatingPanelLabelsToBottom()
+ .setAction(m_labelPlacementBottomAction);
+ m_frame.getMenuItemRatingPanelLabelsToLeft()
+ .setAction(m_labelPlacementLeftAction);
+ m_frame.getMenuItemRatingPanelLabelsToRight()
+ .setAction(m_labelPlacementRightAction);
+
+ m_frame.getMenuItemShowWaitingDialog()
+ .setAction(m_showWaitingDialogAction);
+ }
+
+ /**
+ * private method for initialisation of the shortcuts
+ */
+ private void initShortcuts() {
+ // set mnemonics
+ m_frame.getMenuFile().setMnemonic(
+ Resources.getString("menu.file.mnemonic").charAt(0)); //$NON-NLS-1$
+ m_frame.getMenuEdit().setMnemonic(
+ Resources.getString("menu.edit.mnemonic").charAt(0)); //$NON-NLS-1$
+ m_frame.getMenuConfig().setMnemonic(
+ Resources.getString("menu.config.mnemonic").charAt(0)); //$NON-NLS-1$
+ m_frame.getMenuHelp().setMnemonic(
+ Resources.getString("menu.help.mnemonic").charAt(0)); //$NON-NLS-1$
+
+ // set hotkeys
+ m_frame.getMenuItemOpen().setAccelerator(
+ KeyStroke.getKeyStroke(KeyEvent.VK_O, InputEvent.CTRL_MASK));
+ m_frame.getMenuItemSave().setAccelerator(
+ KeyStroke.getKeyStroke(KeyEvent.VK_S, InputEvent.CTRL_MASK));
+ m_frame.getMenuItemInfo().setAccelerator(
+ KeyStroke.getKeyStroke(KeyEvent.VK_I, InputEvent.CTRL_MASK));
+ }
+
+ /**
+ * private method for initialisation of the listeners
+ */
+ private void initListeners() {
+ // handling window events
+ m_frame.addWindowListener(new MyWindowListener());
+ m_frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+
+ // add listeners to language list component
+ JList languageList = m_frame.getDvdTechMainPanel().getListLanguages();
+ languageList.addListSelectionListener(
+ new LanguageListSelectionListener());
+ languageList.addMouseListener(
+ new PopupListener(createLanguageListPopupMenu()));
+
+ // add listener to description text area
+ DvdContentPanel contentPanel = m_frame.getDvdContentPanel();
+ JTextArea descriptionTextArea = contentPanel.getTextAreaDescription();
+ descriptionTextArea.addMouseListener(
+ new PopupListener(createDescriptionTextAreaPopupMenu()));
+
+ // add listener to chapter field on content panel of dvd details
+ JTextField chapterTF = contentPanel.getTextFieldChapters();
+ chapterTF.addMouseListener(
+ new PopupListener(createChapterFieldPopupMenu()));
+
+ // add listener to chapter label on content panel of dvd details
+ JLabel chapterLabel = contentPanel.getLabelChapters();
+ chapterLabel.addMouseListener(
+ new PopupListener(createChapterLabelPopupMenu()));
+
+ // add listener to bonus checkbox on tech panel of dvd details
+ DvdTechPanel techPanel =
+ m_frame.getDvdTechMainPanel().getDvdTechPanel();
+ JCheckBox bonusCheckBox = techPanel.getCheckBoxBonus();
+ bonusCheckBox.addMouseListener(
+ new PopupListener(createBonusCheckBoxPopupMenu()));
+
+ // add listener to fsk6 radiobutton on content panel of dvd details
+ JRadioButton fsk6Button = contentPanel.getRadioButtonFsk6();
+ fsk6Button.addMouseListener(
+ new PopupListener(createFsk6ButtonPopupMenu()));
+
+ // add listener to fsk16 radiobutton on content panel of dvd details
+ JRadioButton fsk16Button = contentPanel.getRadioButtonFsk16();
+ fsk16Button.addMouseListener(
+ new PopupListener(createFsk16ButtonPopupMenu()));
+
+ // add listener to fsk18 radiobutton on content panel of dvd details
+ JRadioButton fsk18Button = contentPanel.getRadioButtonFsk18();
+ fsk18Button.addMouseListener(
+ new PopupListener(createFsk18ButtonPopupMenu()));
+
+ // add listener to tabbed pane in dvd details
+ m_frame.getDvdDetailTabbedPane().addMouseListener(
+ new PopupListener(createTabbedPanePopupMenu()));
+ }
+
+ /**
+ * creates and adds a new category with the <code>name</code> to each
+ * selected category, via treeController
+ * @param name the name for the category to create and add
+ */
+ public void addCategory(String name) {
+ m_tableController.updateModel();
+ m_treeController.addNewCategoryToSelectedCategories(name);
+ }
+
+ /**
+ * adds a <code>dvd</code> to the currently selected category, via tree controller
+ * @param dvd the dvd to add
+ */
+ public void addDvd(Dvd dvd) {
+ m_tableController.updateModel();
+ m_treeController.addDvd(dvd);
+ }
+
+ /**
+ * remove the current selected DVD, via the table controller
+ */
+ public void removeCurrentDvd() {
+ m_tableController.updateModel();
+ m_treeController.removeDvd(m_tableController.getDvd());
+ }
+
+ /**
+ * sets the enable state of the current selected category, via tree
+ * controller and table controller
+ * @param enable the enable state to set
+ */
+ public void setCurrentCategoryEnableState(boolean enable) {
+ m_tableController.updateModel();
+ m_tableController.setAllDvdsEnableState(enable);
+ m_treeController.setCurrentCategoryEnableState(enable);
+ }
+
+ /**
+ * removes the current selected category, via tree controller
+ */
+ public void removeCurrentCategory() {
+ m_tableController.updateModel();
+ m_treeController.removeCurrentCategory();
+ }
+
+ /**
+ * adds a new language with the <code>newLanguageName</code> to the
+ * language list
+ * @param newLanguageName the name for the language to create and add
+ */
+ public void addLanguage(String newLanguageName) {
+ m_tableController.updateModel();
+ addLanguageInDvdDetails(newLanguageName);
+ }
+
+ /**
+ * adds a new language with the <code>newLanguageName</code> to the
+ * language list
+ * @param newLanguageName the name for the language to create and add
+ */
+ private void addLanguageInDvdDetails(String newLanguageName) {
+ JList languageList = m_frame.getDvdTechMainPanel().getListLanguages();
+ int selectedIndex = languageList.getSelectedIndex();
+ ListModel currentModel = languageList.getModel();
+
+ // build new model
+ String[] newModel = new String[currentModel.getSize() + 1];
+ for (int i = 0; i < currentModel.getSize(); i++) {
+ newModel[i] = (String) currentModel.getElementAt(i);
+ }
+ newModel[newModel.length - 1] = newLanguageName;
+
+ // update model of languageList
+ languageList.setListData(newModel);
+ languageList.setSelectedIndex(selectedIndex);
+ }
+
+ /**
+ * removes the selected language from the language list, if there are
+ * at least two languages; otherwise nothing happens
+ */
+ public void removeLanguage() {
+ m_tableController.updateModel();
+ removeLanguageInDvdDetails();
+ }
+
+ /**
+ * removes the selected language from the language list, if there are
+ * at least two languages; otherwise nothing happens
+ */
+ private void removeLanguageInDvdDetails() {
+ JList languageList = m_frame.getDvdTechMainPanel().getListLanguages();
+ int selectedIndex = languageList.getSelectedIndex();
+ ListModel currentModel = languageList.getModel();
+
+ if (isRemoveLanguageAllowed()) {
+ // build new model
+ String[] newModel = new String[currentModel.getSize() - 1];
+ for (int i = 0; i < newModel.length; i++) {
+ if (i < selectedIndex) {
+ newModel[i] = (String) currentModel.getElementAt(i);
+ } else {
+ newModel[i] = (String) currentModel.getElementAt(i + 1);
+ }
+ }
+
+ // update model of languageList
+ languageList.setListData(newModel);
+ } else {
+ throw new RuntimeException(
+ "The action must be disabled under these circumstances!"); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * update the model, after a call to this method all editable properties are
+ * stored in the model (currently the displayed Dvd instance)
+ */
+ public void updateModel() {
+ m_tableController.updateModel();
+ }
+
+ /**
+ * updates the enable state of the actions that depend on the current
+ * selected category
+ */
+ public void updateDisableOrEnableActions() {
+ JTree tree = getDvdMainFrame().getTreePanel().getTree();
+ TreePath selectionPath =
+ tree.getSelectionModel().getLeadSelectionPath();
+ boolean multipleTreeSelections = (tree.getSelectionCount() > 1);
+
+ if ((selectionPath == null) || multipleTreeSelections) {
+ m_enableCategoryAction.setEnabled(false);
+ m_disableCategoryAction.setEnabled(false);
+ m_addDvdAction.setEnabled(false);
+ } else {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectionPath
+ .getLastPathComponent();
+ DvdDataObject data = (DvdDataObject) node.getUserObject();
+ boolean categoryEnabled = data.getCategory().isEnabled();
+
+ if (data.hasDvds()) {
+ m_enableCategoryAction.setEnabled(!categoryEnabled);
+ m_disableCategoryAction.setEnabled(categoryEnabled);
+ m_addDvdAction.setEnabled(categoryEnabled);
+ } else {
+ m_enableCategoryAction.setEnabled(false);
+ m_disableCategoryAction.setEnabled(false);
+ m_addDvdAction.setEnabled(true);
+ }
+ }
+ }
+
+ /**
+ * getter for the frame
+ * @return the frame
+ */
+ public DvdMainFrame getDvdMainFrame() {
+ return m_frame;
+ }
+
+ /**
+ * @return Returns the exitAction.
+ */
+ public DvdExitAction getExitAction() {
+ return m_exitAction;
+ }
+
+ /**
+ * @return Returns the infoAction.
+ */
+ public DvdInfoAction getInfoAction() {
+ return m_infoAction;
+ }
+
+ /**
+ * @return Returns the openAction.
+ */
+ public DvdOpenAction getOpenAction() {
+ return m_openAction;
+ }
+
+ /**
+ * @return Returns the saveAction.
+ */
+ public DvdSaveAction getSaveAction() {
+ return m_saveAction;
+ }
+
+ /**
+ * @return Returns the addCategoryAction.
+ */
+ public DvdAddCategoryAction getAddCategoryAction() {
+ return m_addCategoryAction;
+ }
+
+ /**
+ * @return Returns the enableCategoryAction
+ */
+ public DvdDisableOrEnableCategoryAction getEnableCategoryAction() {
+ return m_enableCategoryAction;
+ }
+
+ /**
+ * @return Returns the disableCategoryAction.
+ */
+ public DvdDisableOrEnableCategoryAction getDisableCategoryAction() {
+ return m_disableCategoryAction;
+ }
+
+ /**
+ * @return Returns the removeCategoryAction.
+ */
+ public DvdRemoveCategoryAction getRemoveCategoryAction() {
+ return m_removeCategoryAction;
+ }
+
+ /**
+ * @return Returns the addDvdAction.
+ */
+ public DvdAddDvdAction getAddDvdAction() {
+ return m_addDvdAction;
+ }
+
+ /**
+ * @return Returns the removeDvdAction.
+ */
+ public DvdRemoveDvdAction getRemoveDvdAction() {
+ return m_removeDvdAction;
+ }
+
+ /**
+ * @return Returns the addLanguageAction.
+ */
+ public DvdAddLanguageAction getAddLanguageAction() {
+ return m_addLanguageAction;
+ }
+
+ /**
+ * @return Returns the removeLanguageAction.
+ */
+ public DvdRemoveLanguageAction getRemoveLanguageAction() {
+ return m_removeLanguageAction;
+ }
+
+ /**
+ * @return Returns the tabPlacementTopAction.
+ */
+ public DvdTabPlacementAction getTabPlacementTopAction() {
+ return m_tabPlacementTopAction;
+ }
+
+ /**
+ * @return Returns the tabPlacementBottomAction.
+ */
+ public DvdTabPlacementAction getTabPlacementBottomAction() {
+ return m_tabPlacementBottomAction;
+ }
+
+ /**
+ * @return Returns the tabPlacementLeftAction.
+ */
+ public DvdTabPlacementAction getTabPlacementLeftAction() {
+ return m_tabPlacementLeftAction;
+ }
+
+ /**
+ * @return Returns the tabPlacementRightAction.
+ */
+ public DvdTabPlacementAction getTabPlacementRightAction() {
+ return m_tabPlacementRightAction;
+ }
+
+ /**
+ * @return Returns the labelPlacementTopAction.
+ */
+ public DvdLabelPlacementAction getLabelPlacementTopAction() {
+ return m_labelPlacementTopAction;
+ }
+
+ /**
+ * @return Returns the labelPlacementBottomAction.
+ */
+ public DvdLabelPlacementAction getLabelPlacementBottomAction() {
+ return m_labelPlacementBottomAction;
+ }
+
+ /**
+ * @return Returns the labelPlacementLeftAction.
+ */
+ public DvdLabelPlacementAction getLabelPlacementLeftAction() {
+ return m_labelPlacementLeftAction;
+ }
+
+ /**
+ * @return Returns the labelPlacementRightAction.
+ */
+ public DvdLabelPlacementAction getLabelPlacementRightAction() {
+ return m_labelPlacementRightAction;
+ }
+
+ /**
+ * @return Returns the clearDescriptionAction.
+ */
+ public DvdClearDescriptionAction getClearDescriptionAction() {
+ return m_clearDescriptionAction;
+ }
+
+ /**
+ * @return Returns the copyChapterTextAction.
+ */
+ public DvdCopyChapterTextToClipboardAction getCopyChapterTextAction() {
+ return m_copyChapterTextAction;
+ }
+
+ /**
+ * @return Returns the copyChapterLabelAction.
+ */
+ public DvdCopyChapterLabelToClipboardAction getCopyChapterLabelAction() {
+ return m_copyChapterLabelAction;
+ }
+
+ /**
+ * @return Returns the copyBonusValueAction.
+ */
+ public DvdCopyBonusValueToClipboardAction getCopyBonusValueAction() {
+ return m_copyBonusValueAction;
+ }
+
+ /**
+ * @return Returns the copyFsk6ButtonAction.
+ */
+ public DvdCopyFsk6RadioButtonToClipboardAction getCopyFsk6ButtonAction() {
+ return m_copyFsk6ButtonAction;
+ }
+
+ /**
+ * @return Returns the copyFsk16ButtonAction.
+ */
+ public DvdCopyFsk16RadioButtonToClipboardAction getCopyFsk16ButtonAction() {
+ return m_copyFsk16ButtonAction;
+ }
+
+ /**
+ * @return Returns the copyFsk18ButtonAction.
+ */
+ public DvdCopyFsk18RadioButtonToClipboardAction getCopyFsk18ButtonAction() {
+ return m_copyFsk18ButtonAction;
+ }
+
+ /**
+ * @return Returns the changeTabSelectionAction.
+ */
+ public DvdChangeTabSelectionAction getChangeTabSelectionAction() {
+ return m_changeTabSelectionAction;
+ }
+
+ /**
+ * @return Returns the showWaitingDialogAction.
+ */
+ public DvdShowWaitingDialogAction getShowWaitingDialogAction() {
+ return m_showWaitingDialogAction;
+ }
+
+ /**
+ * @return Returns the tableController.
+ */
+ public DvdTableController getTableController() {
+ return m_tableController;
+ }
+
+ /**
+ * @return Returns the treeController.
+ */
+ public DvdTreeController getTreeController() {
+ return m_treeController;
+ }
+
+ /**
+ * @return returns the flag wheter changes was made.
+ */
+ public boolean isChanged() {
+ return m_changed;
+ }
+
+ /**
+ * sets the flag wheter changes was made
+ * @param changed The changed to set.
+ */
+ public void setChanged(boolean changed) {
+ m_changed = changed;
+ }
+
+ /**
+ * inform this controller, that the library was saved
+ * @param name the name of the saved library
+ */
+ public void saved(String name) {
+ updateTitle(name);
+ setChanged(false);
+ }
+
+ /**
+ * inform this controller that a library was opened
+ * @param name the name of the opened library
+ */
+ public void opened(String name) {
+ createTree(DvdManager.singleton().getRootCategory());
+ setChanged(false);
+ updateTitle(name);
+ m_frame.getSplitPane().resetToPreferredSizes();
+ }
+
+ /**
+ * creates the tree (via treeConroller)
+ * @param root the category which is used for the root node
+ */
+ private void createTree(DvdCategory root) {
+ m_treeController.createTree(root);
+ }
+
+ /**
+ * adds <code>suffix</code> to the title
+ * @param suffix additional information
+ */
+ private void updateTitle(String suffix) {
+ m_frame.updateTitle(suffix);
+ }
+
+ /**
+ * Returns a boolean that indicates whether removing the selected language
+ * from the language list is allowed.
+ * @return boolean that indicates whether removing is allowed
+ */
+ private boolean isRemoveLanguageAllowed() {
+ JList languageList = m_frame.getDvdTechMainPanel().getListLanguages();
+ int selectedIndex = languageList.getSelectedIndex();
+ ListModel currentModel = languageList.getModel();
+ int modelSize = currentModel.getSize();
+
+ boolean removeLanguage = ((selectedIndex >= 0)
+ && (selectedIndex < modelSize) && (modelSize >= 2));
+ return removeLanguage;
+ }
+
+ /**
+ * Creates the popupmenu for the language list component
+ * @return the popupmenu for the language list component
+ */
+ private JPopupMenu createLanguageListPopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_addLanguageAction);
+ pm.add(m_removeLanguageAction);
+ return pm;
+ }
+
+ /**
+ * Creates the popupmenu for the description text area
+ * @return the popupmenu for the description text area
+ */
+ private JPopupMenu createDescriptionTextAreaPopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_clearDescriptionAction);
+ return pm;
+ }
+
+ /**
+ * Creates the popupmenu for the chapter field
+ * @return the popupmenu for the chapter field
+ */
+ private JPopupMenu createChapterFieldPopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_copyChapterTextAction);
+ return pm;
+ }
+
+ /**
+ * Creates the popupmenu for the chapter label
+ * @return the popupmenu for the chapter label
+ */
+ private JPopupMenu createChapterLabelPopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_copyChapterLabelAction);
+ return pm;
+ }
+
+ /**
+ * Creates the popupmenu for the bonus checkbox
+ * @return the popupmenu for the bonus checkbox
+ */
+ private JPopupMenu createBonusCheckBoxPopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_copyBonusValueAction);
+ return pm;
+ }
+
+ /**
+ * Creates the popupmenu for the fsk6 radiobutton
+ * @return the popupmenu for the fsk6 radiobutton
+ */
+ private JPopupMenu createFsk6ButtonPopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_copyFsk6ButtonAction);
+ return pm;
+ }
+
+ /**
+ * Creates the popupmenu for the fsk16 radiobutton
+ * @return the popupmenu for the fsk16 radiobutton
+ */
+ private JPopupMenu createFsk16ButtonPopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_copyFsk16ButtonAction);
+ return pm;
+ }
+
+ /**
+ * Creates the popupmenu for the fsk18 radiobutton
+ * @return the popupmenu for the fsk18 radiobutton
+ */
+ private JPopupMenu createFsk18ButtonPopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_copyFsk18ButtonAction);
+ return pm;
+ }
+
+ /**
+ * Creates the popupmenu for the tabbed pane
+ * @return the popupmenu for the tabbed pane
+ */
+ private JPopupMenu createTabbedPanePopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_changeTabSelectionAction);
+ return pm;
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdManager.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdManager.java
new file mode 100644
index 000000000..139621eba
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdManager.java
@@ -0,0 +1,243 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.io.File;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.SwingConstants;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdContentPanel;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdMainFrame;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdCategory;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdGuiConfiguration;
+import org.eclipse.jubula.examples.aut.dvdtool.persistence.DvdInvalidContentException;
+import org.eclipse.jubula.examples.aut.dvdtool.persistence.DvdPersistenceException;
+import org.eclipse.jubula.examples.aut.dvdtool.persistence.DvdPersistenceManager;
+
+
+/**
+ * This class is the manager class for all persistent data. It's a singleton.
+ *
+ * Usage:
+ * call open(File) for an existing File
+ * or set the rootCategory via setRootCategory()
+ *
+ * @author BREDEX GmbH
+ * @created 28.02.2008
+ */
+public class DvdManager {
+ /** the singleton instance reference */
+ private static DvdManager manager = null;
+
+ /** the root category, will be safed via save() */
+ private DvdCategory m_rootCategory = null;
+
+ /** the gui configuration of dvd details, will be safed via save() */
+ private DvdGuiConfiguration m_guiConfiguration = new DvdGuiConfiguration();
+
+ /**
+ * private constructor, use method singleton() for an instance of this manager
+ */
+ private DvdManager() {
+ // empty
+ }
+
+ /**
+ * Implementation of the singleton pattern.
+ *
+ * @return the single instance of this manager.
+ */
+ public static DvdManager singleton() {
+ if (manager == null) {
+ manager = new DvdManager();
+ }
+ return manager;
+ }
+
+ /**
+ * saves dvd library and its gui configuration to <code>file</code>
+ * @param file the file to save the library to
+ * @throws DvdPersistenceException if an io error occurs
+ */
+ public void save(File file) throws DvdPersistenceException {
+ List list = new Vector();
+ list.add(m_rootCategory);
+ list.add(m_guiConfiguration);
+ DvdPersistenceManager.singleton().save(file, list);
+ }
+
+ /**
+ * opens dvd library and its gui configuration from file <code>file</code>
+ * @param file the file to load the library from
+ * @param controller the controller of the main frame
+ * @throws DvdPersistenceException if an io error occurs
+ * @throws DvdInvalidContentException if the file does not contain the expected data
+ */
+ public void open(DvdMainFrameController controller,
+ File file) throws DvdPersistenceException,
+ DvdInvalidContentException {
+
+ List list = DvdPersistenceManager.singleton().load(file);
+ m_rootCategory = (DvdCategory) list.get(0);
+ m_guiConfiguration = (DvdGuiConfiguration) list.get(1);
+
+ restoreGuiConfiguration(controller);
+ }
+
+ /**
+ * restores the gui configuration according to gui configuration object
+ * @param controller the controller of the main frame
+ */
+ public void restoreGuiConfiguration(DvdMainFrameController controller) {
+ restoreTabPlacement(controller);
+ restoreLabelPlacement(controller);
+ }
+
+ /**
+ * @return Returns the rootCategory, may be null
+ */
+ public DvdCategory getRootCategory() {
+ return m_rootCategory;
+ }
+
+ /**
+ * @param rootCategory The rootCategory to set.
+ */
+ public void setRootCategory(DvdCategory rootCategory) {
+ m_rootCategory = rootCategory;
+ }
+
+ /**
+ * changes the tab placement to <code>tabPlacement</code>
+ * @param controller the controller of the main frame
+ * @param tabPlacement The tab placement to set
+ */
+ public void changeTabPlacement(DvdMainFrameController controller,
+ int tabPlacement) {
+ // enable tab placement actions that will have an effect, disable others
+ controller.getTabPlacementTopAction()
+ .setEnabled(tabPlacement != SwingConstants.TOP);
+ controller.getTabPlacementBottomAction()
+ .setEnabled(tabPlacement != SwingConstants.BOTTOM);
+ controller.getTabPlacementLeftAction()
+ .setEnabled(tabPlacement != SwingConstants.LEFT);
+ controller.getTabPlacementRightAction()
+ .setEnabled(tabPlacement != SwingConstants.RIGHT);
+
+ // set tab placement in gui
+ DvdMainFrame frame = controller.getDvdMainFrame();
+ frame.getDvdDetailTabbedPane().setTabPlacement(tabPlacement);
+
+ // set tab placement in persistent object
+ m_guiConfiguration.setTabPlacement(tabPlacement);
+ }
+
+ /**
+ * restores the tab placement according to gui configuration object
+ * @param controller the controller of the main frame
+ */
+ private void restoreTabPlacement(DvdMainFrameController controller) {
+ // get tab placement from persistent object
+ int tabPlacement = m_guiConfiguration.getTabPlacement();
+
+ changeTabPlacement(controller, tabPlacement);
+ }
+
+ /**
+ * changes the radio button label placement to <code>labelPlacement</code>
+ * @param controller the controller of the main frame
+ * @param labelPlacement The radio button label placement to set
+ */
+ public void changeLabelPlacement(DvdMainFrameController controller,
+ int labelPlacement) {
+ // enable radio button label placement actions that will have an effect,
+ // disable others
+ controller.getLabelPlacementTopAction()
+ .setEnabled(labelPlacement != SwingConstants.TOP);
+ controller.getLabelPlacementBottomAction()
+ .setEnabled(labelPlacement != SwingConstants.BOTTOM);
+ controller.getLabelPlacementLeftAction()
+ .setEnabled(labelPlacement != SwingConstants.LEFT);
+ controller.getLabelPlacementRightAction()
+ .setEnabled(labelPlacement != SwingConstants.RIGHT);
+
+ // set radio button label placement in gui
+ setAllLabelPlacements(controller, labelPlacement);
+
+ // set radio button label placement in persistent object
+ m_guiConfiguration.setLabelPlacement(labelPlacement);
+ }
+
+ /**
+ * restores the radio button label placement according to gui configuration
+ * object
+ * @param controller the controller of the main frame
+ */
+ private void restoreLabelPlacement(DvdMainFrameController controller) {
+ // get radio button label placement from persistent object
+ int labelPlacement = m_guiConfiguration.getLabelPlacement();
+
+ changeLabelPlacement(controller, labelPlacement);
+ }
+
+ /**
+ * sets the given horizontal and vertical placement for radio button labels
+ * @param controller the controller of the main frame
+ * @param labelPlacement The radio button label placement to set
+ */
+ private void setAllLabelPlacements(DvdMainFrameController controller,
+ int labelPlacement) {
+
+ // calculate the two constants that are needed for configuring the gui
+ final int horizontalPlacement;
+ if ((labelPlacement == SwingConstants.LEFT)
+ || (labelPlacement == SwingConstants.RIGHT)) {
+
+ horizontalPlacement = labelPlacement;
+ } else {
+ horizontalPlacement = SwingConstants.CENTER;
+ }
+ final int verticalPlacement;
+ if ((labelPlacement == SwingConstants.TOP)
+ || (labelPlacement == SwingConstants.BOTTOM)) {
+
+ verticalPlacement = labelPlacement;
+ } else {
+ verticalPlacement = SwingConstants.CENTER;
+ }
+
+ DvdContentPanel contentPanel =
+ controller.getDvdMainFrame().getDvdContentPanel();
+ JRadioButton rbFsk6 = contentPanel.getRadioButtonFsk6();
+ JRadioButton rbFsk16 = contentPanel.getRadioButtonFsk16();
+ JRadioButton rbFsk18 = contentPanel.getRadioButtonFsk18();
+ JPanel ratingPanel = contentPanel.getRatingPanel();
+
+ rbFsk6.setHorizontalTextPosition(horizontalPlacement);
+ rbFsk16.setHorizontalTextPosition(horizontalPlacement);
+ rbFsk18.setHorizontalTextPosition(horizontalPlacement);
+
+ rbFsk6.setVerticalTextPosition(verticalPlacement);
+ rbFsk16.setVerticalTextPosition(verticalPlacement);
+ rbFsk18.setVerticalTextPosition(verticalPlacement);
+
+ // rebuild the radio button panel to avoid layout problems
+ ratingPanel.removeAll();
+ ratingPanel.add(rbFsk6);
+ ratingPanel.add(rbFsk16);
+ ratingPanel.add(rbFsk18);
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdOpenAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdOpenAction.java
new file mode 100644
index 000000000..1a2e5df35
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdOpenAction.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+import java.io.File;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.AbstractAction;
+import javax.swing.JFileChooser;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdDialogs;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdMainFrame;
+import org.eclipse.jubula.examples.aut.dvdtool.persistence.DvdInvalidContentException;
+import org.eclipse.jubula.examples.aut.dvdtool.persistence.DvdPersistenceException;
+
+
+/**
+ * This is the action class for opening a dvd library
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdOpenAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller; // see findBugs
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdOpenAction(String name, DvdMainFrameController controller) {
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ boolean open = true;
+ if (m_controller.isChanged()) {
+ boolean save = true;
+ List keys = new Vector();
+ keys.add("open.library.has.changed"); //$NON-NLS-1$
+ keys.add("open.question.save"); //$NON-NLS-1$
+ int choice = DvdDialogs.confirm3(m_controller.getDvdMainFrame(),
+ "dialog.confirm.open.needs.save.title", keys); //$NON-NLS-1$
+ switch (choice) {
+ case DvdDialogs.YES:
+ save = true;
+ open = true;
+ break;
+ case DvdDialogs.NO:
+ save = false;
+ open = true;
+ break;
+ case DvdDialogs.CANCEL:
+ save = false;
+ open = false;
+ break;
+ default:
+ save = false;
+ open = false;
+ }
+ if (save) {
+ m_controller.getSaveAction().actionPerformed(e);
+ if (m_controller.isChanged()) {
+ // saving cancelled -> do not open
+ open = false;
+ }
+ }
+ }
+ if (open) {
+ DvdMainFrame frame = m_controller.getDvdMainFrame();
+ int returnValue = frame.getFileChooser().showOpenDialog(frame);
+ if (returnValue == JFileChooser.APPROVE_OPTION) {
+ try {
+ File file = frame.getFileChooser().getSelectedFile();
+ DvdManager.singleton().open(m_controller, file);
+ m_controller.opened(file.getName());
+ } catch (DvdInvalidContentException dice) {
+ DvdDialogs.showMessage(frame, dice.getMessage());
+ } catch (DvdPersistenceException dpe) {
+ DvdDialogs.showError(frame, dpe.getMessage());
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveCategoryAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveCategoryAction.java
new file mode 100644
index 000000000..5d7320c7a
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveCategoryAction.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.AbstractAction;
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreePath;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdDialogs;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdDataObject;
+
+
+/**
+ * This is the action class for deleteing a category.
+ * @author BREDEX GmbH
+ * @created 18.04.2005
+ */
+public class DvdRemoveCategoryAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller; // see findBugs
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdRemoveCategoryAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ JTree tree = m_controller.getDvdMainFrame().getTreePanel().getTree();
+ // ask for confirmation if the selected category has childrens
+ TreePath selectionPath = tree.getSelectionModel()
+ .getLeadSelectionPath();
+ if (selectionPath != null) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectionPath
+ .getLastPathComponent();
+ DvdDataObject data = (DvdDataObject) node.getUserObject();
+ List keys = new Vector();
+ if (data.hasCategories()) {
+ keys.add("remove.category.confirmation.has.categories"); //$NON-NLS-1$
+ }
+ if (data.hasDvds()) {
+ keys.add("remove.category.confirmation.has.dvd"); //$NON-NLS-1$
+ }
+ boolean remove = true;
+ if (!keys.isEmpty()) {
+ keys.add("remove.category.confirmation.consequence"); //$NON-NLS-1$
+ keys.add("remove.category.confirmation.question"); //$NON-NLS-1$
+ remove = DvdDialogs.confirm2(m_controller.getDvdMainFrame(),
+ "dialog.confirm.remove.title", keys); //$NON-NLS-1$
+ }
+ if (remove) {
+ m_controller.removeCurrentCategory();
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveDvdAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveDvdAction.java
new file mode 100644
index 000000000..905c320ad
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveDvdAction.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+/**
+ * This is the action class for deleteing a dvd.
+ * @author BREDEX GmbH
+ * @created 18.04.2005
+ */
+public class DvdRemoveDvdAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller; // see findBugs
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdRemoveDvdAction(String name,
+ DvdMainFrameController controller) {
+ super(name);
+
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ m_controller.removeCurrentDvd();
+ m_controller.updateDisableOrEnableActions();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveLanguageAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveLanguageAction.java
new file mode 100644
index 000000000..db0bd2ab6
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdRemoveLanguageAction.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+/**
+ * This is the action class for removing a language.
+ *
+ * @author BREDEX GmbH
+ * @created 18.02.2008
+ */
+public class DvdRemoveLanguageAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdRemoveLanguageAction(String name,
+ DvdMainFrameController controller) {
+ super(name);
+
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ m_controller.removeLanguage();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdSaveAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdSaveAction.java
new file mode 100644
index 000000000..c510d2d67
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdSaveAction.java
@@ -0,0 +1,74 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+import java.io.File;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.AbstractAction;
+import javax.swing.JFileChooser;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdDialogs;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdMainFrame;
+import org.eclipse.jubula.examples.aut.dvdtool.persistence.DvdPersistenceException;
+
+
+/**
+ * This is the action class for saving the dvd library
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdSaveAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdSaveAction(String name, DvdMainFrameController controller) {
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ DvdMainFrame frame = m_controller.getDvdMainFrame();
+ int returnValue = frame.getFileChooser().showSaveDialog(frame);
+ if (returnValue == JFileChooser.APPROVE_OPTION) {
+ try {
+ File file = frame.getFileChooser().getSelectedFile();
+ boolean save = true;
+ if (file.exists()) {
+ List keys = new Vector();
+ keys.add("save.overwrite.confirmation.fileexists"); //$NON-NLS-1$
+ keys.add("save.overwrite.confirmation.question"); //$NON-NLS-1$
+ save = DvdDialogs.confirm2(m_controller.getDvdMainFrame(),
+ "dialog.confirm.overwrite.file.title", //$NON-NLS-1$
+ keys);
+ }
+ if (save) {
+ m_controller.updateModel();
+ DvdManager.singleton().save(file);
+ m_controller.saved(file.getName());
+ }
+ } catch (DvdPersistenceException dpe) {
+ DvdDialogs.showError(frame, dpe.getMessage());
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdShowWaitingDialogAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdShowWaitingDialogAction.java
new file mode 100644
index 000000000..85d74fc96
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdShowWaitingDialogAction.java
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.JProgressBar;
+import javax.swing.WindowConstants;
+
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This is the action class for showing a waiting dialog.
+ * The dialog is mandatory and disappears after SECONDS_TO_WAIT seconds.
+ *
+ * @author BREDEX GmbH
+ * @created 27.02.2008
+ */
+public class DvdShowWaitingDialogAction extends AbstractAction {
+
+ /** the number of seconds to wait for closing the dialog */
+ private static final transient int SECONDS_TO_WAIT = 6;
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ */
+ public DvdShowWaitingDialogAction(String name,
+ DvdMainFrameController controller) {
+
+ super(name);
+ m_controller = controller;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ JFrame frame = m_controller.getDvdMainFrame();
+ final JDialog dialog =
+ new JDialog(frame,
+ Resources.getString("waiting.dialog.title"), //$NON-NLS-1$
+ true);
+ Container contentPane = dialog.getContentPane();
+ JLabel messageText = new JLabel(
+ Resources.getString("waiting.dialog.message")); //$NON-NLS-1$
+ final JProgressBar progressBar = new JProgressBar();
+
+ progressBar.setIndeterminate(false);
+ contentPane.setLayout(new BorderLayout());
+ contentPane.add(messageText, BorderLayout.NORTH);
+ contentPane.add(progressBar, BorderLayout.SOUTH);
+ dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+ dialog.setResizable(false);
+ int width = 150;
+ int height = 60;
+ int xPos = frame.getX() + (frame.getWidth() / 2) - (width / 2);
+ int yPos = frame.getY() + (frame.getHeight() / 2) - (height / 2);
+ dialog.setSize(width, height);
+ dialog.setLocation(xPos, yPos);
+
+ Thread waitThread = new Thread() {
+ public void run() {
+ try {
+ for (int i = 0; i <= 100; i++) {
+ progressBar.setValue(i);
+ Thread.sleep(10 * SECONDS_TO_WAIT);
+ }
+ } catch (InterruptedException ex) {
+ // allow interruption
+ } finally {
+ dialog.hide();
+ }
+ }
+ };
+
+ waitThread.start();
+ dialog.show();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTabPlacementAction.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTabPlacementAction.java
new file mode 100644
index 000000000..1778b25e8
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTabPlacementAction.java
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+
+/**
+ * This is the action class for setting the tab placement.
+ *
+ * @author BREDEX GmbH
+ * @created 07.02.2008
+ */
+public class DvdTabPlacementAction extends AbstractAction {
+
+ /** the controller of the main frame */
+ private transient DvdMainFrameController m_controller;
+
+ /** the tab placement defined by constant from JTabbedPane */
+ private transient int m_tabPlacement;
+
+ /**
+ * public constructor
+ * @param name the text to display
+ * @param controller the controller of the main frame
+ * @param tabPlacement the tab placement to set using constant
+ * from JTabbedPane
+ */
+ public DvdTabPlacementAction(String name,
+ DvdMainFrameController controller, int tabPlacement) {
+
+ super(name);
+ m_controller = controller;
+ m_tabPlacement = tabPlacement;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void actionPerformed(ActionEvent e) {
+ DvdManager.singleton().changeTabPlacement(m_controller, m_tabPlacement);
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTableController.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTableController.java
new file mode 100644
index 000000000..a76b91f3e
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTableController.java
@@ -0,0 +1,284 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import javax.swing.JPopupMenu;
+import javax.swing.JTable;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdContentPanel;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdTableModel;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdTechMainPanel;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdTechPanel;
+import org.eclipse.jubula.examples.aut.dvdtool.model.Dvd;
+
+
+/**
+ * This is the controller class for the table.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DvdTableController implements ListSelectionListener {
+ /** empty string */
+ private static final String EMPTY_STRING = ""; //$NON-NLS-1$
+
+ /** the main frame contoller, holding the actions, etc. */
+ private final DvdMainFrameController m_controller;
+
+ /** the table, set by the constructor */
+ private final JTable m_table;
+
+ /** a dvd model instance, see valueChanged() */
+ private Dvd m_dvd = null;
+
+ /**
+ * public constructor
+ *
+ * @param mainFrameController
+ * the controller of the main frame
+ */
+ public DvdTableController(DvdMainFrameController mainFrameController) {
+ m_controller = mainFrameController;
+ m_table = mainFrameController.getDvdMainFrame().getTable();
+
+ init();
+ }
+
+ /**
+ * private method for initialisation
+ */
+ private void init() {
+ m_table.getSelectionModel().addListSelectionListener(this);
+ m_table.addMouseListener(new PopupListener(createPopupMenu()));
+
+ enablePanels(false);
+ }
+
+ /**
+ * updates the panels to display <code>dvd</code>
+ *
+ * @param dvd
+ * an instance of the model, will not be changed
+ */
+ private void updatePanels(Dvd dvd) {
+ DvdContentPanel contentPanel = m_controller.getDvdMainFrame()
+ .getDvdContentPanel();
+ DvdTechMainPanel techMainPanel = m_controller.getDvdMainFrame()
+ .getDvdTechMainPanel();
+ DvdTechPanel techPanel = techMainPanel.getDvdTechPanel();
+
+ if (dvd != null) {
+ contentPanel.getTextFieldChapters().setText(
+ String.valueOf(dvd.getChapters()));
+ contentPanel.getTextAreaDescription().setText(dvd.getDescription());
+ switch (dvd.getFsk()) {
+ case Dvd.FSK_6:
+ contentPanel.getRadioButtonFsk6().setSelected(true);
+ break;
+ case Dvd.FSK_16:
+ contentPanel.getRadioButtonFsk16().setSelected(true);
+ break;
+ case Dvd.FSK_18:
+ contentPanel.getRadioButtonFsk18().setSelected(true);
+ break;
+ default:
+ // do nothing
+ }
+
+ techMainPanel.getListLanguages().setSelectedIndices(
+ dvd.getLanguages());
+
+ techPanel.getTextFieldLength().setText(
+ String.valueOf(dvd.getLength()));
+ techPanel.getCheckBoxBonus().setSelected(dvd.hasBonus());
+ techPanel.getComboBoxRegionCode().setSelectedIndex(
+ dvd.getRegionCode());
+
+ enablePanels(true);
+ } else {
+ clearPanels();
+ enablePanels(false);
+ }
+ }
+
+ /**
+ * enables or disables the panels
+ *
+ * @param enable
+ * flag foe enable or disable
+ */
+ private void enablePanels(boolean enable) {
+ DvdContentPanel contentPanel = m_controller.getDvdMainFrame()
+ .getDvdContentPanel();
+ DvdTechMainPanel techMainPanel = m_controller.getDvdMainFrame()
+ .getDvdTechMainPanel();
+ DvdTechPanel techPanel = techMainPanel.getDvdTechPanel();
+
+ contentPanel.getTextFieldChapters().setEditable(enable);
+ contentPanel.getTextAreaDescription().setEditable(enable);
+ contentPanel.getRadioButtonFsk6().setEnabled(enable);
+ contentPanel.getRadioButtonFsk16().setEnabled(enable);
+ contentPanel.getRadioButtonFsk18().setEnabled(enable);
+
+ techMainPanel.getListLanguages().setEnabled(enable);
+
+ techPanel.getTextFieldLength().setEditable(enable);
+ techPanel.getCheckBoxBonus().setEnabled(enable);
+ techPanel.getComboBoxRegionCode().setEnabled(enable);
+ }
+
+ /**
+ * clears the fields of the detail panels
+ */
+ private void clearPanels() {
+ DvdContentPanel contentPanel = m_controller.getDvdMainFrame()
+ .getDvdContentPanel();
+ DvdTechMainPanel techMainPanel = m_controller.getDvdMainFrame()
+ .getDvdTechMainPanel();
+ DvdTechPanel techPanel = techMainPanel.getDvdTechPanel();
+
+ contentPanel.getTextFieldChapters().setText(EMPTY_STRING);
+ contentPanel.getTextAreaDescription().setText(EMPTY_STRING);
+ contentPanel.getRadioButtonDummy().setSelected(true);
+
+ techMainPanel.getListLanguages().clearSelection();
+
+ techPanel.getTextFieldLength().setText(EMPTY_STRING);
+ techPanel.getCheckBoxBonus().setSelected(false);
+ techPanel.getComboBoxRegionCode().setSelectedIndex(0);
+ }
+
+ /**
+ * puts the current displayed dvd to the model
+ */
+ public void updateModel() {
+ updateModel(m_dvd);
+ }
+
+ /**
+ * puts the diplayed dvd to the given model <code>dvd</code>
+ *
+ * @param dvd
+ * an instance of the model, will holding the displayed data
+ */
+ private void updateModel(Dvd dvd) {
+ if (m_table.isEditing() && !m_table.getCellEditor().stopCellEditing()) {
+ m_table.getCellEditor().cancelCellEditing();
+ }
+ if (dvd != null) {
+ DvdContentPanel contentPanel = m_controller.getDvdMainFrame()
+ .getDvdContentPanel();
+ DvdTechMainPanel techMainPanel = m_controller.getDvdMainFrame()
+ .getDvdTechMainPanel();
+ DvdTechPanel techPanel = techMainPanel.getDvdTechPanel();
+
+ try {
+ dvd.setChapters(Integer.parseInt(contentPanel
+ .getTextFieldChapters().getText()));
+ } catch (NumberFormatException nfe) { // NOPMD by zeb on 10.04.07 14:08
+ // Do nothing: This keeps the previous value of chapters
+ }
+ dvd.setDescription(contentPanel.getTextAreaDescription().getText());
+ if (contentPanel.getRadioButtonFsk6().isSelected()) {
+ dvd.setFsk(Dvd.FSK_6);
+ } else if (contentPanel.getRadioButtonFsk16().isSelected()) {
+ dvd.setFsk(Dvd.FSK_16);
+ } else {
+ dvd.setFsk(Dvd.FSK_18);
+ }
+
+ dvd.setLanguages(techMainPanel.getListLanguages()
+ .getSelectedIndices());
+
+ try {
+ dvd.setLength(Integer.parseInt(techPanel.getTextFieldLength()
+ .getText()));
+ } catch (NumberFormatException nfe) { // NOPMD by zeb on 10.04.07 14:08
+ // Do nothing: This keeps the previous value of text field length
+ }
+ dvd.setBonus(techPanel.getCheckBoxBonus().isSelected());
+ dvd.setRegionCode(techPanel.getComboBoxRegionCode()
+ .getSelectedIndex());
+
+ m_controller.setChanged(true);
+ }
+ }
+
+ /**
+ * enables / disable the actions, depending on the selection of dvd table
+ * @param enable indicates whether actions should be enabled or disabled
+ */
+ private void updateActions(boolean enable) {
+ m_controller.getRemoveDvdAction().setEnabled(enable);
+ m_controller.getAddLanguageAction().setEnabled(enable);
+ m_controller.getClearDescriptionAction().setEnabled(enable);
+ m_controller.getCopyChapterTextAction().setEnabled(enable);
+ m_controller.getCopyChapterLabelAction().setEnabled(enable);
+ m_controller.getCopyBonusValueAction().setEnabled(enable);
+ m_controller.getCopyFsk6ButtonAction().setEnabled(enable);
+ m_controller.getCopyFsk16ButtonAction().setEnabled(enable);
+ m_controller.getCopyFsk18ButtonAction().setEnabled(enable);
+ m_controller.getChangeTabSelectionAction().setEnabled(enable);
+
+ // the remove language action depends on language list selection
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void valueChanged(ListSelectionEvent e) {
+ if (!e.getValueIsAdjusting()) {
+ // it's the dvd, which was selected before !
+ updateModel(m_dvd);
+ if (!m_table.getSelectionModel().isSelectionEmpty()) {
+ DvdTableModel tm = (DvdTableModel) m_table.getModel();
+ m_dvd = tm.getDvd(m_table.getSelectedRow());
+ updateActions(true);
+ } else {
+ updateActions(false);
+ m_dvd = null;
+ }
+ updatePanels(m_dvd);
+ }
+ }
+
+ /**
+ * @return Returns the dvd.
+ */
+ public Dvd getDvd() {
+ return m_dvd;
+ }
+
+ /**
+ * sets the enable state for all dvds
+ * @param enableState the enable state to be set for all dvds
+ */
+ public void setAllDvdsEnableState(boolean enableState) {
+ if (!enableState) {
+ m_table.getSelectionModel().clearSelection();
+ }
+ m_table.setEnabled(enableState);
+ }
+
+ /**
+ * Creates the popupmenu
+ * @return the popupmenu
+ */
+ private JPopupMenu createPopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_controller.getAddDvdAction());
+ pm.add(m_controller.getRemoveDvdAction());
+ return pm;
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTableTransferHandler.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTableTransferHandler.java
new file mode 100644
index 000000000..6f2ff5252
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTableTransferHandler.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import javax.swing.JComponent;
+import javax.swing.JTable;
+
+/**
+ * The instances of this class handle transfer operations of String arrays
+ * in JTable objects.
+ * The source table row of the transfer operation is copied over the target
+ * table row.
+ *
+ * (Needed for supporting 'drag and drop' feature in the dvd table.)
+ *
+ * @author BREDEX GmbH
+ * @created 06.02.2008
+ */
+public class DvdTableTransferHandler extends StringArrayTransferHandler {
+
+ /**
+ * {@inheritDoc}
+ */
+ protected String[] exportStringArray(JComponent c) {
+ JTable table = (JTable)c;
+ int row = table.getSelectedRow();
+
+ String[] strArray = new String[table.getColumnCount()];
+ for (int i = 0; i < strArray.length; i++) {
+ strArray[i] = table.getValueAt(row, i).toString();
+ }
+
+ return strArray;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected void importStringArray(JComponent c, String[] strArray) {
+ JTable table = (JTable)c;
+ int row = table.getSelectedRow();
+
+ for (int i = 0; i < strArray.length; i++) {
+ table.getModel().setValueAt(strArray[i], row, i);
+ }
+ table.repaint();
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeController.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeController.java
new file mode 100644
index 000000000..a6d1ea115
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeController.java
@@ -0,0 +1,445 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JPopupMenu;
+import javax.swing.JTable;
+import javax.swing.JTree;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.Constants;
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdMainFrame;
+import org.eclipse.jubula.examples.aut.dvdtool.model.Dvd;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdCategory;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdDataObject;
+
+
+/**
+ * This is the controller class for the tree.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DvdTreeController {
+ /** the main frame contoller, holding the actions, etc. */
+ private DvdMainFrameController m_controller;
+
+ /** the tree selection listener */
+ private TreeSelectionListener m_treeSelectionListener =
+ new MyTreeSelectionListener();
+
+ /**
+ * public constructor, initialises this controller
+ *
+ * @param mainFrameController
+ * the controller of the main frame
+ */
+ public DvdTreeController(DvdMainFrameController mainFrameController) {
+ m_controller = mainFrameController;
+
+ init();
+ }
+
+ /**
+ * build up the tree from a DvdCategory
+ *
+ * @param root
+ * a dvd cytegory representing the root of the tree
+ */
+ public void createTree(DvdCategory root) {
+ DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(
+ new DvdDataObject(root));
+
+ recCreateTree(rootNode, root);
+
+ // set the model
+ removeTreeSelectionListener();
+ JTree tree = getTree();
+ tree.setModel(new DefaultTreeModel(rootNode));
+
+ addTreeSelectionListener();
+ tree.setSelectionRow(0);
+ }
+
+ /**
+ * adds a <code>dvd</code> to the currently selected category, updates the model
+ *
+ * @param dvd
+ * the dvd to add
+ */
+ public void addDvd(Dvd dvd) {
+ TreePath selectionPath = getTree().getSelectionModel()
+ .getLeadSelectionPath();
+
+ if (selectionPath != null) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectionPath
+ .getLastPathComponent();
+
+ // update DvdCategory
+ DvdDataObject data = (DvdDataObject) node.getUserObject();
+ data.addDvd(dvd);
+
+ m_controller.setChanged(true);
+
+ // update the table model
+ m_controller.getDvdMainFrame().getTable().setModel(
+ data.getTableModel());
+ m_controller.getDvdMainFrame().showCard(DvdMainFrame.CARD_DATA);
+ }
+
+ JTable table = m_controller.getDvdMainFrame().getTable();
+ table.requestFocus();
+ table.setEditingColumn(0);
+ table.setEditingRow(table.getRowCount() - 1);
+ int row = table.getEditingRow();
+ table.setColumnSelectionInterval(0, 0);
+ table.setRowSelectionInterval(row, row);
+ }
+
+
+ /**
+ * removes <code>dvd</code> from the current selected category
+ * @param dvd the dvd to remove
+ */
+ public void removeDvd(Dvd dvd) {
+ TreePath selectionPath = getTree().getSelectionModel()
+ .getLeadSelectionPath();
+
+ if (selectionPath != null) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectionPath
+ .getLastPathComponent();
+
+ // update DvdCategory
+ DvdDataObject data = (DvdDataObject) node.getUserObject();
+ data.removeDvd(dvd);
+
+ m_controller.setChanged(true);
+
+ // update the table model
+ updateTable(data);
+
+ showCard(data);
+ m_controller.getDvdMainFrame().getTreePanel().getTree().repaint();
+ }
+ }
+
+ /**
+ * sets the model from <code>data</code> to the table
+ *
+ * @param data
+ * the DvdDataObject containing the tablemodel
+ */
+ private void updateTable(DvdDataObject data) {
+ m_controller.getDvdMainFrame().getTable().setModel(
+ data.getTableModel());
+ boolean categoryEnabled = isCurrentCategoryEnabled();
+ m_controller.getTableController().setAllDvdsEnableState(
+ categoryEnabled);
+ }
+
+
+ /**
+ * determine the and shows the card depending on <code>data</code>
+ *
+ * @param data
+ * the DvdDataObject
+ */
+ private void showCard (DvdDataObject data) {
+ if (data.hasDvds()) {
+ m_controller.getDvdMainFrame().showCard(
+ DvdMainFrame.CARD_DATA);
+ } else {
+ m_controller.getDvdMainFrame().showCard(
+ DvdMainFrame.CARD_LOGO);
+ }
+ }
+
+ /**
+ * creates and adds a new category with the <code>name</code> to each
+ * selected category, updates the model
+ *
+ * @param name
+ * the name for the category to create and add
+ */
+ public void addNewCategoryToSelectedCategories(String name) {
+ TreePath[] selectionPathArray = getTree().getSelectionModel()
+ .getSelectionPaths();
+
+ for (int i = 0; i < selectionPathArray.length; i++) {
+ TreePath path = selectionPathArray[i];
+
+ if (path != null) {
+ DefaultMutableTreeNode node =
+ (DefaultMutableTreeNode) path.getLastPathComponent();
+ DvdCategory category = new DvdCategory(name);
+ addCategory(node, category);
+ }
+ }
+ }
+
+ /**
+ * adds a <code>category</code> to the given category <code>node</code>,
+ * updates the model
+ *
+ * @param node
+ * the category node to add to
+ * @param category
+ * the category to add
+ */
+ private void addCategory(DefaultMutableTreeNode node,
+ DvdCategory category) {
+
+ // update DvdCategory
+ DvdDataObject data = (DvdDataObject) node.getUserObject();
+ DvdCategory cat = data.getCategory();
+ cat.insert(category);
+
+ m_controller.setChanged(true);
+
+ // update tree model
+ DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(
+ new DvdDataObject(category));
+
+ JTree tree = getTree();
+ ((DefaultTreeModel) tree.getModel()).insertNodeInto(newNode, node,
+ node.getChildCount());
+
+
+ // expand the node and make the new node visible
+ tree.expandPath(new TreePath(node.getPath()));
+ tree.scrollPathToVisible(new TreePath(newNode.getPath()));
+ }
+
+ /**
+ * removes the current selected category, updates the model
+ */
+ public void removeCurrentCategory() {
+ TreePath selectionPath = getTree().getSelectionModel()
+ .getLeadSelectionPath();
+
+ if (selectionPath != null) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectionPath
+ .getLastPathComponent();
+ DefaultMutableTreeNode parent = (DefaultMutableTreeNode) node
+ .getParent();
+ DvdDataObject data = (DvdDataObject) node.getUserObject();
+
+ // update DvdCategory
+ DvdCategory toRemove = data.getCategory();
+ if (toRemove.getParent() != null) {
+ toRemove.getParent().remove(toRemove);
+ m_controller.setChanged(true);
+ }
+
+ // update tree model
+ if (parent != null) {
+ JTree tree = getTree();
+ ((DefaultTreeModel) tree.getModel()).removeNodeFromParent(node);
+ // select the parent of the removed node
+ TreePath parentPath = new TreePath(parent.getPath());
+ tree.setSelectionPath(parentPath);
+ tree.scrollPathToVisible(parentPath);
+ }
+ }
+ }
+
+ /**
+ * create the recursivly
+ *
+ * @param parent
+ * the node to insert childs
+ * @param category
+ * the category reprented by <code>parent</code>
+ */
+ private void recCreateTree(DefaultMutableTreeNode parent,
+ DvdCategory category) {
+
+ List children = category.getCategories();
+ for (Iterator iter = children.iterator(); iter.hasNext();) {
+ DvdCategory element = (DvdCategory) iter.next();
+
+ DvdDataObject data = new DvdDataObject(element);
+ DefaultMutableTreeNode newChild = new DefaultMutableTreeNode(
+ data);
+ parent.add(newChild);
+
+ recCreateTree(newChild, element);
+ }
+ }
+
+ /**
+ * Creates the popupmenu
+ * @return the popupmenu
+ */
+ private JPopupMenu createPopupMenu() {
+ JPopupMenu pm = new JPopupMenu();
+ pm.add(m_controller.getAddCategoryAction());
+ pm.add(m_controller.getEnableCategoryAction());
+ pm.add(m_controller.getDisableCategoryAction());
+ pm.add(m_controller.getRemoveCategoryAction());
+ pm.add(m_controller.getAddDvdAction());
+ return pm;
+ }
+
+ /**
+ * private method for initialisation
+ */
+ private void init() {
+ JTree tree = getTree();
+
+ tree.getSelectionModel().setSelectionMode(
+ TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
+
+ DvdCategory category = new DvdCategory(Constants.TREE_ROOT_NAME);
+ DefaultMutableTreeNode node = new DefaultMutableTreeNode(
+ new DvdDataObject(category));
+
+ tree.setModel(new DefaultTreeModel(node));
+ addTreeSelectionListener();
+
+ tree.addMouseListener(new PopupListener(createPopupMenu()));
+
+ tree.setSelectionRow(0);
+
+ // create and install the 'drag and drop' listeners
+ new DvdTreeDragSource(tree);
+ new DvdTreeDropTarget(tree);
+
+ DvdManager.singleton().setRootCategory(category);
+ }
+
+ /**
+ * adds the tree selection listener
+ */
+ private void addTreeSelectionListener() {
+ getTree().addTreeSelectionListener(m_treeSelectionListener);
+ }
+
+ /**
+ * removes the tree selection listener
+ */
+ private void removeTreeSelectionListener() {
+ getTree().removeTreeSelectionListener(m_treeSelectionListener);
+ }
+
+ /**
+ * returns the controlled tree
+ * @return the controlled tree
+ */
+ private JTree getTree() {
+ return m_controller.getDvdMainFrame().getTreePanel().getTree();
+ }
+
+ /**
+ * inner class used as TreeSelectionListener
+ *
+ * @author BREDEX GmbH
+ * @created 14.04.2005
+ */
+ private class MyTreeSelectionListener implements TreeSelectionListener {
+ /**
+ * listens to selection changes in the tree, updates the table, displays
+ * the table / logo, enables/disables the actions AddCategory,
+ * RemoveCategory, AddDvd and RemoveDvd
+ *
+ * {@inheritDoc}
+ */
+ public void valueChanged(TreeSelectionEvent e) {
+ boolean multipleTreeSelections =
+ (getTree().getSelectionCount() > 1);
+
+ TreePath newLeadSelectionPath = e.getNewLeadSelectionPath();
+
+ if (newLeadSelectionPath != null) {
+ // selection changed
+ // first store the data into the model
+ m_controller.updateModel();
+
+ // and then update the table
+ Object o = newLeadSelectionPath.getLastPathComponent();
+
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) o;
+ DvdDataObject data = (DvdDataObject) node
+ .getUserObject();
+
+ updateTable(data);
+ showCard(data);
+
+ // enable / disable the actions
+ m_controller.getAddCategoryAction().setEnabled(true);
+ if (data.hasParent()) {
+ m_controller.getRemoveCategoryAction().setEnabled(
+ !multipleTreeSelections);
+ } else {
+ m_controller.getRemoveCategoryAction().setEnabled(false);
+ }
+
+ m_controller.updateDisableOrEnableActions();
+
+ // other actions depend on table selection, see table controller
+
+ } else {
+ // nothing selected
+ m_controller.getAddCategoryAction().setEnabled(false);
+ m_controller.getEnableCategoryAction().setEnabled(false);
+ m_controller.getDisableCategoryAction().setEnabled(false);
+ m_controller.getRemoveCategoryAction().setEnabled(false);
+ m_controller.getAddDvdAction().setEnabled(false);
+
+ // other actions depend on table selection, see table controller
+ }
+ }
+ }
+
+ /**
+ * sets the enable state of the current selected category
+ * @param enable the enable state to set
+ */
+ public void setCurrentCategoryEnableState(boolean enable) {
+ TreePath selectionPath = getTree().getSelectionModel()
+ .getLeadSelectionPath();
+
+ if (selectionPath != null) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectionPath
+ .getLastPathComponent();
+ DvdDataObject data = (DvdDataObject) node.getUserObject();
+ data.getCategory().setEnabled(enable);
+ }
+ }
+
+ /**
+ * returns the enable state of the current selected category
+ * @return the enable state of the current selected category
+ */
+ public boolean isCurrentCategoryEnabled() {
+ TreePath selectionPath = getTree().getSelectionModel()
+ .getLeadSelectionPath();
+ boolean enableState = true;
+
+ if (selectionPath != null) {
+ DefaultMutableTreeNode node = (DefaultMutableTreeNode) selectionPath
+ .getLastPathComponent();
+ DvdDataObject data = (DvdDataObject) node.getUserObject();
+ enableState = data.getCategory().isEnabled();
+ }
+
+ return enableState;
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeDragSource.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeDragSource.java
new file mode 100644
index 000000000..966aa9321
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeDragSource.java
@@ -0,0 +1,127 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DragSourceDragEvent;
+import java.awt.dnd.DragSourceDropEvent;
+import java.awt.dnd.DragSourceEvent;
+import java.awt.dnd.DragSourceListener;
+
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdCategory;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdDataObject;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdTransferableCategory;
+
+
+/**
+ * A drag source wrapper for a JTree. This class can be used to control
+ * a rearrangeable tree.
+ * The drag gestures MOVE and COPY are both handled with the 'drag and drop'
+ * action MOVE.
+ *
+ * @author BREDEX GmbH
+ * @created 05.02.2008
+ */
+public class DvdTreeDragSource implements DragSourceListener,
+ DragGestureListener {
+
+ /** the supported action type, both are treated as MOVE */
+ private static final int ACTION_TYPE = DnDConstants.ACTION_COPY_OR_MOVE;
+
+ /** the tree to be controlled */
+ private final JTree m_tree;
+ /** the corresponding DragSource */
+ private final DragSource m_source;
+
+ /** the object to be transferred */
+ private DvdTransferableCategory m_transferable;
+ /** the node to be dragged */
+ private DefaultMutableTreeNode m_draggedNode;
+
+ /**
+ * public constructor
+ * @param tree The tree to be controlled
+ */
+ public DvdTreeDragSource(JTree tree) {
+ m_tree = tree;
+ m_source = new DragSource();
+ m_source.createDefaultDragGestureRecognizer(m_tree, ACTION_TYPE, this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dragGestureRecognized(DragGestureEvent dge) {
+ TreePath path = m_tree.getLeadSelectionPath();
+ if ((path == null) || (path.getPathCount() <= 1)) {
+ // We cannot move the root node or an empty selection
+ return;
+ }
+ m_draggedNode = (DefaultMutableTreeNode) path.getLastPathComponent();
+ m_transferable = new DvdTransferableCategory(path);
+ m_source.startDrag(dge, DragSource.DefaultMoveDrop,
+ m_transferable, this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dragDropEnd(DragSourceDropEvent dsde) {
+ if (dsde.getDropSuccess()) {
+ ((DefaultTreeModel) m_tree.getModel())
+ .removeNodeFromParent(m_draggedNode);
+ DvdDataObject dataObject =
+ (DvdDataObject) m_draggedNode.getUserObject();
+ DvdCategory toRemove = dataObject.getCategory();
+
+ if (toRemove.getParent() != null) {
+ toRemove.getParent().remove(toRemove);
+ }
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dragEnter(DragSourceDragEvent dsde) {
+ // no action
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dragExit(DragSourceEvent dse) {
+ // no action
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dragOver(DragSourceDragEvent dsde) {
+ // no action
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dropActionChanged(DragSourceDragEvent dsde) {
+ // no action
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeDropTarget.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeDropTarget.java
new file mode 100644
index 000000000..acfbefb09
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/DvdTreeDropTarget.java
@@ -0,0 +1,208 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.Point;
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetContext;
+import java.awt.dnd.DropTargetDragEvent;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetEvent;
+import java.awt.dnd.DropTargetListener;
+
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreePath;
+
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdCategory;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdDataObject;
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdTransferableCategory;
+
+
+/**
+ * A drop target wrapper for a JTree. This class can be used to control
+ * a rearrangeable tree.
+ * The operation MOVE is the only supported 'drag and drop' action type.
+ *
+ * @author BREDEX GmbH
+ * @created 05.02.2008
+ */
+public class DvdTreeDropTarget implements DropTargetListener {
+
+ /** the supported action type */
+ private static final int ACTION_TYPE = DnDConstants.ACTION_MOVE;
+
+ /**
+ * public constructor
+ * @param tree The tree to be controlled
+ */
+ public DvdTreeDropTarget(JTree tree) {
+ new DropTarget(tree, this);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void drop(DropTargetDropEvent dtde) {
+ Point pt = dtde.getLocation();
+ DropTargetContext dtc = dtde.getDropTargetContext();
+ JTree tree = (JTree) dtc.getComponent();
+ TreePath parentpath = tree.getClosestPathForLocation(pt.x, pt.y);
+ DefaultMutableTreeNode newParent = (DefaultMutableTreeNode) parentpath
+ .getLastPathComponent();
+ try {
+ Transferable tr = dtde.getTransferable();
+ DataFlavor[] flavors = tr.getTransferDataFlavors();
+ for (int i = 0; i < flavors.length; i++) {
+ if (tr.isDataFlavorSupported(flavors[i])) {
+ DvdTransferableCategory transferableTreePath =
+ (DvdTransferableCategory)tr.getTransferData(flavors[i]);
+ DefaultTreeModel model = (DefaultTreeModel) tree.getModel();
+ DvdCategory draggedNodeCategory =
+ transferableTreePath.getCategory();
+ int draggedNodeHashCode =
+ transferableTreePath.getNodeHashCode();
+
+ // create dragged node and all subnodes of it using
+ // the transferred data in 'draggedNodeCategory'
+ DefaultMutableTreeNode draggedNode =
+ createNodeWithSubTreeForCategory(model,
+ draggedNodeCategory);
+
+ // check, whether the drop operation is allowed
+ // (dropping a node to itself or any subnode is forbidden)
+ DefaultMutableTreeNode nodeToCheck = newParent;
+ do {
+ if (isNodeEqualToDraggedNode(nodeToCheck, draggedNode,
+ draggedNodeHashCode)) {
+
+ dtde.rejectDrop();
+ return;
+ }
+ // check parent node next
+ nodeToCheck =
+ (DefaultMutableTreeNode) nodeToCheck.getParent();
+
+ } while (nodeToCheck != null);
+
+ dtde.acceptDrop(ACTION_TYPE);
+
+ // add to data model of new parent
+ DvdDataObject newParentData =
+ (DvdDataObject) newParent.getUserObject();
+ DvdCategory newParentCategory =
+ newParentData.getCategory();
+ newParentCategory.insert(draggedNodeCategory);
+
+ // add to new parent node as last child
+ model.insertNodeInto(draggedNode, newParent,
+ newParent.getChildCount());
+
+ // select dragged node
+ tree.setSelectionPath(new TreePath(draggedNode.getPath()));
+
+ dtde.dropComplete(true);
+ return;
+ }
+ }
+ dtde.rejectDrop();
+ } catch (Exception e) {
+ dtde.rejectDrop();
+ }
+ }
+
+ /**
+ * Creates a node and all needed subnodes for the given DvdCategory.
+ * The given tree model is updated.
+ *
+ * @param category The data to be used for node creation
+ * @param model The tree model to be updated
+ * @return the created node containing the given data
+ */
+ private DefaultMutableTreeNode createNodeWithSubTreeForCategory(
+ DefaultTreeModel model,
+ DvdCategory category) {
+
+ DefaultMutableTreeNode node =
+ new DefaultMutableTreeNode(new DvdDataObject(category));
+
+ // create all sub nodes
+ for (int i = 0; i < category.getCategories().size(); i++) {
+ DvdCategory childCategory =
+ (DvdCategory) category.getCategories().get(i);
+
+ // do recursive call
+ DefaultMutableTreeNode childNode =
+ createNodeWithSubTreeForCategory(model, childCategory);
+
+ // add to new child node to new node
+ model.insertNodeInto(childNode, node, node.getChildCount());
+ }
+ return node;
+ }
+
+ /**
+ * Compares two nodes using the string representation and the hash codes.
+ * Nodes are equal only if both kinds of values are equal.
+ * (The draggedNode might be newly created after deserialization, so its
+ * original hash code must be given and cannot be retrieved from the node.)
+ *
+ * @param node The node to be compared to 'draggedNode'
+ * @param draggedNode The node to be compared to 'node'
+ * @param draggedNodeHashCode The original hash code of 'draggedNode'
+ * before it has been serialized
+ * @return boolean indicating whether both DefaultMutableTreeNodes are equal
+ */
+ private boolean isNodeEqualToDraggedNode(DefaultMutableTreeNode node,
+ DefaultMutableTreeNode draggedNode,
+ int draggedNodeHashCode) {
+ // compare string representation of the nodes
+ if (node.toString().equals(draggedNode.toString())) {
+ // compare hash code of the nodes
+ return (node.hashCode() == draggedNodeHashCode);
+ }
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dragEnter(DropTargetDragEvent dtde) {
+ dtde.acceptDrag(ACTION_TYPE);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dragOver(DropTargetDragEvent dtde) {
+ dtde.acceptDrag(ACTION_TYPE);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dragExit(DropTargetEvent dte) {
+ // no action
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void dropActionChanged(DropTargetDragEvent dtde) {
+ // no action
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/PopupListener.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/PopupListener.java
new file mode 100644
index 000000000..1dbdf7b3e
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/PopupListener.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+
+import javax.swing.JPopupMenu;
+
+/**
+ * This class shows a popup menu when it is triggered by a mouse event.
+ *
+ * @author BREDEX GmbH
+ * @created 15.02.2008
+ */
+public class PopupListener extends MouseAdapter {
+
+ /** popup menu to be shown */
+ private JPopupMenu m_popupMenu;
+
+ /**
+ * public constructor, initialises this listener
+ *
+ * @param popupMenu
+ * the popup menu to be shown when popup is triggered
+ */
+ public PopupListener(JPopupMenu popupMenu) {
+ m_popupMenu = popupMenu;
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void mousePressed(MouseEvent event) {
+ maybeShowPopup(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void mouseReleased(MouseEvent event) {
+ maybeShowPopup(event);
+ }
+
+ /**
+ * Shows a popupmenu if the mouseevent is a popup trigger
+ * @param event a mouseevent
+ */
+ private void maybeShowPopup(MouseEvent event) {
+ if (event.isPopupTrigger()) {
+ m_popupMenu.show(event.getComponent(), event.getX(), event
+ .getY());
+ }
+ }
+
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/StringArrayTransferHandler.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/StringArrayTransferHandler.java
new file mode 100644
index 000000000..92ee212fd
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/StringArrayTransferHandler.java
@@ -0,0 +1,89 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+
+import javax.swing.JComponent;
+import javax.swing.TransferHandler;
+
+import org.eclipse.jubula.examples.aut.dvdtool.model.StringArraySelection;
+
+
+/**
+ * This abstract class is for handling transfer operations of String arrays.
+ *
+ * @author BREDEX GmbH
+ * @created 06.02.2008
+ */
+abstract class StringArrayTransferHandler extends TransferHandler {
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean importData(JComponent c, Transferable t) {
+ if (canImport(c, t.getTransferDataFlavors())) {
+ try {
+ String[] strArray =
+ (String[])t.getTransferData(DataFlavor.stringFlavor);
+ importStringArray(c, strArray);
+ return true;
+ } catch (UnsupportedFlavorException ufe) {
+ throw new RuntimeException(ufe);
+ } catch (IOException ioe) {
+ throw new RuntimeException(ioe);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean canImport(JComponent c, DataFlavor[] flavors) {
+ for (int i = 0; i < flavors.length; i++) {
+ if (DataFlavor.stringFlavor.equals(flavors[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Transferable createTransferable(JComponent c) {
+ return new StringArraySelection(exportStringArray(c));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getSourceActions(JComponent c) {
+ return COPY;
+ }
+
+ /**
+ * @param c The component to retrieve the String array from
+ * @return the String array to be retrieved
+ */
+ protected abstract String[] exportStringArray(JComponent c);
+
+ /**
+ * @param c The component to write the given String array into
+ * @param strArray The String array to be written
+ */
+ protected abstract void importStringArray(JComponent c, String[] strArray);
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/StringTransferHandler.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/StringTransferHandler.java
new file mode 100644
index 000000000..e4813d598
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/control/StringTransferHandler.java
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.control;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.StringSelection;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.IOException;
+
+import javax.swing.JComponent;
+import javax.swing.TransferHandler;
+
+/**
+ * This abstract class is for handling transfer operations of Strings.
+ *
+ * @author BREDEX GmbH
+ * @created 06.02.2008
+ */
+abstract class StringTransferHandler extends TransferHandler {
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean importData(JComponent c, Transferable t) {
+ if (canImport(c, t.getTransferDataFlavors())) {
+ try {
+ String str =
+ (String)t.getTransferData(DataFlavor.stringFlavor);
+ importString(c, str);
+ return true;
+ } catch (UnsupportedFlavorException ufe) {
+ throw new RuntimeException(ufe);
+ } catch (IOException ioe) {
+ throw new RuntimeException(ioe);
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean canImport(JComponent c, DataFlavor[] flavors) {
+ for (int i = 0; i < flavors.length; i++) {
+ if (DataFlavor.stringFlavor.equals(flavors[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ protected Transferable createTransferable(JComponent c) {
+ return new StringSelection(exportString(c));
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getSourceActions(JComponent c) {
+ return COPY;
+ }
+
+ /**
+ * @param c The component to retrieve the String from
+ * @return the String to be retrieved
+ */
+ protected abstract String exportString(JComponent c);
+
+ /**
+ * @param c The component to write the given String into
+ * @param str The String to be written
+ */
+ protected abstract void importString(JComponent c, String str);
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/exception/DvdException.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/exception/DvdException.java
new file mode 100644
index 000000000..a45c5cac9
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/exception/DvdException.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.exception;
+
+/**
+ * The base class for all exceptions.
+ *
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdException extends Exception {
+
+ /** the nested exception */
+ private Exception m_exception = null;
+
+ /**
+ * public constructor
+ * @param message a message describing the exception
+ * @param exception a nested exception.
+ */
+ public DvdException(String message, Exception exception) {
+ super(message);
+
+ m_exception = exception;
+ }
+
+ /**
+ * @return Returns the exception.
+ */
+ public Exception getException() {
+ return m_exception;
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/Constants.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/Constants.java
new file mode 100644
index 000000000..3ee7d5a48
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/Constants.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+/**
+ * This class contains common constants for the dvd tool.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public final class Constants {
+
+ /** the suffix for saved dvd libraries */
+ public static final String SUFFIX = "dvd"; //$NON-NLS-1$
+
+ /** name of the root node */
+ public static final String TREE_ROOT_NAME = Resources.getString("category"); //$NON-NLS-1$
+ /** all languages */
+ static final String[] LANGUAGES = {
+ Resources.getString("language.german"), Resources.getString("language.english"), //$NON-NLS-1$ //$NON-NLS-2$
+ Resources.getString("language.french"), Resources.getString("language.italian"), Resources.getString("language.spanish") }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ /** all region codes */
+ static final String[] REGION_CODES = {
+ Resources.getString("region_code.rc0"), Resources.getString("region_code.rc1"), Resources.getString("region_code.rc2"), Resources.getString("region_code.rc3"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ Resources.getString("region_code.rc4"), Resources.getString("region_code.rc5"), Resources.getString("region_code.rc6"), Resources.getString("region_code.rc7") }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ /**
+ * private constructor, do not instantiate this class.
+ */
+ private Constants() {
+ // empty
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdContentPanel.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdContentPanel.java
new file mode 100644
index 000000000..d9b47daa9
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdContentPanel.java
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.JTextField;
+import javax.swing.border.TitledBorder;
+
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This class displays the 'content' information for a dvd.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DvdContentPanel extends JPanel {
+ /** the label for the chapter */
+ private JLabel m_labelChapters = new JLabel(Resources.getString("chapter")); //$NON-NLS-1$
+ /** the component (text field) displaying the chapter */
+ private JTextField m_tfChapters = new JTextField(5);
+ /** the label for the description */
+ private JLabel m_labelDescription = new JLabel(Resources.getString("description")); //$NON-NLS-1$
+ /** the component (text area) displaying the description */
+ private JTextArea m_taDescription = new JTextArea();
+ /** the panel displaying the rating radio buttons */
+ private JPanel m_fskPanel = new JPanel();
+ /** the radio button for fsk6 */
+ private JRadioButton m_rbFsk6 = new JRadioButton();
+ /** the radio button for fsk16 */
+ private JRadioButton m_rbFsk16 = new JRadioButton();
+ /** the radio button for fsk18 */
+ private JRadioButton m_rbFsk18 = new JRadioButton();
+ /** a non displayed radio button for clearing the other radio buttons */
+ private JRadioButton m_rbDummy = new JRadioButton();
+
+ /**
+ * public constructor, initialises the panel
+ */
+ public DvdContentPanel() {
+ super();
+ init();
+ }
+
+ /**
+ * private method creating GridBagConstraints, used for the layout
+ * @param x the x position
+ * @param y the y position
+ * @return a new instance of GridBagConstraints
+ */
+ private GridBagConstraints createGridBagConstraints(int x, int y) {
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.gridx = x;
+ gbc.gridy = y;
+ gbc.insets = new Insets(5, 5, 5, 5);
+ return gbc;
+ }
+
+ /**
+ * private method for initialisation
+ */
+ private void init() {
+ // set the layout
+ setLayout(new GridBagLayout());
+
+ m_rbFsk6.setText(Resources.getString("Rating1")); //$NON-NLS-1$
+ m_rbFsk16.setText(Resources.getString("Rating2")); //$NON-NLS-1$
+ m_rbFsk18.setText(Resources.getString("Rating3")); //$NON-NLS-1$
+ // put the radio buttons into a ButtonGroup
+ ButtonGroup bg = new ButtonGroup();
+ bg.add(m_rbFsk6);
+ bg.add(m_rbFsk16);
+ bg.add(m_rbFsk18);
+ bg.add(m_rbDummy);
+
+ // use a separate panel with a border for the radio buttons
+ TitledBorder border = BorderFactory.createTitledBorder(
+ BorderFactory.createEtchedBorder(), Resources.getString("Rating")); //$NON-NLS-1$
+ m_fskPanel.setBorder(border);
+ m_fskPanel.add(m_rbFsk6);
+ m_fskPanel.add(m_rbFsk16);
+ m_fskPanel.add(m_rbFsk18);
+
+ m_tfChapters.setDragEnabled(true);
+ m_taDescription.setDragEnabled(true);
+
+ // put all together
+ GridBagConstraints gbc = null;
+
+ gbc = createGridBagConstraints(0, 0);
+ m_labelChapters.setName("chapterLabel"); //$NON-NLS-1$
+ add(m_labelChapters, gbc);
+
+ gbc = createGridBagConstraints(1, 0);
+ gbc.anchor = GridBagConstraints.WEST;
+ m_tfChapters.setName("chapterText"); //$NON-NLS-1$
+ add(m_tfChapters, gbc);
+
+ gbc = createGridBagConstraints(0, 1);
+ gbc.anchor = GridBagConstraints.NORTHWEST;
+ gbc.gridwidth = 2;
+ add(m_fskPanel, gbc);
+
+ gbc = createGridBagConstraints(2, 0);
+ gbc.anchor = GridBagConstraints.WEST;
+ add(m_labelDescription, gbc);
+
+ gbc = createGridBagConstraints(2, 1);
+ gbc.fill = GridBagConstraints.BOTH;
+ gbc.weightx = 1.0;
+ gbc.weighty = 1.0;
+ add(new JScrollPane(m_taDescription), gbc);
+ }
+
+ /**
+ * getter for the rating panel
+ * @return the rating panel
+ */
+ public JPanel getRatingPanel() {
+ return m_fskPanel;
+ }
+
+ /**
+ * getter for the radio button fsk6
+ * @return the radio button fsk6
+ */
+ public JRadioButton getRadioButtonFsk6() {
+ return m_rbFsk6;
+ }
+
+ /**
+ * getter for the radio button fsk16
+ * @return the radio button fsk16
+ */
+ public JRadioButton getRadioButtonFsk16() {
+ return m_rbFsk16;
+ }
+
+ /**
+ * getter for the radio button fsk18
+ * @return the radio button fsk18
+ */
+ public JRadioButton getRadioButtonFsk18() {
+ return m_rbFsk18;
+ }
+
+ /**
+ * getter for the component displaying the description
+ * @return the component displaying the description
+ */
+ public JTextArea getTextAreaDescription() {
+ return m_taDescription;
+ }
+
+ /**
+ * getter for the component displaying the chapter
+ * @return the component displaying the chapter
+ */
+ public JTextField getTextFieldChapters() {
+ return m_tfChapters;
+ }
+
+ /**
+ * getter for the chapter label
+ * @return the chapter label
+ */
+ public JLabel getLabelChapters() {
+ return m_labelChapters;
+ }
+
+ /**
+ * getter for the not displayed radio button
+ * @return the dummy radio button
+ */
+ public JRadioButton getRadioButtonDummy() {
+ return m_rbDummy;
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdDialogs.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdDialogs.java
new file mode 100644
index 000000000..624b119e1
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdDialogs.java
@@ -0,0 +1,133 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import java.awt.Component;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.JOptionPane;
+
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This class is used for displaying a (modal) message dialog.
+ *
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdDialogs {
+
+ /** constant for yes */
+ public static final int YES = JOptionPane.YES_OPTION;
+
+ /** constant for no */
+ public static final int NO = JOptionPane.NO_OPTION;
+
+ /** constant for cacnel */
+ public static final int CANCEL = JOptionPane.CANCEL_OPTION;
+
+ /**
+ * private constructor, use static methods
+ */
+ private DvdDialogs() {
+ // empty
+ }
+
+ /**
+ * display a confirmation dialog with initernationalized messages from <code>keys</code>
+ * the dialog display an OK - and a CANCEL - Button
+ * @param parent the parent for the dialog
+ * @param titleKey the key for the title
+ * @param keys the resource key(s) of the message(s) to display, must be Strings
+ * @return true if the user selected ok, false otherwise
+ */
+ public static boolean confirm2(Component parent, String titleKey,
+ List keys) {
+
+ List message = new Vector();
+ for (Iterator iter = keys.iterator(); iter.hasNext();) {
+ message.add(Resources.getString((String) iter.next()));
+ }
+
+ return JOptionPane.showConfirmDialog(
+ parent,
+ message.toArray(new Object[message.size()]),
+ Resources.getString(titleKey),
+ JOptionPane.OK_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE) == JOptionPane.OK_OPTION;
+ }
+
+ /**
+ * display a confirmation dialog with initernationalized messages from <code>keys</code>
+ * the dialog display an YES -, NO -, and a CANCEL - Button
+ * @param parent the parent for the dialog
+ * @param titleKey the key for the title
+ * @param keys the resource key(s) of the message(s) to display, must be Strings
+ * @return the choosen button, see constants defined in this class
+ */
+ public static int confirm3(Component parent, String titleKey,
+ List keys) {
+
+ List message = new Vector();
+ for (Iterator iter = keys.iterator(); iter.hasNext();) {
+ message.add(Resources.getString((String) iter.next()));
+ }
+
+ return JOptionPane.showConfirmDialog(
+ parent,
+ message.toArray(new Object[message.size()]),
+ Resources.getString(titleKey),
+ JOptionPane.YES_NO_CANCEL_OPTION,
+ JOptionPane.QUESTION_MESSAGE);
+ }
+ /**
+ * displays an error message with an internationlized message
+ * @param parent the parent for the dialog
+ * @param key the resource key of the message to display
+ */
+ public static void showError(Component parent, String key) {
+ JOptionPane.showMessageDialog(
+ parent,
+ Resources.getString(key),
+ Resources.getString("dialog.error.title"), //$NON-NLS-1$
+ JOptionPane.ERROR_MESSAGE);
+ }
+
+ /**
+ * displays an information message with an internationlized message
+ * @param parent the parent for the dialog
+ * @param key the resource key of the message to display
+ */
+ public static void showMessage(Component parent, String key) {
+ JOptionPane.showMessageDialog(
+ parent,
+ Resources.getString(key),
+ Resources.getString("dialog.message.title"), //$NON-NLS-1$
+ JOptionPane.INFORMATION_MESSAGE);
+ }
+
+ /**
+ * displays an input dialog with an internationlized message
+ * @param parent the parent for the dialog
+ * @param key the resource key of the message to display
+ * @return users input, or <code>null</code> meaning the user
+ * cancelled the input
+ */
+ public static String getInput(Component parent, String key) {
+ return JOptionPane.showInputDialog(parent,
+ Resources.getString(key),
+ Resources.getString("dialog.input.title"), //$NON-NLS-1$
+ JOptionPane.QUESTION_MESSAGE);
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdFileChooser.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdFileChooser.java
new file mode 100644
index 000000000..93ed50899
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdFileChooser.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import java.io.File;
+import java.io.Serializable;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This is the file chooser for the dvd tool.
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdFileChooser extends JFileChooser {
+
+ /** the file filter */
+ private FileFilter m_fileFilter = new DvdFileFilter();
+
+ /**
+ * public constructor, initialises this file chooser
+ */
+ public DvdFileChooser() {
+ setFileFilter(m_fileFilter);
+ setCurrentDirectory(new File(System.getProperty("user.dir"))); //$NON-NLS-1$
+ }
+
+ /**
+ * returns the (last) extension of <code>f</code>
+ * @param f the file
+ * @return the extension of <code>f</code> or "" if the name of <code>f</code> does not contain a dot
+ */
+ private String getExtension(File f) {
+ String ext = ""; //$NON-NLS-1$
+ String s = f.getName();
+ int i = s.lastIndexOf('.');
+ if (i > 0 && i < s.length() - 1) {
+ ext = s.substring(i + 1).toLowerCase();
+ }
+ return ext;
+ }
+
+ /**
+ * private inner class for file filtering
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+ private class DvdFileFilter extends FileFilter implements Serializable {
+ /** the description of this filter */
+ private String m_description = null;
+
+ /**
+ * public constructor, initialises this filter
+ */
+ public DvdFileFilter() {
+ init();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean accept(File f) {
+ if (f.isDirectory()) {
+ return true;
+ }
+ String extension = getExtension(f);
+
+ if (Constants.SUFFIX.equals(extension)) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getDescription() {
+ return m_description;
+ }
+
+ /**
+ * private method for initialisation
+ */
+ private void init() {
+ m_description = Resources.getString("dvdfile.description"); //$NON-NLS-1$
+ }
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdMainFrame.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdMainFrame.java
new file mode 100644
index 000000000..eb0f443be
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdMainFrame.java
@@ -0,0 +1,544 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import java.awt.BorderLayout;
+import java.awt.CardLayout;
+import java.awt.Dimension;
+import java.io.IOException;
+
+import javax.swing.JEditorPane;
+import javax.swing.JFileChooser;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+
+import org.eclipse.jubula.examples.aut.dvdtool.control.DvdTableTransferHandler;
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This class is the main frame of the dvd tool. <br>
+ * <br>
+ * Layout <br>
+ * <br>
+ * <table border="1">
+ * <tr>
+ * <td colspan="2">Menu</td>
+ * </tr>
+ * <tr>
+ * <td rowspan="2">Tree</td>
+ * <td> HTML or Table</td>
+ * </tr>
+ * <tr>
+ * <td>Cards</td>
+ * </tr>
+ * </table>
+ *
+ * <br>
+ * Between the tree and the right side is a splitter.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DvdMainFrame extends JFrame {
+ /** constant for CardLayout, card LOGO */
+ public static final String CARD_LOGO = "Logo"; //$NON-NLS-1$
+ /** constant for CardLayout, card DATA */
+ public static final String CARD_DATA = "Data"; //$NON-NLS-1$
+ /** the separator for the title text */
+ private static final String TITLESEPARATOR = " - "; //$NON-NLS-1$
+
+ /** panel displaying 'technical' information */
+ private DvdTechMainPanel m_techMainPanel = new DvdTechMainPanel();
+ /** panel displaying 'content' information */
+ private DvdContentPanel m_contentPanel = new DvdContentPanel();
+ /** tabbed pane containing the dvd details */
+ private JTabbedPane m_dvdDetailTabbedPane = new JTabbedPane();
+ /** the menu 'File' */
+ private JMenu m_menuFile = new JMenu();
+ /** the menu 'Edit' */
+ private JMenu m_menuEdit = new JMenu();
+ /** the menu 'Config' */
+ private JMenu m_menuConfig = new JMenu();
+ /** the menu 'Help' */
+ private JMenu m_menuHelp = new JMenu();
+ /** the menu entry 'Add category' */
+ private JMenuItem m_menuItemAddCategory = new JMenuItem();
+ /** the menu entry 'Enable category' */
+ private JMenuItem m_menuItemEnableCategory = new JMenuItem();
+ /** the menu entry 'Disable category' */
+ private JMenuItem m_menuItemDisableCategory = new JMenuItem();
+ /** the menu entry 'Remove category' */
+ private JMenuItem m_menuItemRemoveCategory = new JMenuItem();
+ /** the menu entry 'Add DVD' */
+ private JMenuItem m_menuItemAddDvd = new JMenuItem();
+ /** the menu entry 'Remove DVD' */
+ private JMenuItem m_menuItemRemoveDvd = new JMenuItem();
+ /** the menu entry 'Add language' */
+ private JMenuItem m_menuItemAddLanguage = new JMenuItem();
+ /** the menu entry 'Remove language' */
+ private JMenuItem m_menuItemRemoveLanguage = new JMenuItem();
+ /** the menu entry 'Show waiting dialog' */
+ private JMenuItem m_menuItemShowWaitingDialog = new JMenuItem();
+ /** the menu entry 'Exit' */
+ private JMenuItem m_menuItemExit = new JMenuItem();
+ /** the menu entry 'Info' */
+ private JMenuItem m_menuItemInfo = new JMenuItem();
+ /** the menu entry 'Save' */
+ private JMenuItem m_menuItemSave = new JMenuItem();
+ /** the menu entry 'Open' */
+ private JMenuItem m_menuItemOpen = new JMenuItem();
+ /** the menu 'Dvd details' */
+ private JMenu m_menuDvdDetails = new JMenu();
+ /** the menu entry 'Dvd details / Tabs to top' */
+ private JMenuItem m_menuItemDvdDetailsTabsToTop = new JMenuItem();
+ /** the menu entry 'Dvd details / Tabs to bottom' */
+ private JMenuItem m_menuItemDvdDetailsTabsToBottom = new JMenuItem();
+ /** the menu entry 'Dvd details / Tabs to left' */
+ private JMenuItem m_menuItemDvdDetailsTabsToLeft = new JMenuItem();
+ /** the menu entry 'Dvd details / Tabs to right' */
+ private JMenuItem m_menuItemDvdDetailsTabsToRight = new JMenuItem();
+ /** the menu 'Rating panel' */
+ private JMenu m_menuRatingPanel = new JMenu();
+ /** the menu entry 'Rating panel / Labels to top' */
+ private JMenuItem m_menuItemRatingPanelLabelsToTop = new JMenuItem();
+ /** the menu entry 'Rating panel / Labels to bottom' */
+ private JMenuItem m_menuItemRatingPanelLabelsToBottom = new JMenuItem();
+ /** the menu entry 'Rating panel / Labels to left' */
+ private JMenuItem m_menuItemRatingPanelLabelsToLeft = new JMenuItem();
+ /** the menu entry 'Rating panel / Labels to right' */
+ private JMenuItem m_menuItemRatingPanelLabelsToRight = new JMenuItem();
+ /** the file chooser for opening and saving libraries */
+ private JFileChooser m_fileChooser = new DvdFileChooser();
+
+ /** the table displaying an overview */
+ private JTable m_table = new JTable();
+ /** the tree panel displaying the structure */
+ private DvdTreePanel m_treePanel = new DvdTreePanel();
+ /** the panel displaying the detail cards */
+ private JPanel m_cardPanel = new JPanel();
+
+ /** the split pane */
+ private JSplitPane m_splitPane =
+ new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+
+ /**
+ * constructor, initialises the frame
+ */
+ public DvdMainFrame() {
+ super();
+ init();
+ }
+
+ /**
+ * private method for initialisation
+ */
+ private void init() {
+ // set title and icon
+ setTitle(Resources.getString("application.title")); //$NON-NLS-1$
+ setIconImage(Resources.getImageIcon(Resources.APP_ICON).getImage());
+
+ // create the menu bar
+ createMenuBar();
+
+ // initialize the tabbed pane
+ m_dvdDetailTabbedPane.setName("tabbedPane"); //$NON-NLS-1$
+ m_dvdDetailTabbedPane
+ .addTab(Resources.getString("technical"), m_techMainPanel); //$NON-NLS-1$
+ m_dvdDetailTabbedPane
+ .addTab(Resources.getString("content"), m_contentPanel); //$NON-NLS-1$
+
+ // the panel containing the table and the tabbed pane
+ JPanel dataPanel = new JPanel();
+ dataPanel.setLayout(new BorderLayout());
+
+ // add the tabbed pane
+ dataPanel.add(m_dvdDetailTabbedPane, BorderLayout.SOUTH);
+
+ // set the renderer and the selection mode for the table
+ EvenOddTableCellRenderer renderer = new EvenOddTableCellRenderer();
+ m_table.setName("table"); //$NON-NLS-1$
+ m_table.setDefaultRenderer(Object.class, renderer);
+ m_table.setDefaultRenderer(String.class, renderer);
+ m_table.setDefaultRenderer(Number.class, renderer);
+ m_table.setDefaultRenderer(Boolean.class, renderer);
+ m_table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+ m_table.setTransferHandler(new DvdTableTransferHandler());
+ m_table.setDragEnabled(true);
+
+ // add the table
+ dataPanel.add(new JScrollPane(m_table), BorderLayout.CENTER);
+
+ // editor pane for displaying an HTML page
+ JEditorPane editorPane = new JEditorPane();
+ editorPane.setName("editorPane"); //$NON-NLS-1$
+ editorPane.setEditable(false);
+ String url = Resources.getFileUrl(Resources.getWelcomeScreenName());
+
+ try {
+ editorPane.setPage(url);
+ } catch (IOException e) {
+ // ignore
+ }
+
+ // panel with card layout
+ m_cardPanel.setLayout(new CardLayout());
+ m_cardPanel.add(editorPane, CARD_LOGO);
+ m_cardPanel.add(dataPanel, CARD_DATA);
+ m_cardPanel.setMinimumSize(new Dimension(0, 0));
+
+ m_treePanel.setMinimumSize(new Dimension(0, 0));
+
+ // create the split pane
+ m_splitPane.setOneTouchExpandable(true);
+ m_splitPane.setLeftComponent(m_treePanel);
+ m_splitPane.setRightComponent(m_cardPanel);
+ m_splitPane.setResizeWeight(0.2);
+
+ // use an opaque JPanel as content pane
+ JPanel panel = new JPanel();
+ panel.setOpaque(true);
+ panel.setLayout(new BorderLayout());
+ panel.add(m_splitPane, BorderLayout.CENTER);
+
+ getContentPane().add(panel);
+ pack();
+ }
+
+ /**
+ * creates the menu bar with all menues
+ */
+ private void createMenuBar() {
+ JMenuBar menuBar = new JMenuBar();
+ menuBar.setName("menuBar"); //$NON-NLS-1$
+ m_menuFile.setText(Resources.getString("menu.file")); //$NON-NLS-1$
+ m_menuFile.add(m_menuItemOpen);
+ m_menuFile.add(m_menuItemSave);
+ m_menuFile.addSeparator();
+ m_menuFile.add(m_menuItemExit);
+ m_menuEdit.setText(Resources.getString("menu.edit")); //$NON-NLS-1$
+ m_menuEdit.add(m_menuItemAddCategory);
+ m_menuEdit.add(m_menuItemEnableCategory);
+ m_menuEdit.add(m_menuItemDisableCategory);
+ m_menuEdit.add(m_menuItemRemoveCategory);
+ m_menuEdit.addSeparator();
+ m_menuEdit.add(m_menuItemAddDvd);
+ m_menuEdit.add(m_menuItemRemoveDvd);
+ m_menuEdit.addSeparator();
+ m_menuEdit.add(m_menuItemAddLanguage);
+ m_menuEdit.add(m_menuItemRemoveLanguage);
+ m_menuEdit.addSeparator();
+ m_menuEdit.add(m_menuItemShowWaitingDialog);
+ m_menuConfig.setText(Resources.getString("menu.config")); //$NON-NLS-1$
+ m_menuConfig.add(m_menuDvdDetails);
+ m_menuDvdDetails.setText(Resources.getString(
+ "menu.config.dvddetails")); //$NON-NLS-1$
+ m_menuDvdDetails.add(m_menuItemDvdDetailsTabsToTop);
+ m_menuDvdDetails.add(m_menuItemDvdDetailsTabsToBottom);
+ m_menuDvdDetails.add(m_menuItemDvdDetailsTabsToLeft);
+ m_menuDvdDetails.add(m_menuItemDvdDetailsTabsToRight);
+ m_menuDvdDetails.add(m_menuRatingPanel);
+ m_menuRatingPanel.setText(Resources.getString(
+ "menu.config.dvddetails.content")); //$NON-NLS-1$
+ m_menuRatingPanel.add(m_menuItemRatingPanelLabelsToTop);
+ m_menuRatingPanel.add(m_menuItemRatingPanelLabelsToBottom);
+ m_menuRatingPanel.add(m_menuItemRatingPanelLabelsToLeft);
+ m_menuRatingPanel.add(m_menuItemRatingPanelLabelsToRight);
+ m_menuHelp.setText(Resources.getString("menu.help")); //$NON-NLS-1$
+ m_menuHelp.add(m_menuItemInfo);
+
+ menuBar.add(m_menuFile);
+ menuBar.add(m_menuEdit);
+ menuBar.add(m_menuConfig);
+ menuBar.add(m_menuHelp);
+ setJMenuBar(menuBar);
+ }
+
+ /**
+ * getter for the menu entry 'Add Category'
+ * @return the menu item 'Add Category'
+ */
+ public JMenuItem getMenuItemAddCategory() {
+ return m_menuItemAddCategory;
+ }
+
+ /**
+ * getter for the menu entry 'Enable category'
+ * @return the menu item 'Enable category'
+ */
+ public JMenuItem getMenuItemEnableCategory() {
+ return m_menuItemEnableCategory;
+ }
+
+ /**
+ * getter for the menu entry 'Disable category'
+ * @return the menu item 'Disable category'
+ */
+ public JMenuItem getMenuItemDisableCategory() {
+ return m_menuItemDisableCategory;
+ }
+
+ /**
+ * getter for the menu entry 'Remove Category'
+ * @return the menu item 'Remove Category'
+ */
+ public JMenuItem getMenuItemRemoveCategory() {
+ return m_menuItemRemoveCategory;
+ }
+
+ /**
+ * getter for the menu entry 'Add DVD'
+ * @return the menu item 'Add DVD'
+ */
+ public JMenuItem getMenuItemAddDvd() {
+ return m_menuItemAddDvd;
+ }
+
+ /**
+ * getter for the menu entry 'Remove DVD'
+ * @return the menu item 'Remove DVD'
+ */
+ public JMenuItem getMenuItemRemoveDvd() {
+ return m_menuItemRemoveDvd;
+ }
+
+ /**
+ * getter for the menu entry 'Add language'
+ * @return the menu item 'Add language'
+ */
+ public JMenuItem getMenuItemAddLanguage() {
+ return m_menuItemAddLanguage;
+ }
+
+ /**
+ * getter for the menu entry 'Remove language'
+ * @return the menu item 'Remove language'
+ */
+ public JMenuItem getMenuItemRemoveLanguage() {
+ return m_menuItemRemoveLanguage;
+ }
+
+ /**
+ * getter for the menu entry 'Show waiting dialog'
+ * @return the menu item 'Show waiting dialog'
+ */
+ public JMenuItem getMenuItemShowWaitingDialog() {
+ return m_menuItemShowWaitingDialog;
+ }
+
+ /**
+ * getter for the menu 'File'
+ * @return the menu 'File'
+ */
+ public JMenu getMenuFile() {
+ return m_menuFile;
+ }
+
+ /**
+ * getter for the menu 'Edit'
+ * @return the menu 'Edit'
+ */
+ public JMenu getMenuEdit() {
+ return m_menuEdit;
+ }
+
+ /**
+ * getter for the menu 'Config'
+ * @return the menu 'Config'
+ */
+ public JMenu getMenuConfig() {
+ return m_menuConfig;
+ }
+
+ /**
+ * getter for the menu 'Help'
+ * @return the menu 'Help'
+ */
+ public JMenu getMenuHelp() {
+ return m_menuHelp;
+ }
+
+ /**
+ * getter for the menu entry 'Exit'
+ * @return the menu item 'Exit'
+ */
+ public JMenuItem getMenuItemExit() {
+ return m_menuItemExit;
+ }
+
+ /**
+ * getter for the menu entry 'Info'
+ * @return the menu item 'Info'
+ */
+ public JMenuItem getMenuItemInfo() {
+ return m_menuItemInfo;
+ }
+
+ /**
+ * getter for the menu entry 'Save'
+ * @return the menu item 'Save'
+ */
+ public JMenuItem getMenuItemSave() {
+ return m_menuItemSave;
+ }
+
+ /**
+ * getter for the menu entry 'Open'
+ * @return the menu item 'Open'
+ */
+ public JMenuItem getMenuItemOpen() {
+ return m_menuItemOpen;
+ }
+
+ /**
+ * getter for the menu entry 'Dvd details / Tabs to top'
+ * @return the menu item 'Dvd details / Tabs to top'
+ */
+ public JMenuItem getMenuItemDvdDetailsTabsToTop() {
+ return m_menuItemDvdDetailsTabsToTop;
+ }
+
+ /**
+ * getter for the menu entry 'Dvd details / Tabs to bottom'
+ * @return the menu item 'Dvd details / Tabs to bottom'
+ */
+ public JMenuItem getMenuItemDvdDetailsTabsToBottom() {
+ return m_menuItemDvdDetailsTabsToBottom;
+ }
+
+ /**
+ * getter for the menu entry 'Dvd details / Tabs to left'
+ * @return the menu item 'Dvd details / Tabs to left'
+ */
+ public JMenuItem getMenuItemDvdDetailsTabsToLeft() {
+ return m_menuItemDvdDetailsTabsToLeft;
+ }
+
+ /**
+ * getter for the menu entry 'Dvd details / Tabs to right'
+ * @return the menu item 'Dvd details / Tabs to right'
+ */
+ public JMenuItem getMenuItemDvdDetailsTabsToRight() {
+ return m_menuItemDvdDetailsTabsToRight;
+ }
+
+ /**
+ * getter for the menu entry 'Rating panel / Labels to top'
+ * @return the menu item 'Rating panel / Labels to top'
+ */
+ public JMenuItem getMenuItemRatingPanelLabelsToTop() {
+ return m_menuItemRatingPanelLabelsToTop;
+ }
+
+ /**
+ * getter for the menu entry 'Rating panel / Labels to bottom'
+ * @return the menu item 'Rating panel / Labels to bottom'
+ */
+ public JMenuItem getMenuItemRatingPanelLabelsToBottom() {
+ return m_menuItemRatingPanelLabelsToBottom;
+ }
+
+ /**
+ * getter for the menu entry 'Rating panel / Labels to left'
+ * @return the menu item 'Rating panel / Labels to left'
+ */
+ public JMenuItem getMenuItemRatingPanelLabelsToLeft() {
+ return m_menuItemRatingPanelLabelsToLeft;
+ }
+
+ /**
+ * getter for the menu entry 'Rating panel / Labels to right'
+ * @return the menu item 'Rating panel / Labels to right'
+ */
+ public JMenuItem getMenuItemRatingPanelLabelsToRight() {
+ return m_menuItemRatingPanelLabelsToRight;
+ }
+
+ /**
+ * getter for the 'technical' panel
+ * @return the panel 'technical'
+ */
+ public DvdTechMainPanel getDvdTechMainPanel() {
+ return m_techMainPanel;
+ }
+
+ /**
+ * getter for the 'content' panel
+ * @return the panel 'content'
+ */
+ public DvdContentPanel getDvdContentPanel() {
+ return m_contentPanel;
+ }
+
+ /**
+ * getter for the 'dvd details' tabbed pane
+ * @return the tabbed pane 'dvd details'
+ */
+ public JTabbedPane getDvdDetailTabbedPane() {
+ return m_dvdDetailTabbedPane;
+ }
+
+ /**
+ * getter for the table
+ * @return the table
+ */
+ public JTable getTable() {
+ return m_table;
+ }
+
+ /**
+ * getter for the panel with the tree
+ * @return the tree panel
+ */
+ public DvdTreePanel getTreePanel() {
+ return m_treePanel;
+ }
+
+ /**
+ * @return Returns the fileChooser.
+ */
+ public JFileChooser getFileChooser() {
+ return m_fileChooser;
+ }
+
+ /**
+ * makes the card named <code>card</code> visible
+ * @param card the name of the card, use the public constant
+ * defined by this class
+ */
+ public void showCard(String card) {
+ ((CardLayout)m_cardPanel.getLayout()).show(m_cardPanel, card);
+ }
+
+ /**
+ * adds <code>suffix</code> to the standard title
+ * @param suffix additional information, like filename
+ */
+ public void updateTitle(String suffix) {
+ setTitle(Resources.getString("application.title") //$NON-NLS-1$
+ + TITLESEPARATOR + suffix);
+ }
+
+ /**
+ * @return the split pane
+ */
+ public JSplitPane getSplitPane() {
+ return m_splitPane;
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTableModel.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTableModel.java
new file mode 100644
index 000000000..6a7632903
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTableModel.java
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.table.AbstractTableModel;
+
+import org.eclipse.jubula.examples.aut.dvdtool.model.Dvd;
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This is the table model for a category. Each row is represented by an instance of <code>Dvd</code>
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DvdTableModel extends AbstractTableModel {
+
+ /** serialVersionUID */
+ public static final long serialVersionUID = 1L; // see findBugs
+
+ /** the names of the columns */
+ private static final String[] COLUM_NAMES = {
+ Resources.getString("title"), Resources.getString("actor"), //$NON-NLS-1$ //$NON-NLS-2$
+ Resources.getString("direction"), Resources.getString("year"), Resources.getString("limited") }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ /** the category */
+ private String m_category;
+
+ /** the data for the category */
+ private List m_data;
+
+ /**
+ * public constructor without parameter the model is empty
+ */
+ public DvdTableModel() {
+ this("", new Vector()); //$NON-NLS-1$
+ }
+
+ /**
+ * public constructor
+ * @param category the category for this model
+ * @param data the data to the category, should contain instances of model
+ * class <code>Dvd</code>, must not be null
+ * @throws IllegalArgumentException if data is null
+ */
+ public DvdTableModel(String category, List data)
+ throws IllegalArgumentException {
+
+ super();
+ if (data == null) {
+ throw new IllegalArgumentException("null is not allowed as table data!"); //$NON-NLS-1$
+ }
+ this.m_category = category;
+ this.m_data = data;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getRowCount() {
+ return m_data.size();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public int getColumnCount() {
+ return COLUM_NAMES.length;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object getValueAt(int rowIndex, int columnIndex) {
+ Object value = null;
+ Dvd dvd = getDvd(rowIndex);
+ switch (columnIndex) {
+ case 0:
+ value = dvd.getTitle();
+ break;
+ case 1:
+ value = dvd.getActor();
+ break;
+ case 2:
+ value = dvd.getDirection();
+ break;
+ case 3:
+ value = dvd.getYear();
+ break;
+ case 4:
+ value = dvd.isLimited();
+ break;
+ default:
+ // do nothing
+ }
+ return value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
+ Dvd dvd = getDvd(rowIndex);
+ switch (columnIndex) {
+ case 0:
+ dvd.setTitle(aValue.toString());
+ break;
+ case 1:
+ dvd.setActor(aValue.toString());
+ break;
+ case 2:
+ dvd.setDirection(aValue.toString());
+ break;
+ case 3:
+ dvd.setYear(Integer.parseInt(aValue.toString()));
+ break;
+ case 4:
+ dvd.setLimited(Boolean.valueOf(aValue.toString())
+ .booleanValue());
+ break;
+ default:
+ // do nothing
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isCellEditable(int rowIndex, int columnIndex) {
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public String getColumnName(int column) {
+ return COLUM_NAMES[column];
+ }
+
+ /**
+ * returns the <code>Dvd</code> for row <code>row</code>
+ * @param row the row number
+ * @return the dvd displayed in <code>row</code>
+ */
+ public Dvd getDvd(int row) {
+ return (Dvd) m_data.get(row);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Class getColumnClass(int column) {
+ return getRowCount() > 0 ? getValueAt(0, column).getClass()
+ : Object.class;
+ }
+
+ /**
+ * returns the (international) category as string representation.
+ * {@inheritDoc}
+ */
+ public String toString() {
+ return m_category;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTechMainPanel.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTechMainPanel.java
new file mode 100644
index 000000000..f96eda465
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTechMainPanel.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.eclipse.jubula.examples.aut.dvdtool.control.DvdListTransferHandler;
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This class displays all the 'technical' information for a dvd. <br>
+ * Uses <code>DvdTechMainPanel</code>
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DvdTechMainPanel extends JPanel {
+ /** the list with the languages */
+ private JList m_listLanguages = new JList();
+ /** the panel with 'technical' information */
+ private DvdTechPanel m_techPanel = new DvdTechPanel();
+
+ /**
+ * public constructor, initialises the panel
+ */
+ public DvdTechMainPanel() {
+ super();
+ init();
+ }
+
+ /**
+ * private method for initialisation
+ */
+ private void init() {
+ m_listLanguages.setName("languageList"); //$NON-NLS-1$
+ m_listLanguages.setListData(Constants.LANGUAGES);
+ m_listLanguages.setTransferHandler(new DvdListTransferHandler());
+ m_listLanguages.setDragEnabled(true);
+ setLayout(new BorderLayout());
+ JPanel panel = new JPanel();
+ panel.setLayout(new BorderLayout());
+ panel.add(new JLabel(Resources.getString("languages")), BorderLayout.NORTH); //$NON-NLS-1$
+ JScrollPane sp = new JScrollPane(m_listLanguages);
+ panel.add(sp, BorderLayout.CENTER);
+ add(panel, BorderLayout.EAST);
+ add(m_techPanel, BorderLayout.CENTER);
+ }
+
+ /**
+ * @return the list containing the languages
+ */
+ public JList getListLanguages() {
+ return m_listLanguages;
+ }
+
+ /**
+ * @return the inner panel with 'technical' information
+ */
+ public DvdTechPanel getDvdTechPanel() {
+ return m_techPanel;
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTechPanel.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTechPanel.java
new file mode 100644
index 000000000..f12b32369
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTechPanel.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This class displays the 'technical' information for a dvd.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DvdTechPanel extends JPanel {
+ /** the label for the length */
+ private JLabel m_labelLength = new JLabel(Resources.getString("length_in_minutes")); //$NON-NLS-1$
+ /** the component (text field) displaying the length */
+ private JTextField m_tfLength = new JTextField(5);
+ /** the lab for 'has bonus' */
+ private JLabel m_labelBonus = new JLabel(Resources.getString("bonus")); //$NON-NLS-1$
+ /** the check box for 'has bonus' */
+ private JCheckBox m_checkBoxBonus = new JCheckBox();
+ /** the label for the region code */
+ private JLabel m_labelRegionCode = new JLabel(Resources.getString("region_code")); //$NON-NLS-1$
+ /** the combo box containing all region codes */
+ private JComboBox m_comboBoxRegionCode = new JComboBox(
+ Constants.REGION_CODES);
+
+ /**
+ * public constructor, initialises the panel
+ */
+ public DvdTechPanel() {
+ super();
+ init();
+ }
+
+ /**
+ * private method creating GridBagConstraints, used for the layout
+ * @param x the x position
+ * @param y the y position
+ * @return a new instance of GridBagConstraints
+ */
+ private GridBagConstraints createGridBagConstraints(int x, int y) {
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.gridx = x;
+ gbc.gridy = y;
+ gbc.insets = new Insets(5, 5, 5, 5);
+ return gbc;
+ }
+
+ /**
+ * private method for initialisation
+ */
+ private void init() {
+ setLayout(new GridBagLayout());
+
+ GridBagConstraints gbc = null;
+
+ gbc = createGridBagConstraints(0, 0);
+ gbc.anchor = GridBagConstraints.EAST;
+ m_labelLength.setName("lengthLabel"); //$NON-NLS-1$
+ add(m_labelLength, gbc);
+
+ gbc = createGridBagConstraints(1, 0);
+ gbc.anchor = GridBagConstraints.WEST;
+ m_tfLength.setName("lengthText"); //$NON-NLS-1$
+ add(m_tfLength, gbc);
+
+ gbc = createGridBagConstraints(0, 1);
+ gbc.anchor = GridBagConstraints.EAST;
+ m_labelBonus.setName("bonusLabel"); //$NON-NLS-1$
+ add(m_labelBonus, gbc);
+
+ gbc = createGridBagConstraints(1, 1);
+ gbc.anchor = GridBagConstraints.WEST;
+ m_checkBoxBonus.setName("bonusCheck"); //$NON-NLS-1$
+ add(m_checkBoxBonus, gbc);
+
+ gbc = createGridBagConstraints(0, 2);
+ gbc.anchor = GridBagConstraints.EAST;
+ m_labelRegionCode.setName("regionCodeLabel"); //$NON-NLS-1$
+ add(m_labelRegionCode, gbc);
+
+ gbc = createGridBagConstraints(1, 2);
+ gbc.anchor = GridBagConstraints.WEST;
+ m_comboBoxRegionCode.setName("regionCodeCombo"); //$NON-NLS-1$
+ add(m_comboBoxRegionCode, gbc);
+ }
+
+ /**
+ * @return the text field displaying the length
+ */
+ public JTextField getTextFieldLength() {
+ return m_tfLength;
+ }
+
+ /**
+ * @return the check box for 'has bonus'
+ */
+ public JCheckBox getCheckBoxBonus() {
+ return m_checkBoxBonus;
+ }
+
+ /**
+ * @return the combo box with the region codes
+ */
+ public JComboBox getComboBoxRegionCode() {
+ return m_comboBoxRegionCode;
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTreeCellRenderer.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTreeCellRenderer.java
new file mode 100644
index 000000000..af0d9105a
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTreeCellRenderer.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import java.awt.Color;
+import java.awt.Component;
+
+import javax.swing.ImageIcon;
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeCellRenderer;
+
+import org.eclipse.jubula.examples.aut.dvdtool.model.DvdDataObject;
+import org.eclipse.jubula.examples.aut.dvdtool.resources.Resources;
+
+
+/**
+ * This class is the renderer for the tree displaying the category structure.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DvdTreeCellRenderer extends DefaultTreeCellRenderer {
+ /** the image icon for a category containing dvd(s) */
+ private ImageIcon m_iconDvd = Resources.getImageIcon(Resources.CAT_ICON);
+ /** the image icon for an empty category */
+ private ImageIcon m_iconEmpty = Resources
+ .getImageIcon(Resources.EMPTY_CAT_ICON);
+
+ /**
+ * public constructor
+ */
+ public DvdTreeCellRenderer() {
+ super();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Component getTreeCellRendererComponent(
+ JTree tree, Object value, boolean sel, boolean expanded,
+ boolean leaf, int row, boolean focus) {
+
+ super.getTreeCellRendererComponent(
+ tree, value, sel, expanded, leaf, row, focus);
+
+ Object obj = ((DefaultMutableTreeNode)value).getUserObject();
+
+ if (obj instanceof DvdDataObject) {
+ DvdDataObject data = (DvdDataObject) obj;
+ setIcon(data.hasDvds() ? m_iconDvd : m_iconEmpty);
+
+ if (!data.getCategory().isEnabled()) {
+ setForeground(Color.gray);
+ }
+ }
+
+ return this;
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTreePanel.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTreePanel.java
new file mode 100644
index 000000000..6e1a194a8
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/DvdTreePanel.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTree;
+
+/**
+ * This class displays the tree with the category structure.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class DvdTreePanel extends JPanel {
+ /** the tree */
+ private JTree m_tree = new JTree();
+
+ /**
+ * public constructor, initialises the panel
+ */
+ public DvdTreePanel() {
+ super();
+ init();
+ }
+
+ /**
+ * private method for initialisation, constructs the whole tree.
+ */
+ private void init() {
+ // set the layout
+ setLayout(new BorderLayout());
+
+ // set the renderer
+ m_tree.setCellRenderer(new DvdTreeCellRenderer());
+
+ // add the tree
+ m_tree.setName("categoryTree"); //$NON-NLS-1$
+ add(new JScrollPane(m_tree), BorderLayout.CENTER);
+ }
+
+ /**
+ * @return the tree displaying the category structure
+ */
+ public JTree getTree() {
+ return m_tree;
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/EvenOddTableCellRenderer.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/EvenOddTableCellRenderer.java
new file mode 100644
index 000000000..700c223d8
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/gui/EvenOddTableCellRenderer.java
@@ -0,0 +1,129 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.gui;
+
+import java.awt.Color;
+import java.awt.Component;
+
+import javax.swing.JCheckBox;
+import javax.swing.JTable;
+import javax.swing.SwingConstants;
+import javax.swing.table.DefaultTableCellRenderer;
+import javax.swing.table.TableCellRenderer;
+
+/**
+ * This is a table cell renderer which displays the rows in two alternate
+ * background colors.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class EvenOddTableCellRenderer implements TableCellRenderer {
+ /** the component (check box) used to render boolean values */
+ private JCheckBox m_boolRenderer = new JCheckBox();
+
+ /** the renderer which *really* does the work */
+ private DefaultTableCellRenderer m_defaultRenderer =
+ new DefaultTableCellRenderer();
+
+ /**
+ * public constructor, initialises this renderer
+ */
+ public EvenOddTableCellRenderer() {
+ super();
+
+ init();
+ }
+
+ /**
+ * private method for initialisation
+ */
+ private void init() {
+ m_boolRenderer.setOpaque(true);
+ m_boolRenderer.setHorizontalAlignment(SwingConstants.CENTER);
+ }
+
+ /**
+ * private method determining the background color for the row
+ * <code>row</code>
+ *
+ * @param row
+ * the row number
+ * @return the <code>Color</code> to use for the background of row
+ * <code>row</code>
+ */
+ private Color getBackgroundColor(int row) {
+ return row % 2 == 0 ? Color.yellow : Color.white;
+ }
+
+ /**
+ * Private method configuring and returning a check box to be used as
+ * renderer for boolean values.
+ *
+ * @param table
+ * the <code>JTable</code> that is asking the renderer to draw;
+ * can be <code>null</code>
+ * @param value
+ * the value of the cell to be rendered. Must be a Boolean.
+ * @param isSelected
+ * true if the cell is to be rendered with the selection
+ * highlighted; otherwise false
+ * @param row
+ * the row index of the cell being drawn. <br>
+ * determines the background color
+ * @return a configured CheckBox
+ */
+ private JCheckBox getBooleanRenderer(JTable table, Object value,
+ boolean isSelected, int row) {
+
+ if (isSelected) {
+ m_boolRenderer.setForeground(table.getSelectionForeground());
+ m_boolRenderer.setBackground(table.getSelectionBackground());
+ } else {
+ m_boolRenderer.setForeground(table.getForeground());
+ m_boolRenderer.setBackground(getBackgroundColor(row));
+ }
+
+ m_boolRenderer.setSelected(((Boolean) value).booleanValue());
+
+ return m_boolRenderer;
+ }
+
+ /**
+ * {@inheritDoc}
+ * java.lang.Object, boolean, boolean, int, int)
+ */
+ public Component getTableCellRendererComponent(JTable table, Object value,
+ boolean isSelected, boolean hasFocus, int row, int column) {
+
+ if (value instanceof Boolean) {
+ return getBooleanRenderer(
+ table, value, isSelected, row);
+ }
+
+ m_defaultRenderer.getTableCellRendererComponent(
+ table, value, isSelected, hasFocus, row, column);
+ m_defaultRenderer.setHorizontalAlignment(value instanceof Number
+ ? SwingConstants.RIGHT : SwingConstants.LEFT);
+ if (!isSelected) {
+ m_defaultRenderer.setBackground(getBackgroundColor(row));
+ }
+ m_defaultRenderer.setOpaque(true);
+
+ if (table.isEnabled()) {
+ m_defaultRenderer.setForeground(table.getForeground());
+ } else {
+ m_defaultRenderer.setForeground(Color.gray);
+ }
+
+ return m_defaultRenderer;
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/Dvd.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/Dvd.java
new file mode 100644
index 000000000..342c73e0a
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/Dvd.java
@@ -0,0 +1,311 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.model;
+
+import java.io.Serializable;
+
+
+/**
+ * This is the model for a dvd.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class Dvd implements Serializable {
+ /** constant for fsk 6 */
+ public static final int FSK_6 = 0;
+ /** constant for fsk 16 */
+ public static final int FSK_16 = 1;
+ /** constant for fsk 18 */
+ public static final int FSK_18 = 2;
+
+ /** the title*/
+ private String m_title;
+ /** the main actor */
+ private String m_actor;
+ /** the year as Integer*/
+ private Integer m_year;
+ /** the direction */
+ private String m_direction;
+ /** flag for limited */
+ private Boolean m_limited;
+
+ /** the length in minutes*/
+ private int m_length;
+ /** flag for 'has bonus' */
+ private boolean m_bonus;
+ /** the region code*/
+ private int m_regionCode;
+ /** array with availabe languages */
+ private int[] m_languages;
+
+ /** the number of chapters */
+ private int m_chapters;
+ /** the fsk, see constants */
+ private int m_fsk;
+ /** the description */
+ private String m_description;
+
+ /** the category of this Dvd */
+ private DvdCategory m_category;
+
+ /**
+ * the default constructor, initialises all values with defaults, except of
+ * the category, it will be null
+ */
+ public Dvd() {
+ this("", //$NON-NLS-1$
+ "", //$NON-NLS-1$
+ 0,
+ "", //$NON-NLS-1$
+ false,
+ 0,
+ false,
+ 0,
+ new int[] { 0 },
+ 0,
+ FSK_6,
+ "", //$NON-NLS-1$
+ null);
+ }
+
+ /**
+ * public constructor with parameters for all properties of this model
+ *
+ * @param title the title
+ * @param actor the main actor
+ * @param year the year
+ * @param direction the direction
+ * @param limited flag for limited
+ * @param length the length
+ * @param bonus flag for 'has bonus'
+ * @param regionCode the region code
+ * @param languages the available languages
+ * @param chapters the number of chapters
+ * @param fsk the fsk, see constants
+ * @param description the description
+ * @param category the category
+ */
+ public Dvd(String title, String actor, int year, String direction,
+ boolean limited, int length, boolean bonus, int regionCode,
+ int[] languages, int chapters, int fsk, String description,
+ DvdCategory category) {
+
+ m_title = title;
+ m_actor = actor;
+ m_year = new Integer(year);
+ m_direction = direction;
+ m_limited = limited ? Boolean.TRUE : Boolean.FALSE; // see findBugs
+ m_length = length;
+ m_bonus = bonus;
+ m_regionCode = regionCode;
+ int[] langs = languages; // see findBugs
+ m_languages = langs; // see findBugs
+ m_chapters = chapters;
+ m_fsk = fsk;
+ m_description = description;
+ m_category = category;
+ }
+
+ /**
+ * @return the main actor
+ */
+ public String getActor() {
+ return m_actor;
+ }
+
+ /**
+ * sets (changes) the actor
+ * @param newActor the new actor
+ */
+ public void setActor(String newActor) {
+ m_actor = newActor;
+ }
+
+ /**
+ * @return whether the dvd has bonus or not
+ */
+ public boolean hasBonus() {
+ return m_bonus;
+ }
+
+ /**
+ * sets (changes) the flag for 'has bonus'
+ * @param newBonus the new value for 'has bonus'
+ */
+ public void setBonus(boolean newBonus) {
+ m_bonus = newBonus;
+ }
+
+ /**
+ * @return the number of chapters
+ */
+ public int getChapters() {
+ return m_chapters;
+ }
+
+ /**
+ * sets (changes) the value for the number of chapters
+ * @param newChapters the new number of chapters
+ */
+ public void setChapters(int newChapters) {
+ m_chapters = newChapters;
+ }
+
+ /**
+ * @return the description
+ */
+ public String getDescription() {
+ return m_description;
+ }
+
+ /**
+ * sets (changes) the value for the description
+ * @param newDescription the new description
+ */
+ public void setDescription(String newDescription) {
+ m_description = newDescription;
+ }
+
+ /**
+ * @return the direction
+ */
+ public String getDirection() {
+ return m_direction;
+ }
+
+ /**
+ * sets (changes) the value for the direction
+ * @param newDirection the new direction
+ */
+ public void setDirection(String newDirection) {
+ m_direction = newDirection;
+ }
+
+ /**
+ * @return the fsk, see constants
+ */
+ public int getFsk() {
+ return m_fsk;
+ }
+
+ /**
+ * sets (changes) the value for fsk, see also the constants
+ * @param newFsk the new value for fsk
+ */
+ public void setFsk(int newFsk) {
+ m_fsk = newFsk;
+ }
+
+ /**
+ * @return the available languages
+ */
+ public int[] getLanguages() {
+ int[] languages = m_languages; // see findBugs
+ return languages; // see findBugs
+ }
+
+ /**
+ * sets (changes) the availaible languages
+ * @param newLanguages an array containing the indices for the languages
+ */
+ public void setLanguages(int[] newLanguages) {
+ int[] languages = newLanguages;
+ m_languages = languages;
+ }
+
+ /**
+ * @return the length in minutes
+ */
+ public int getLength() {
+ return m_length;
+ }
+
+ /**
+ * sets (changes) the value for the length
+ * @param newLength the new length in minutes
+ */
+ public void setLength(int newLength) {
+ m_length = newLength;
+ }
+
+ /**
+ * @return whether is limited or not
+ */
+ public Boolean isLimited() {
+ return m_limited;
+ }
+
+ /**
+ * sets (changes) the flag for limited
+ * @param newLimited the new value for limited
+ */
+ public void setLimited(boolean newLimited) {
+ m_limited = newLimited ? Boolean.TRUE : Boolean.FALSE; // see findBugs
+ }
+
+ /**
+ * @return the region code
+ */
+ public int getRegionCode() {
+ return m_regionCode;
+ }
+
+ /**
+ * sets (changes) the value for the region code
+ * @param newRegionCode the new region code
+ */
+ public void setRegionCode(int newRegionCode) {
+ m_regionCode = newRegionCode;
+ }
+
+ /**
+ * @return the title
+ */
+ public String getTitle() {
+ return m_title;
+ }
+
+ /**
+ * sets (changes) the title
+ * @param newTitle the new title
+ */
+ public void setTitle(String newTitle) {
+ m_title = newTitle;
+ }
+
+ /**
+ * @return the year
+ */
+ public Integer getYear() {
+ return m_year;
+ }
+
+ /**
+ * sets (changes) the value for the year
+ * @param newYear the new year
+ */
+ public void setYear(int newYear) {
+ m_year = new Integer(newYear);
+ }
+ /**
+ * @return Returns the category.
+ */
+ public DvdCategory getCategory() {
+ return m_category;
+ }
+ /**
+ * @param category The category to set.
+ */
+ public void setCategory(DvdCategory category) {
+ m_category = category;
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdCategory.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdCategory.java
new file mode 100644
index 000000000..7bd498f0c
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdCategory.java
@@ -0,0 +1,235 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.model;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Vector;
+
+/**
+ * This is the model class for a category.
+ *
+ * @author BREDEX GmbH
+ * @created 14.04.2005
+ */
+public class DvdCategory implements Serializable {
+ /** the name of the category */
+ private String m_name;
+
+ /** the parent category, may be null */
+ private DvdCategory m_parent = null;
+
+ /** the children categories, a Vector, see insert() and remove() */
+ private List m_categories;
+
+ /** the dvds of this category, a Vector, see insert() and remove() */
+ private List m_dvds;
+
+ /** the enable state of the data object */
+ private boolean m_enabled = true;
+
+ /**
+ * public constructor
+ * @param name the name of the category
+ */
+ public DvdCategory(String name) {
+ m_name = name;
+
+ init();
+ }
+
+ /**
+ * private method for initialisation
+ */
+ private void init() {
+ m_categories = new Vector();
+ m_dvds = new Vector();
+ }
+
+ /**
+ * inserts newChild a as last child<br>
+ * sets the child's parent to this node, and then inserts <code>newChild</code>to this
+ * category's child <br>
+ * <code>newChild</code> must not be null
+ *
+ * @param newChild
+ * the category to insert under this node
+ * @throws IllegalArgumentException
+ * if <code>newChild</code> is null or is an ancestor of this
+ * node
+ */
+ public void insert(DvdCategory newChild) throws IllegalArgumentException {
+ insert(newChild, m_categories.size());
+ }
+
+ /**
+ * inserts newChild at position <code>childIndex</code><br>
+ * sets the child's parent to this node, and then inserts <code>newChild</code>to this
+ * category's child array at index <code>childIndex</code>. if
+ * <code>childIndex</code> is invalid (e.g. out of bounds)
+ * <code>newChild</code> will be appended <code>newChild</code> must not
+ * be null
+ *
+ * @param newChild
+ * the category to insert under this node
+ * @param childIndex
+ * the index in this node's child array where this node is to be
+ * inserted
+ * @throws IllegalArgumentException
+ * if <code>newChild</code> is null or is an ancestor of this
+ * node
+ */
+ public void insert(DvdCategory newChild, int childIndex)
+ throws IllegalArgumentException {
+ if (newChild == null) {
+ throw new IllegalArgumentException("new child must not be null"); //$NON-NLS-1$
+ }
+
+ newChild.setParent(this);
+ try {
+ ((Vector) m_categories).insertElementAt(newChild, childIndex);
+ } catch (ArrayIndexOutOfBoundsException aioobe) {
+ ((Vector) m_categories).add(newChild);
+ }
+ }
+
+ /**
+ * removes <code>child</code> from this category, sets the parent from
+ * <code>child</code> to null
+ *
+ * if <code>child</code> is not child of this no changes are made
+ *
+ * @param child
+ * the child to remove, must not be null
+ * @throws IllegalArgumentException
+ * if child is null
+ */
+ public void remove(DvdCategory child) throws IllegalArgumentException {
+ if (child == null) {
+ throw new IllegalArgumentException("child must not be null"); //$NON-NLS-1$
+ }
+
+ if (m_categories.contains(child)) {
+ child.setParent(null);
+ ((Vector)m_categories).remove(child);
+ }
+ }
+
+ /**
+ * removes <code>dvd</code> from this category, id <code>dvd</code> does
+ * not contains to this category, no changes are made.
+ *
+ * @param dvd
+ * the dvd to remove, must not be null
+ * @throws IllegalArgumentException
+ * if dvd is null
+ */
+ public void remove(Dvd dvd) throws IllegalArgumentException {
+ if (dvd == null) {
+ throw new IllegalArgumentException("dvd must not be null"); //$NON-NLS-1$
+ }
+
+ if (m_dvds.contains(dvd)) {
+ dvd.setCategory(null);
+ ((Vector)m_dvds).remove(dvd);
+ }
+ }
+
+ /**
+ * @return Returns the children.
+ */
+ public List getCategories() {
+ return m_categories;
+ }
+
+ /**
+ * @return Returns the dvds.
+ */
+ public List getDvds() {
+ return m_dvds;
+ }
+
+ /**
+ * appends <code>Dvd</code> to this the list of dvds of this category
+ * <code>dvd</code> must not be null
+ *
+ * @param dvd the dvd to add
+ * @throws IllegalArgumentException if dvd is null
+ */
+ public void insert(Dvd dvd) throws IllegalArgumentException {
+ insert(dvd, m_dvds.size());
+ }
+
+ /**
+ * adds <code>Dvd</code> to this category
+ * if <code>index</code> is invalid (e.g. out of bounds) <code>dvd</code> will be appended
+ * <code>dvd</code> must not be null
+
+ * @param dvd the dvd to add
+ * @param index the index for the dvd
+ * @throws IllegalArgumentException if dvd is null
+ */
+ public void insert(Dvd dvd, int index) throws IllegalArgumentException {
+ if (dvd == null) {
+ throw new IllegalArgumentException("dvd must not be null"); //$NON-NLS-1$
+ }
+
+ dvd.setCategory(this);
+ try {
+ ((Vector) m_dvds).insertElementAt(dvd, index);
+ } catch (ArrayIndexOutOfBoundsException aioobe) {
+ ((Vector) m_dvds).add(dvd);
+ }
+ }
+
+
+ /**
+ * @return Returns the parent.
+ */
+ public DvdCategory getParent() {
+ return m_parent;
+ }
+
+ /**
+ * @return Returns the name.
+ */
+ public String getName() {
+ return m_name;
+ }
+
+ /**
+ * @param name The name to set.
+ */
+ public void setName(String name) {
+ m_name = name;
+ }
+
+ /**
+ * @param parent The parent to set.
+ */
+ private void setParent(DvdCategory parent) {
+ m_parent = parent;
+ }
+
+ /**
+ * @return Returns the enable state of the data object.
+ */
+ public boolean isEnabled() {
+ return m_enabled;
+ }
+
+ /**
+ * @param enabled the enable state to set
+ */
+ public void setEnabled(boolean enabled) {
+ m_enabled = enabled;
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdDataObject.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdDataObject.java
new file mode 100644
index 000000000..55cfed55a
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdDataObject.java
@@ -0,0 +1,148 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.model;
+
+import org.eclipse.jubula.examples.aut.dvdtool.gui.DvdTableModel;
+
+/**
+ * This class holds a category and the corresponding table model containing the
+ * dvds, if there are any.
+ *
+ * @author BREDEX GmbH
+ * @created 28.02.2008
+ */
+public class DvdDataObject {
+
+ /** the category */
+ private DvdCategory m_category;
+
+ /** the table model containing the dvds for the category */
+ private DvdTableModel m_tableModel;
+
+ /**
+ * public constructor
+ * @param category the the category, must not be null
+ * @throws IllegalArgumentException if category is null
+ */
+ public DvdDataObject(DvdCategory category)
+ throws IllegalArgumentException {
+
+ checkCategoryParameter(category);
+
+ m_category = category;
+
+ createTableModel();
+ }
+ /**
+ * @return Returns the category.
+ */
+ public DvdCategory getCategory() {
+ return m_category;
+ }
+
+ /**
+ * @param category The category to set, must no be null
+ * @throws IllegalArgumentException if category is null
+ */
+ public void setCategory(DvdCategory category)
+ throws IllegalArgumentException {
+
+ checkCategoryParameter(category);
+
+ m_category = category;
+ createTableModel();
+ }
+
+ /**
+ * @return Returns the tableModel.
+ */
+ public DvdTableModel getTableModel() {
+ return m_tableModel;
+ }
+
+ /**
+ * @return true if the category has a parent
+ */
+ public boolean hasParent() {
+ return m_category.getParent() != null;
+ }
+
+ /**
+ * returns the name of the category
+ * {@inheritDoc}
+ */
+ public String toString() {
+ return m_category.getName();
+ }
+
+ /**
+ * @return true if the category has dvds
+ */
+ public boolean hasDvds() {
+ return m_category.getDvds().size() > 0;
+ }
+
+ /**
+ * @return true if the category has sub categories
+ */
+ public boolean hasCategories() {
+ return m_category.getCategories().size() > 0;
+ }
+
+ /**
+ * adds <code>dvd</code> to the category, creates also a new table model
+ *
+ * @param dvd
+ * the dvd instance to add
+ */
+ public void addDvd(Dvd dvd) {
+ m_category.insert(dvd);
+
+ createTableModel();
+ }
+
+ /**
+ * removes <code>dvd</code> from the category, creates also a new table
+ * model
+ *
+ * @param dvd
+ * the dvd instance to remove
+ */
+ public void removeDvd(Dvd dvd) {
+ m_category.remove(dvd);
+
+ createTableModel();
+ }
+
+ /**
+ * (re)creats the table model
+ */
+ private void createTableModel() {
+ m_tableModel = new DvdTableModel(
+ m_category.getName(), m_category.getDvds());
+ }
+
+ /**
+ * checks <code>category</code> for non null
+ *
+ * @param category
+ * the category
+ * @throws IllegalArgumentException
+ * if category is null
+ */
+ private void checkCategoryParameter(DvdCategory category)
+ throws IllegalArgumentException {
+ if (category == null) {
+ throw new IllegalArgumentException("category must not be null"); //$NON-NLS-1$
+ }
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdGuiConfiguration.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdGuiConfiguration.java
new file mode 100644
index 000000000..cc3d70d27
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdGuiConfiguration.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.model;
+
+import java.io.Serializable;
+
+/**
+ * This is the model class for storage of gui configuration of dvd details.
+ *
+ * @author BREDEX GmbH
+ * @created 28.02.2008
+ */
+public class DvdGuiConfiguration implements Serializable {
+
+ /** tab placement defined by constant from JTabbedPane */
+ private int m_tabPlacement = -1;
+
+ /** radio button label placement defined by constant from AbstractButton */
+ private int m_labelPlacement = -1;
+
+ /**
+ * public constructor
+ */
+ public DvdGuiConfiguration() {
+ // empty
+ }
+
+ /**
+ * @return Returns the tab placement.
+ */
+ public int getTabPlacement() {
+ return m_tabPlacement;
+ }
+
+ /**
+ * @param tabPlacement The tab placement to set.
+ */
+ public void setTabPlacement(int tabPlacement) {
+ m_tabPlacement = tabPlacement;
+ }
+
+ /**
+ * @return Returns the radio button label placement.
+ */
+ public int getLabelPlacement() {
+ return m_labelPlacement;
+ }
+
+ /**
+ * @param labelPlacement The radio button label placement to set.
+ */
+ public void setLabelPlacement(int labelPlacement) {
+ m_labelPlacement = labelPlacement;
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdTransferableCategory.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdTransferableCategory.java
new file mode 100644
index 000000000..6dd5dffde
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/DvdTransferableCategory.java
@@ -0,0 +1,103 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.model;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.io.Serializable;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreePath;
+
+
+/**
+ * The instances of this class provide a DvdCategory object and a node hash code
+ * for transfer operations.
+ * The node hash code can be used for identification of the corresponding node.
+ * (This class is needed for supporting 'drag and drop' feature in the tree.)
+ *
+ * @author BREDEX GmbH
+ * @created 05.02.2008
+ */
+public class DvdTransferableCategory implements Transferable, Serializable {
+
+ /** serialVersionUID */
+ public static final long serialVersionUID = 2L;
+
+ /** the data flavor class */
+ private static final Class DATA_FLAVOR_CLASS = DvdCategory.class;
+ /** the transfer data flavor */
+ private static final DataFlavor DATA_FLAVOR = new DataFlavor(
+ DATA_FLAVOR_CLASS, "DVD Category"); //$NON-NLS-1$
+ /** the array of supported transfer data flavors */
+ private static final DataFlavor[] SUPPORTED_FLAVORS = {DATA_FLAVOR};
+
+ /** the DvdCategory object to be transferred */
+ private final DvdCategory m_category;
+ /** the node hash code to be transferred */
+ private final int m_nodeHashCode;
+
+ /**
+ * public constructor
+ * @param treePath The tree path to the node containing the DvdCategory
+ * object to be transferred together with the node hash code.
+ */
+ public DvdTransferableCategory(TreePath treePath) {
+ DefaultMutableTreeNode node =
+ (DefaultMutableTreeNode) treePath.getLastPathComponent();
+ DvdDataObject dataObject = (DvdDataObject) node.getUserObject();
+ m_category = dataObject.getCategory();
+ m_nodeHashCode = node.hashCode();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public DataFlavor[] getTransferDataFlavors() {
+ return SUPPORTED_FLAVORS;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public boolean isDataFlavorSupported(DataFlavor flavor) {
+ return (flavor.getRepresentationClass() == DATA_FLAVOR_CLASS);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public Object getTransferData(DataFlavor flavor)
+ throws UnsupportedFlavorException {
+
+ if (isDataFlavorSupported(flavor)) {
+ return this;
+ }
+
+ throw new UnsupportedFlavorException(flavor);
+ }
+
+ /**
+ * @return the contained DvdCategory object
+ */
+ public DvdCategory getCategory() {
+ return m_category;
+ }
+
+ /**
+ * @return the contained node hash code
+ */
+ public int getNodeHashCode() {
+ return m_nodeHashCode;
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/StringArraySelection.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/StringArraySelection.java
new file mode 100644
index 000000000..142abc6a0
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/model/StringArraySelection.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.model;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+
+/**
+ * A <code>Transferable</code> which implements the capability required
+ * to transfer a <code>String</code> array.
+ *
+ * @author BREDEX GmbH
+ * @created 06.02.2008
+ */
+public class StringArraySelection implements Transferable {
+
+ /** the data flavor class */
+ private static final Class DATA_FLAVOR_CLASS = String.class;
+ /** the transfer data flavor */
+ private static final DataFlavor DATA_FLAVOR = new DataFlavor(
+ DATA_FLAVOR_CLASS, "String array"); //$NON-NLS-1$
+ /** the array of supported transfer data flavors */
+ private static final DataFlavor[] SUPPORTED_FLAVORS = {DATA_FLAVOR};
+
+ /** the data to be transferred */
+ private String[] m_stringArray;
+
+ /**
+ * Creates a <code>Transferable</code> capable of transferring
+ * the specified <code>String</code> array.
+ *
+ * @param strArray the data to be transferred
+ */
+ public StringArraySelection(String[] strArray) {
+ m_stringArray = strArray;
+ }
+
+ /**
+ * Returns an array of flavors in which this <code>Transferable</code>
+ * can provide the data.
+ *
+ * @return an array of the supported flavors
+ */
+ public DataFlavor[] getTransferDataFlavors() {
+ // Note: Returning flavors itself would allow client code to modify
+ // our internal behavior.
+ return (DataFlavor[])SUPPORTED_FLAVORS.clone();
+ }
+
+ /**
+ * Returns whether the requested flavor is supported by this
+ * <code>Transferable</code>.
+ *
+ * @param flavor the requested flavor for the data
+ * @return true if <code>flavor</code> is supported
+ */
+ public boolean isDataFlavorSupported(DataFlavor flavor) {
+ for (int i = 0; i < SUPPORTED_FLAVORS.length; i++) {
+ if (flavor.equals(SUPPORTED_FLAVORS[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Returns the <code>Transferable</code>'s data in the requested
+ * <code>DataFlavor</code> if possible.
+ *
+ * @param flavor the requested flavor for the data
+ * @return the data in the requested flavor, as outlined above
+ * @throws UnsupportedFlavorException if the requested data flavor is not
+ * supported
+ */
+ public Object getTransferData(DataFlavor flavor)
+ throws UnsupportedFlavorException {
+
+ if (isDataFlavorSupported(flavor)) {
+ return m_stringArray;
+ }
+
+ throw new UnsupportedFlavorException(flavor);
+
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdInvalidContentException.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdInvalidContentException.java
new file mode 100644
index 000000000..632f946d1
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdInvalidContentException.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.persistence;
+
+/**
+ * This exception is thrown if a file could not loaded or does not contain a dvd library.
+ *
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdInvalidContentException extends DvdPersistenceException {
+
+ /**
+ * public constructor
+ * @param message a message describing the exception
+ * @param exception a nested exception
+ */
+ public DvdInvalidContentException(String message, Exception exception) {
+ super(message, exception);
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdInvalidObjectException.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdInvalidObjectException.java
new file mode 100644
index 000000000..55e160cf7
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdInvalidObjectException.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.persistence;
+
+/**
+ * This exception is thrown if the object could not made persistent.
+ *
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdInvalidObjectException extends DvdPersistenceException {
+
+ /**
+ * public constructor
+ * @param message a message describing the exception
+ * @param exception a nested exception
+ */
+ public DvdInvalidObjectException(String message, Exception exception) {
+ super(message, exception);
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdPersistenceException.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdPersistenceException.java
new file mode 100644
index 000000000..ff705ebfc
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdPersistenceException.java
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.persistence;
+
+import org.eclipse.jubula.examples.aut.dvdtool.exception.DvdException;
+
+/**
+ * This exception is thrown in case of a persistence error.
+ *
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdPersistenceException extends DvdException {
+
+ /**
+ * public constructor
+ * @param message a message describing the exception
+ * @param exception a nested exception
+ */
+ public DvdPersistenceException(String message, Exception exception) {
+ super(message, exception);
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdPersistenceManager.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdPersistenceManager.java
new file mode 100644
index 000000000..fb3f19cd8
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/persistence/DvdPersistenceManager.java
@@ -0,0 +1,173 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.persistence;
+
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InvalidClassException;
+import java.io.NotSerializableException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OptionalDataException;
+import java.io.StreamCorruptedException;
+import java.util.List;
+import java.util.Vector;
+
+
+/**
+ * This class is the persistence manager. It's a singleton.
+ *
+ * @author BREDEX GmbH
+ * @created 13.04.2005
+ */
+public class DvdPersistenceManager {
+
+ /** the singleton instance reference */
+ private static DvdPersistenceManager manager = null;
+
+ /**
+ * private constructor, use method singleton() for an instance of this manager
+ */
+ private DvdPersistenceManager() {
+ // empty
+ }
+
+ /**
+ * Implementation of the singleton pattern.
+ * @return the single instance of this manager.
+ */
+ public static DvdPersistenceManager singleton() {
+ if (manager == null) {
+ manager = new DvdPersistenceManager();
+ }
+ return manager;
+ }
+
+ /**
+ * Save object <code>list</code> to <code>file</code> (via serialisation).
+ * @param file the file to store object <code>list</code> in
+ * @param list the object <code>list</code> to save; all objects must
+ * implement serialisable
+ * @throws DvdPersistenceException if an io error occurs
+ * @throws DvdInvalidObjectException if object <code>list</code> could not
+ * made persistent.
+ */
+ public void save(File file, List list)
+ throws DvdInvalidObjectException, DvdPersistenceException {
+ try {
+ FileOutputStream fs = new FileOutputStream(file);
+ ObjectOutputStream output = new ObjectOutputStream(fs);
+ try {
+ for (int i = 0; i < list.size(); i++) {
+ Object object = list.get(i);
+ output.writeObject(object);
+ }
+ } catch (InvalidClassException ice) {
+ output.close();
+ file.delete();
+ throw new DvdPersistenceException("exception.save.failure", ice); //$NON-NLS-1$
+ } catch (NotSerializableException nse) {
+ output.close();
+ file.delete();
+ throw new DvdInvalidObjectException("exception.save.failure", nse); //$NON-NLS-1$
+ } catch (IOException ioe) {
+ output.close();
+ file.delete();
+ throw new DvdPersistenceException("exception.ioerror", ioe); //$NON-NLS-1$
+ } finally {
+ output.close();
+ }
+ } catch (FileNotFoundException fnfe) {
+ throw new DvdPersistenceException("exception.invalid.file", fnfe); //$NON-NLS-1$
+ } catch (IOException ioe) {
+ // try to delete the file
+ file.delete();
+ throw new DvdPersistenceException("exception.ioerror", ioe); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ * Loads an object list from <code>file</code> (via deserialisation).
+ * @param file the <code>file</code> to load the object list from
+ * @return the read object list
+ * @throws DvdPersistenceException if an io error occurs
+ * @throws DvdInvalidContentException if the <code>file</code> does not
+ * contain the expected data
+ */
+ public List load(File file) throws DvdInvalidContentException,
+ DvdPersistenceException {
+ try {
+ FileInputStream fs = new FileInputStream(file);
+ try {
+ ObjectInputStream input = new ObjectInputStream(fs);
+ List list = new Vector();
+ try {
+ // this infinite loop will be exited by an EOFException
+ // when the end of the stream is reached
+ do {
+ Object object = input.readObject();
+ list.add(object);
+ } while (true);
+ } catch (EOFException eofe) {
+ // EOFException is expected after all objects are read
+ fs.close();
+ input.close();
+ return list;
+ } catch (ClassNotFoundException cnfe) {
+ fs.close();
+ input.close();
+ throw new DvdInvalidContentException(
+ "exception.invalid.file.content", cnfe); //$NON-NLS-1$
+ } catch (InvalidClassException ice) {
+ fs.close();
+ input.close();
+ throw new DvdInvalidContentException(
+ "exception.invalid.file.content", ice); //$NON-NLS-1$
+ } catch (StreamCorruptedException sce) {
+ fs.close();
+ input.close();
+ throw new DvdInvalidContentException(
+ "exception.invalid.file.content", sce); //$NON-NLS-1$
+ } catch (OptionalDataException ode) {
+ fs.close();
+ input.close();
+ throw new DvdInvalidContentException(
+ "exception.invalid.file.content", ode); //$NON-NLS-1$
+ } catch (IOException ioe) {
+ fs.close();
+ input.close();
+ throw new DvdPersistenceException("exception.ioerror", ioe); //$NON-NLS-1$
+ }
+ } catch (StreamCorruptedException sce) {
+ try {
+ fs.close();
+ } catch (IOException e) { // NOPMD by zeb on 10.04.07 14:08
+ // fileInputStream could not be closed -> do nothing
+ }
+ throw new DvdInvalidContentException(
+ "exception.invalid.file.content", sce); //$NON-NLS-1$
+ } catch (IOException ioe) {
+ try {
+ fs.close();
+ } catch (IOException e) { // NOPMD by zeb on 10.04.07 14:08
+ // fileInputStream could not be closed -> do nothing
+ }
+ throw new DvdPersistenceException("exception.ioerror", ioe); //$NON-NLS-1$
+ }
+ } catch (FileNotFoundException fnfe) {
+ throw new DvdPersistenceException("exception.ioerror", fnfe); //$NON-NLS-1$
+ }
+ }
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/Resources.java b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/Resources.java
new file mode 100644
index 000000000..6c949ce4c
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/Resources.java
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2010 BREDEX GmbH.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * BREDEX GmbH - initial API and implementation and/or initial documentation
+ *******************************************************************************/
+package org.eclipse.jubula.examples.aut.dvdtool.resources;
+
+import java.net.URL;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import javax.swing.ImageIcon;
+
+/**
+ * Accessor class for internationalizable messages and other resources, like images.
+ *
+ * @author BREDEX GmbH
+ * @created 11.04.2005
+ */
+public class Resources {
+ /** the application icon */
+ public static final String APP_ICON = "icon.gif"; //$NON-NLS-1$
+ /** the icon for a category with dvds */
+ public static final String CAT_ICON = "category.gif"; //$NON-NLS-1$
+ /** the icon for a category with no dvds */
+ public static final String EMPTY_CAT_ICON = "empty_category.gif"; //$NON-NLS-1$
+ /** the directory to the resources */
+ private static final String RESOURCES_DIR = "resources"; //$NON-NLS-1$
+ /** the bundle name */
+ private static final String BUNDLE_NAME = "org.eclipse.jubula.examples.aut.dvdtool.resources.messages"; //$NON-NLS-1$
+
+ /** the resource bundle */
+ private static ResourceBundle resourceBundle;
+
+ /**
+ * static initialisation
+ */
+ static {
+ load();
+ }
+
+ /**
+ * private constructor, use static methods
+ */
+ private Resources() {
+ // empty
+ }
+
+ /**
+ * @return the name of the welcome screen
+ */
+ public static String getWelcomeScreenName() {
+ return Resources.getString("dvdtool.html"); //$NON-NLS-1$
+ }
+
+ /**
+ * private method loading the resource bundle
+ */
+ private static void load() {
+ // unset the current resource bundle
+ resourceBundle = null;
+ try {
+ resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
+ } catch (MissingResourceException mre) {
+ String message = mre.getMessage();
+ }
+ }
+
+ /**
+ * Returns the string for the given <code>key</code>. If the resource
+ * bundle could not initialized, or <code>key</code> was not found, the
+ * key enclosed with '!' is returned.
+ *
+ * @param key
+ * the key to search for
+ * @return the assigned string
+ */
+ public static String getString(String key) {
+ try {
+ return resourceBundle.getString(key);
+ } catch (NullPointerException npe) {
+ return '!' + key + '!';
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ }
+ }
+
+ /**
+ * changes the language to <code>locale</code>
+ * @param locale the new locale, use constants from java.util.Locale
+ */
+ public static void setLanguage(Locale locale) {
+ Locale.setDefault(locale);
+
+ // reload the resource bundle
+ load();
+ }
+
+ /**
+ * creates a url to <code>name</code> with file: protocol
+ * @param name name of a file, use the defined constants/getter here
+ * @return a new String containing the url
+ */
+ public static String getFileUrl(String name) {
+ URL url = getURLResource("/" + RESOURCES_DIR + "/" + name); //$NON-NLS-1$ //$NON-NLS-2$
+ if (url != null) {
+ return url.toExternalForm();
+ }
+
+ return null;
+ }
+
+ /**
+ * returns the image icon with <code>name</code>
+ * @param name the name of the, use the defined constants/getter here
+ * @return the image icon
+ */
+ public static ImageIcon getImageIcon(String name) {
+ URL url = getURLResource("/" + RESOURCES_DIR + "/" + name); //$NON-NLS-1$ //$NON-NLS-2$
+ if (url != null) {
+ return new ImageIcon(url);
+ }
+
+ return new ImageIcon();
+ }
+
+ /**
+ * return an URL for resource <code>filename</code> if found by the classloader
+ * @param filename filename of the resource
+ * @return an URL or null
+ */
+ private static URL getURLResource(String filename) {
+ return Resources.class.getResource(filename);
+ }
+
+}
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/messages.properties b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/messages.properties
new file mode 100644
index 000000000..906727d97
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/messages.properties
@@ -0,0 +1,103 @@
+###############################################################################
+# Copyright (c) 2004, 2010 BREDEX GmbH.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+language.german=German
+language.english=English
+language.french=French
+languages=Languages
+language.italian=Italian
+language.spanish=Spanish
+region_code.rc0=RC0
+region_code.rc1=RC1
+region_code.rc2=RC2
+region_code.rc3=RC3
+region_code.rc4=RC4
+region_code.rc5=RC5
+region_code.rc6=RC6
+region_code.rc7=RC8
+region_code=Region code
+application.name=DVD Manager Version 2.0
+application.title=DVD Manager
+dialog.about.title=Info
+dialog.error.title=Error
+dialog.message.title=Information
+dialog.input.title=Input
+dialog.confirm.remove.title=Confirm Remove
+dialog.confirm.overwrite.file.title=Confirm Overwrite
+dialog.confirm.exit.needs.save.title=Save?
+waiting.dialog.title=Waiting dialog
+waiting.dialog.message=Please wait ...
+title=Title
+actor=Actor
+direction=Director
+year=Year
+limited=Limited
+menu.file=File
+menu.file.mnemonic=F
+menu.file.save=Save...
+menu.file.open=Open...
+menu.file.exit=Exit
+menu.edit=Edit
+menu.edit.mnemonic=E
+menu.edit.add.category=Add category...
+menu.edit.enable.category=Enable category
+menu.edit.disable.category=Disable category
+menu.edit.remove.category=Remove category
+menu.edit.add.dvd=Add DVD...
+menu.edit.remove.dvd=Remove DVD
+menu.edit.add.language=Add language
+menu.edit.remove.language=Remove language
+menu.config=Configurate
+menu.config.mnemonic=C
+menu.config.dvddetails=DVD details
+menu.config.dvddetails.tabstotop=Tabs to top
+menu.config.dvddetails.tabstobottom=Tabs to bottom
+menu.config.dvddetails.tabstoleft=Tabs to left
+menu.config.dvddetails.tabstoright=Tabs to right
+menu.config.dvddetails.content=Rating panel
+menu.config.dvddetails.content.labelstotop=Labels to top
+menu.config.dvddetails.content.labelstobottom=Labels to bottom
+menu.config.dvddetails.content.labelstoleft=Labels to left
+menu.config.dvddetails.content.labelstoright=Labels to right
+menu.help=Help
+menu.help.mnemonic=H
+menu.help.about=Info...
+action.clear.description=Clear description
+action.copy.to.clipboard=Copy to clipboard
+action.change.tab.selection=Change tab selection
+action.show.waiting.dialog=Show waiting dialog
+technical=Technics
+content=Content
+category=Category
+categories=Categories
+length_in_minutes=Length in minutes
+bonus=Bonus
+chapter=Chapter
+description=Description
+Rating=Rating
+Rating1=12
+Rating2=15
+Rating3=18
+dvdtool.html=dvdtool.html
+dvdfile.description=DVD Library (*.dvd)
+exception.invalid.file=invalid file name
+exception.invalid.file.content=The file does not contain a DVD library.
+exception.ioerror=An IO-Error has occured.
+exception.save.failure=The DVD library could not be stored.
+new.category.input.message=Please enter a name for the new category
+new.language.input.message=Please enter a name for the new language
+remove.category.confirmation.has.categories=The category contains further categories.
+remove.category.confirmation.has.dvd=The category contains DVDs.
+remove.category.confirmation.consequence=These are deleted likewise.
+remove.category.confirmation.question=Would you like to delete the category nevertheless?
+save.overwrite.confirmation.fileexists=The file exists already.
+save.overwrite.confirmation.question=Would you like to overwrite the file?
+exit.library.has.changed=The library was changed.
+exit.question.save=Would you like to save the library?
+open.library.has.changed=The current library was changed.
+open.question.save=Would you like to save the library?
+dialog.confirm.open.needs.save.title=Save?
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/messages_de.properties b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/messages_de.properties
new file mode 100644
index 000000000..6743c3e73
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/org/eclipse/jubula/examples/aut/dvdtool/resources/messages_de.properties
@@ -0,0 +1,103 @@
+###############################################################################
+# Copyright (c) 2004, 2010 BREDEX GmbH.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+###############################################################################
+language.german=Deutsch
+language.english=Englisch
+language.french=Franz\u00F6sisch
+languages=Sprachen
+language.italian=Italienisch
+language.spanish=Spanisch
+region_code.rc0=RC0
+region_code.rc1=RC1
+region_code.rc2=RC2
+region_code.rc3=RC3
+region_code.rc4=RC4
+region_code.rc5=RC5
+region_code.rc6=RC6
+region_code.rc7=RC8
+region_code=Regionalcode
+application.name=DVD-Verwaltung Version 2.0
+application.title=DVD Verwaltung
+dialog.about.title=Info
+dialog.error.title=Fehler
+dialog.message.title=Information
+dialog.input.title=Eingabe
+dialog.confirm.remove.title=Löschen bestätigen
+dialog.confirm.overwrite.file.title=Überschreiben bestätigen
+dialog.confirm.exit.needs.save.title=Speichern?
+waiting.dialog.title=Warte-Dialog
+waiting.dialog.message=Bitte warten ...
+title=Titel
+actor=Hauptdarsteller
+direction=Regie
+year=Jahr
+limited=Limitiert
+menu.file=Datei
+menu.file.mnemonic=D
+menu.file.save=Speichern...
+menu.file.open=Öffnen...
+menu.file.exit=Beenden
+menu.edit=Bearbeiten
+menu.edit.mnemonic=B
+menu.edit.add.category=Kategorie hinzufügen...
+menu.edit.enable.category=Kategorie entsperren
+menu.edit.disable.category=Kategorie sperren
+menu.edit.remove.category=Kategorie löschen
+menu.edit.add.dvd=DVD hinzufügen...
+menu.edit.remove.dvd=DVD löschen
+menu.edit.add.language=Sprache hinzufügen
+menu.edit.remove.language=Sprache löschen
+menu.config=Konfigurieren
+menu.config.mnemonic=K
+menu.config.dvddetails=DVD-Details
+menu.config.dvddetails.tabstotop=Reiterköpfe oben
+menu.config.dvddetails.tabstobottom=Reiterköpfe unten
+menu.config.dvddetails.tabstoleft=Reiterköpfe links
+menu.config.dvddetails.tabstoright=Reiterköpfe rechts
+menu.config.dvddetails.content=FSK-Panel
+menu.config.dvddetails.content.labelstotop=Labels oben
+menu.config.dvddetails.content.labelstobottom=Labels unten
+menu.config.dvddetails.content.labelstoleft=Labels links
+menu.config.dvddetails.content.labelstoright=Labels rechts
+menu.help=Hilfe
+menu.help.mnemonic=H
+menu.help.about=Info...
+action.clear.description=Beschreibung leeren
+action.copy.to.clipboard=Kopiere ins Clipboard
+action.change.tab.selection=Reiter-Selektion wechseln
+action.show.waiting.dialog=Warte-Dialog anzeigen
+technical=Technik
+content=Inhalt
+category=Kategorie
+categories=Kategorien
+length_in_minutes=L\u00E4nge in Minuten
+bonus=Bonusmaterial
+chapter=Kapitel
+description=Beschreibung
+Rating=FSK
+Rating1=6
+Rating2=16
+Rating3=18
+dvdtool.html=dvdtool_de.html
+dvdfile.description=DVD Bibliothek (*.dvd)
+exception.invalid.file=ungültiger Dateiname
+exception.invalid.file.content=Die Datei enthält keine DVD Bibliothek.
+exception.ioerror=Ein Lese-/Schreibfehler ist aufgetreten.
+exception.save.failure=Die Bibliothek konnte nicht gespeichert werden.
+new.category.input.message=Bitte einen Namen für die neue Kategorie eingeben.
+new.language.input.message=Bitte einen Namen für die neue Sprache eingeben.
+remove.category.confirmation.has.categories=Die Kategorie enthält weitere Kategorien.
+remove.category.confirmation.has.dvd=Die Kategorie enthält DVDs.
+remove.category.confirmation.consequence=Diese werden ebenfalls gelöscht.
+remove.category.confirmation.question=Möchten Sie die Kategorie trotzdem löschen?
+save.overwrite.confirmation.fileexists=Die Datei existiert bereits.
+save.overwrite.confirmation.question=Möchten Sie die Datei überschreiben?
+exit.library.has.changed=Die Bibliothek wurde geändert.
+exit.question.save=Möchten Sie die Bibliothek speichern?
+open.library.has.changed=Die Bibliothek wurde geändert.
+open.question.save=Möchten Sie die Bibliothek speichern?
+dialog.confirm.open.needs.save.title=Speichern?
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/resources/category.gif b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/category.gif
new file mode 100644
index 000000000..d5eb11c02
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/category.gif
Binary files differ
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvd.jpg b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvd.jpg
new file mode 100644
index 000000000..475101be1
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvd.jpg
Binary files differ
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvdtool.html b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvdtool.html
new file mode 100644
index 000000000..35ab63a5e
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvdtool.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>DVD Manager</title>
+ </head>
+<body>
+ <center><h1><font color="#14AA8C">DVD Manager</font></h1></center>
+ <center><img src="dvd.jpg" width="304" height="290"></center>
+ <center><font color="#14AA8C">Version 2.0</font></center>
+</body>
+</html>
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvdtool_de.html b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvdtool_de.html
new file mode 100644
index 000000000..a2d7ed1ad
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/dvdtool_de.html
@@ -0,0 +1,10 @@
+<html>
+<head>
+ <title>DVD Verwaltung</title>
+ </head>
+<body>
+ <center><h1><font color="#14AA8C">DVD Verwaltung</font></h1></center>
+ <center><img src="dvd.jpg" width="304" height="290"></center>
+ <center><font color="#14AA8C">Version 2.0</font></center>
+</body>
+</html>
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/resources/empty_category.gif b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/empty_category.gif
new file mode 100644
index 000000000..713177a7e
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/empty_category.gif
Binary files differ
diff --git a/org.eclipse.jubula.examples.aut.dvdtool/src/resources/icon.gif b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/icon.gif
new file mode 100644
index 000000000..3594afea5
--- /dev/null
+++ b/org.eclipse.jubula.examples.aut.dvdtool/src/resources/icon.gif
Binary files differ

Back to the top