diff options
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.java | 48 |
1 files changed, 1 insertions, 47 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 65084021..0c1c5815 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 @@ -8,24 +8,18 @@ import java.awt.event.MouseEvent; import java.util.List; import javax.swing.JFrame; -import javax.swing.JTextField; import javax.swing.RowFilter; import javax.swing.SwingUtilities; import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentListener; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; import org.apache.log4j.Logger; -import org.openslx.bwlp.thrift.iface.ImagePermissions; import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.dozmod.gui.Gui; import org.openslx.dozmod.gui.MainWindow; import org.openslx.dozmod.gui.window.layout.ImageListWindowLayout; import org.openslx.dozmod.gui.wizard.ImageWizard; import org.openslx.dozmod.thrift.ImageCache; -import org.openslx.dozmod.thrift.UserCache; -import org.openslx.dozmod.util.FormatHelper; import org.openslx.util.QuickTimer; import org.openslx.util.QuickTimer.Task; @@ -63,47 +57,7 @@ public class ImageListWindow extends ImageListWindowLayout { } }); - // Selection listener for the table to update the details panel when an image is clicked - imageTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { - @Override - public void valueChanged(ListSelectionEvent e) { - ImageSummaryRead image = imageTable.getSelectedItem(); - if (image == null) - return; - // Fill detail information fields - // Image name - setFieldText(imageSelectedNameLabel, image.getImageName()); - // id of the lecture - setFieldText(idInfo, image.getImageBaseId()); - // version of the image TODO last? current? - setFieldText(versionInfo, image.getCurrentVersionId()); - // last update of image - setFieldText(lastUpdateInfo, FormatHelper.longDate(image.getUpdateTime())); - // permissions of this image - ImagePermissions perms = image.getUserPermissions(); - if (perms == null) - perms = image.getDefaultPermissions(); - if (perms != null) - setFieldText(permissionInfo, perms.toString()); - // the owner of the selected lecture - setFieldText(ownerInfo, FormatHelper.userName(UserCache.find(image.getOwnerId()))); - // is it a template? - if (image.isTemplate) - templateInfo.setText("Ja"); - else - templateInfo.setText("Nein"); - - me.invalidate(); - me.validate(); - } - private void setFieldText(JTextField control, String content) { - if (content == null) { - control.setText("<null>"); - } else { - control.setText(content); - } - } - }); + imageTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { |