summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java
diff options
context:
space:
mode:
authorJonathan Bauer2016-05-19 16:36:15 +0200
committerJonathan Bauer2016-05-19 16:36:15 +0200
commite3f6965aedd54eca2af3dd99d254c5e9b5c35465 (patch)
tree5db99c80a858666f1906d60d7244c541ac51fa8c /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java
parent[client] add search field to the ImagePublishedWindow (diff)
downloadtutor-module-e3f6965aedd54eca2af3dd99d254c5e9b5c35465.tar.gz
tutor-module-e3f6965aedd54eca2af3dd99d254c5e9b5c35465.tar.xz
tutor-module-e3f6965aedd54eca2af3dd99d254c5e9b5c35465.zip
[client] published image button states
* always show "public images" button * hide the "upload to master" button instead of disabling it if the sat doesnt support it * introduced Session.isImagePublishSupported instead of multiple satApiVersion checks * added SelectionListener for ImagePublishedWindow to en/disable download buttons on selection change
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java
index b682b081..16ee99cb 100644
--- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java
+++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImagePublishedWindow.java
@@ -18,6 +18,8 @@ import javax.swing.JOptionPane;
import javax.swing.RowFilter;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
import org.apache.log4j.Logger;
import org.apache.thrift.TException;
@@ -151,6 +153,15 @@ public class ImagePublishedWindow extends ImagePublishedWindowLayout implements
}
});
+ imagePublishedTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+ @Override
+ public void valueChanged(ListSelectionEvent e) {
+ ImageSummaryRead item = imagePublishedTable
+ .getSelectedItem();
+ updateAvailableOptions(item);
+ }
+ });
+
imagePublishedTable.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
@@ -187,9 +198,18 @@ public class ImagePublishedWindow extends ImagePublishedWindowLayout implements
}
});
+ // init buttons state
+ btnSatDownload.setVisible(Session.isImagePublishSupported());
+ updateAvailableOptions(null);
+
// init data
refreshList(true, 0);
}
+ private void updateAvailableOptions(ImageSummaryRead item) {
+ btnDownload.setEnabled(item != null);
+ if (Session.isImagePublishSupported())
+ btnSatDownload.setEnabled(item != null);
+ }
/**
* Called when a change occurs in the filter search field
*/