summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java
diff options
context:
space:
mode:
authorJonathan Bauer2015-08-17 16:32:52 +0200
committerJonathan Bauer2015-08-17 16:32:52 +0200
commit0e76d87b960b1e88f858ab214bfd084a5763763e (patch)
treee63833eabce090f0789a3b3fbcb3114cb84a6bcc /dozentenmodul/src/main/java
parentMerge branch 'v1.1' of git.openslx.org:openslx-ng/tutor-module into v1.1 (diff)
downloadtutor-module-0e76d87b960b1e88f858ab214bfd084a5763763e.tar.gz
tutor-module-0e76d87b960b1e88f858ab214bfd084a5763763e.tar.xz
tutor-module-0e76d87b960b1e88f858ab214bfd084a5763763e.zip
[client] callback to imageListWindow if image details was updated to force refresh of the list
Diffstat (limited to 'dozentenmodul/src/main/java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java14
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java7
2 files changed, 16 insertions, 5 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java
index a3de81a9..4e2abfe5 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageDetailsWindow.java
@@ -51,14 +51,19 @@ public class ImageDetailsWindow extends ImageDetailsWindowLayout implements UiFe
private final ImageDetailsWindow me = this;
+ public interface ImageUpdatedCallback {
+ public void updated();
+ }
+ private ImageUpdatedCallback callback = null;
private ImageDetailsRead image = null;
private JMenuItem popupItemNew = new JMenuItem("Neue Veranstaltung");
private JMenuItem popupItemDownload = new JMenuItem("Download");
private JMenuItem popupItemDelete = new JMenuItem("Löschen");
- public ImageDetailsWindow(Frame modalParent) {
+ public ImageDetailsWindow(Frame modalParent, ImageUpdatedCallback callback) {
super(modalParent);
+ this.callback = callback;
setFocusable(true);
btnSaveChanges.setEnabled(false);
txtVersion.setEditable(false);
@@ -220,8 +225,9 @@ public class ImageDetailsWindow extends ImageDetailsWindowLayout implements UiFe
ThriftError.showMessage(me, LOGGER, e, "Fail to update image details to satellite");
return;
}
- Gui.showMessageBox(me, "Erfolgreich gespeichert.", MessageType.INFO, null, null);
+ // no success message I'd say...
btnSaveChanges.setEnabled(false);
+ callback.updated();
}
});
}
@@ -371,8 +377,8 @@ public class ImageDetailsWindow extends ImageDetailsWindowLayout implements UiFe
* @param modalParent parent of this window
* @param imageBaseId id of the image to set the details of
*/
- public static void open(Frame modalParent, String imageBaseId) {
- ImageDetailsWindow win = new ImageDetailsWindow(modalParent);
+ public static void open(Frame modalParent, String imageBaseId, ImageUpdatedCallback callback) {
+ ImageDetailsWindow win = new ImageDetailsWindow(modalParent, callback);
win.setImage(imageBaseId);
}
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
index 335219fa..8e953375 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
@@ -29,6 +29,7 @@ import org.openslx.dozmod.gui.Gui;
import org.openslx.dozmod.gui.MainWindow;
import org.openslx.dozmod.gui.helper.MessageType;
import org.openslx.dozmod.gui.helper.PopupMenu;
+import org.openslx.dozmod.gui.window.ImageDetailsWindow.ImageUpdatedCallback;
import org.openslx.dozmod.gui.window.layout.ImageListWindowLayout;
import org.openslx.dozmod.gui.wizard.ImageWizard;
import org.openslx.dozmod.gui.wizard.LectureWizard;
@@ -120,7 +121,11 @@ public class ImageListWindow extends ImageListWindowLayout {
if (image == null)
return;
ImageDetailsWindow.open((JFrame) SwingUtilities.getWindowAncestor(me),
- image.getImageBaseId());
+ image.getImageBaseId(), new ImageUpdatedCallback() {
+ public void updated() {
+ refreshList(true);
+ }
+ });
}
processClick(e);
}