summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java
diff options
context:
space:
mode:
authorJonathan Bauer2016-01-21 18:30:16 +0100
committerJonathan Bauer2016-01-21 18:30:16 +0100
commit7e6f4a7c094ac014d1c63b163c57d62e800dfe53 (patch)
treea6a79e170dda51e9f2cbf0fbf1b1ad6cd7f5b55b /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java
parent[server] Add section entry to xml (diff)
downloadtutor-module-7e6f4a7c094ac014d1c63b163c57d62e800dfe53.tar.gz
tutor-module-7e6f4a7c094ac014d1c63b163c57d62e800dfe53.tar.xz
tutor-module-7e6f4a7c094ac014d1c63b163c57d62e800dfe53.zip
[client] Changed location selector from lists to tree selection
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java
index b7e509cb..00c35381 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureDetailsWindow.java
@@ -36,6 +36,7 @@ import org.openslx.bwlp.thrift.iface.LectureWrite;
import org.openslx.bwlp.thrift.iface.UserInfo;
import org.openslx.dozmod.gui.Gui;
import org.openslx.dozmod.gui.MainWindow;
+import org.openslx.dozmod.gui.control.JCheckBoxTree;
import org.openslx.dozmod.gui.helper.DateTimeHelper;
import org.openslx.dozmod.gui.helper.MessageType;
import org.openslx.dozmod.gui.helper.TextChangeListener;
@@ -49,6 +50,7 @@ import org.openslx.dozmod.thrift.ThriftActions;
import org.openslx.dozmod.thrift.ThriftActions.DownloadCallback;
import org.openslx.dozmod.thrift.ThriftActions.LectureMetaCallback;
import org.openslx.dozmod.thrift.ThriftError;
+import org.openslx.dozmod.thrift.cache.MetaDataCache;
import org.openslx.dozmod.thrift.cache.UserCache;
import org.openslx.dozmod.util.FormatHelper;
import org.openslx.dozmod.util.MapHelper;
@@ -201,15 +203,19 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements
btnLocations.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
- locationInfo = LocationSelectionWindow.open(me, lecture.locationIds, lecture.limitToLocations);
- if (locationInfo == null) {
+ LocationInfo ret = LocationSelectionWindow.open(me, locationInfo.locationList, locationInfo.limitToLocations);
+ if (ret == null) {
// nothing changed
return;
}
- LOGGER.debug("New location info: " + locationInfo);
+ // TODO check size of returns
+ locationInfo = ret;
reactToChange();
}
});
+ if (MetaDataCache.getLocations() == null)
+ btnLocations.setVisible(false);
+
btnSaveChanges.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
@@ -288,6 +294,7 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements
if (lecture != null) {
customPermissions = ThriftActions.getLecturePermissions(
JOptionPane.getFrameForComponent(me), lecture.lectureId);
+ locationInfo = new LocationInfo(lecture.locationIds, lecture.limitToLocations);
}
}
fillDetails();
@@ -632,6 +639,8 @@ public class LectureDetailsWindow extends LectureDetailsWindowLayout implements
txtTitle.setEditable(editable);
txtDescription.setEditable(editable);
btnLinkImage.setEnabled(editable);
+ if (MetaDataCache.getLocations() == null)
+ btnLocations.setEnabled(editable);
//TODO Temporarily disabled until implemented
chkIsExam.setEnabled(false);