summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java
diff options
context:
space:
mode:
authorJonathan Bauer2015-08-03 14:53:50 +0200
committerJonathan Bauer2015-08-03 14:53:50 +0200
commitb7b15470dad927840888341e23b7eb37f71b2afa (patch)
tree9ba9465f517b95c363ad2ff249ce38d9a11242b2 /dozentenmodul/src/main/java
parent[client] implemented search filter in ImageListWindow, auto sort table data i... (diff)
parent[client] Removed minimum size of lecture table. (diff)
downloadtutor-module-b7b15470dad927840888341e23b7eb37f71b2afa.tar.gz
tutor-module-b7b15470dad927840888341e23b7eb37f71b2afa.tar.xz
tutor-module-b7b15470dad927840888341e23b7eb37f71b2afa.zip
Merge branch 'v1.1' of git.openslx.org:openslx-ng/tutor-module into v1.1
Diffstat (limited to 'dozentenmodul/src/main/java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java4
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureListWindowLayout.java1
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/util/OpenLinks.java71
3 files changed, 25 insertions, 51 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java
index abc5d9a8..498c44f8 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageDetailsWindowLayout.java
@@ -18,6 +18,7 @@ import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
+import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
@@ -66,7 +67,8 @@ public abstract class ImageDetailsWindowLayout extends JDialog {
// description
txtDescription = new JTextArea();
infoPanel.add(new JLabel("Beschreibung"), GridPos.get(0, 1, false, false));
- infoPanel.add(txtDescription, GridPos.get(1, 1, true, false));
+
+ infoPanel.add(new JScrollPane(txtDescription), GridPos.get(1, 1, true, false));
// owner
lblOwner = new PersonLabel();
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureListWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureListWindowLayout.java
index 7304fa99..87523519 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureListWindowLayout.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/LectureListWindowLayout.java
@@ -66,7 +66,6 @@ public abstract class LectureListWindowLayout extends CompositePage {
JPanel tableGroup = new JPanel();
tableGroup.setBorder(new TitledBorder(tableGroupLabel));
tableGroup.setLayout(new GridBagLayout());
- tableGroup.setMinimumSize(new Dimension(800, 600));
tableGroup.setPreferredSize(tableGroup.getMinimumSize());
// filter text field
searchTextField = new JTextField();
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/util/OpenLinks.java b/dozentenmodul/src/main/java/org/openslx/dozmod/util/OpenLinks.java
index 4c477f3d..3263ee70 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/util/OpenLinks.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/util/OpenLinks.java
@@ -3,9 +3,6 @@ package org.openslx.dozmod.util;
import java.awt.Desktop;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
import org.apache.log4j.Logger;
@@ -16,62 +13,38 @@ public class OpenLinks {
*/
private final static Logger LOGGER = Logger.getLogger(OpenLinks.class);
- /**
- * Map containing the links
- */
- @SuppressWarnings("serial")
- private static Map<String, String> links = Collections.unmodifiableMap(new HashMap<String, String>(){{
- put("faq", "http://bwlehrpool.hs-offenburg.de");
- put("otrs", "http://bwlehrpool.hs-offenburg.de");
- put("vmware", "https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0");
- put("intro", "http://www.hs-offenburg.de/fileadmin/Einrichtungen/hrz/Projekte/bwLehrpool/3_bwLehrpool_-_Image_einbinden_und_starten.pdf");
- // TODO use enum not map
- }});
+ private static final Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
- /**
- * Static URIs
- */
+ enum Link {
+ FAQ("http://bwlehrpool.hs-offenburg.de"),
+ VMWARE("https://my.vmware.com/de/web/vmware/free#desktop_end_user_computing/vmware_player/6_0"),
+ INTRO(
+ "http://www.hs-offenburg.de/fileadmin/Einrichtungen/hrz/Projekte/bwLehrpool/3_bwLehrpool_-_Image_einbinden_und_starten.pdf");
+
+ // TODO use enum not map
+ private final URI uri;
- private static Map<String, URI> uris;
- static {
- // temp map
- Map<String, URI> tmpUris = new HashMap<String, URI>();
- for (String key : links.keySet()) {
- URI tmp;
+ private Link(String uri) {
+ URI tmp;
try {
- tmp = new URI(links.get(key));
+ tmp = new URI(uri);
} catch (URISyntaxException e) {
- // should never happen!
- LOGGER.error("Bad URI syntax of '" + key + "', see trace: ", e);
+ LOGGER.error("Hard-Coded URI contains syntax error!", e);
tmp = null;
}
- tmpUris.put(key, tmp);
+ this.uri = tmp;
}
- // check sizes of maps to be equal
- if (links.size() != tmpUris.size()) {
- LOGGER.error("Links and URIs have different sizes, this should not happen. Contact a developper.");
- }
-
- // all good, save it to the actual 'uris' map
- uris = Collections.unmodifiableMap(tmpUris);
}
-
- public static void openWebpage(String key) {
- // first check if we have the link for the request key
- if (!uris.containsKey(key)) {
- LOGGER.error("OpenLinks has to link to '" + key + "'. Check if the given key actually exists.");
+ public static void openWebpage(Link location) {
+
+ if (desktop == null || !desktop.isSupported(Desktop.Action.BROWSE))
return;
+ try {
+ desktop.browse(location.uri);
+ } catch (Exception e) {
+ LOGGER.error("Got exception in openWebpage: ", e);
}
- Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop()
- : null;
- if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
- try {
- desktop.browse(uris.get(key));
- } catch (Exception e) {
- LOGGER.debug("Got exception in openWebpage: ", e);
- }
- }
- }// end openWebpage
+ }
}