summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
diff options
context:
space:
mode:
authorStephan Schwaer2015-09-30 17:13:11 +0200
committerStephan Schwaer2015-09-30 17:13:11 +0200
commit9076efbce0615190e8e2b6fb1539da627da17fcd (patch)
treed9af1434c87235a3e353bfc546fcc5841201d4aa /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java
parent[client] Added linkedLectureCound in imageDetailsWindow. (diff)
downloadtutor-module-9076efbce0615190e8e2b6fb1539da627da17fcd.tar.gz
tutor-module-9076efbce0615190e8e2b6fb1539da627da17fcd.tar.xz
tutor-module-9076efbce0615190e8e2b6fb1539da627da17fcd.zip
[client] Changed keylisteners in loginWindow to keyBindings. Added some Keybindings to lecture- and image tables.
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java32
1 files changed, 26 insertions, 6 deletions
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 9488a5ef..86f6468b 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
@@ -7,9 +7,12 @@ import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
+import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
@@ -30,7 +33,6 @@ import org.openslx.dozmod.thrift.ThriftActions;
import org.openslx.dozmod.thrift.ThriftActions.DeleteCallback;
import org.openslx.dozmod.thrift.ThriftActions.DownloadCallback;
-
/**
* Window with the list of available images.
* Has filters for the images and buttons to create, edit and delete buttons.
@@ -54,7 +56,7 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa
* Popup menu items
*/
private final JMenuItem popupItemNewLecture = new JMenuItem("Neue Veranstaltung");
- private final JMenuItem popupItemEdit = new JMenuItem("Bearbeiten");
+ private final JMenuItem popupItemEdit = new JMenuItem("Detailansicht");
private final JMenuItem popupItemDelete = new JMenuItem("Löschen");
private final JMenuItem popupItemDownload = new JMenuItem("Download");
@@ -185,6 +187,24 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa
}
});
+ // Some keyboard shortcuts
+ imageTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
+ KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "details");
+ imageTable.getActionMap().put("details", new AbstractAction() {
+ @Override
+ public void actionPerformed(ActionEvent ae) {
+ editButton.doClick();
+ }
+ });
+ imageTable.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(
+ KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), "delete");
+ imageTable.getActionMap().put("delete", new AbstractAction() {
+ @Override
+ public void actionPerformed(ActionEvent ae) {
+ deleteButton.doClick();
+ }
+ });
+
updateAvailableOptions(null);
}
@@ -256,10 +276,10 @@ public class ImageListWindow extends ImageListWindowLayout implements DownloadCa
return;
ImageDetailsWindow.open((JFrame) SwingUtilities.getWindowAncestor(me), image.getImageBaseId(),
new ImageUpdatedCallback() {
- public void updated() {
- imageListViewer.refreshList(true, 100);
- }
- });
+ public void updated() {
+ imageListViewer.refreshList(true, 100);
+ }
+ });
}
/**