diff options
author | Jonathan Bauer | 2016-04-27 17:24:15 +0200 |
---|---|---|
committer | Jonathan Bauer | 2016-04-27 17:24:15 +0200 |
commit | a40ddb0a580348d68ff0c515275ffa252b686c1e (patch) | |
tree | e2436a05c935fd7b6c408e4cafb5be5dce6e16ce /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java | |
parent | [server] Fix upload handling if image already exists (diff) | |
download | tutor-module-a40ddb0a580348d68ff0c515275ffa252b686c1e.tar.gz tutor-module-a40ddb0a580348d68ff0c515275ffa252b686c1e.tar.xz tutor-module-a40ddb0a580348d68ff0c515275ffa252b686c1e.zip |
[client] first working draft for published images stuff
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java | 35 |
1 files changed, 6 insertions, 29 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java index fb83e911..c38686a3 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java @@ -2,8 +2,6 @@ package org.openslx.dozmod.gui.window.layout; import java.awt.BorderLayout; import java.awt.Font; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; import javax.swing.BorderFactory; import javax.swing.Box; @@ -12,17 +10,12 @@ import javax.swing.JButton; import javax.swing.JPanel; import org.apache.log4j.Logger; -import org.apache.thrift.TException; import org.openslx.dozmod.gui.Gui; -import org.openslx.dozmod.gui.MainWindow; import org.openslx.dozmod.gui.control.ImageListViewer; import org.openslx.dozmod.gui.control.ImageListViewer.FilterType; import org.openslx.dozmod.gui.control.QLabel; import org.openslx.dozmod.gui.helper.CompositePage; import org.openslx.dozmod.gui.helper.GridManager; -import org.openslx.dozmod.thrift.Session; -import org.openslx.dozmod.thrift.ThriftError; -import org.openslx.thrifthelper.ThriftManager; @SuppressWarnings("serial") public abstract class ImageListWindowLayout extends CompositePage { @@ -30,7 +23,7 @@ public abstract class ImageListWindowLayout extends CompositePage { private final static Logger LOGGER = Logger.getLogger(ImageListWindowLayout.class); private static final int ICON_SIZE_Y = 24; - + private final ImageListWindowLayout me = this; protected final static String infoTextString = "Hier können Sie Virtuelle Maschinen hochladen, herunterladen, bearbeiten und löschen."; protected final static String infoTitleString = "Übersicht Virtuelle Maschinen"; protected final static String newButtonLabel = "Neue VM"; @@ -39,6 +32,7 @@ public abstract class ImageListWindowLayout extends CompositePage { protected final static String downloadButtonLabel = "Download"; protected final static String deleteButtonLabel = "Löschen"; protected final static String switchViewButtonLabel = "Veranstaltungen zeigen"; + protected final static String showPublishedImagesLabel = "Öffentliche VMs anzeigen"; // -------------------------------------- // search field, table and buttons @@ -49,6 +43,7 @@ public abstract class ImageListWindowLayout extends CompositePage { protected final JButton btnDownload; protected final JButton btnDelete; protected final JButton btnSwitchView; + protected final JButton btnShowPublishedImages; public ImageListWindowLayout() { super(new BorderLayout()); @@ -80,6 +75,7 @@ public abstract class ImageListWindowLayout extends CompositePage { "New VM", ICON_SIZE_Y, buttonPanel)); btnNewLecture = new JButton(newLectureButtonLabel, Gui.getScaledIconResource( "/img/new-lecture-icon.png", "New Lecture", ICON_SIZE_Y, buttonPanel)); + btnShowPublishedImages = new JButton(showPublishedImagesLabel, null); // TODO icon btnSwitchView = new JButton(switchViewButtonLabel, Gui.getScaledIconResource("/img/switch-icon.png", "Switch", ICON_SIZE_Y, buttonPanel)); buttonPanel.add(btnNewVm); @@ -89,30 +85,11 @@ public abstract class ImageListWindowLayout extends CompositePage { buttonPanel.add(btnDownload); buttonPanel.add(Box.createHorizontalStrut(5)); buttonPanel.add(btnNewLecture); + buttonPanel.add(Box.createHorizontalStrut(5)); + buttonPanel.add(btnShowPublishedImages); buttonPanel.add(Box.createHorizontalGlue()); buttonPanel.add(btnSwitchView); - /* - * WARNING: Test crap - */ - JButton butt = new JButton("LOL"); - butt.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - try { - String token = ThriftManager.getSatClient().requestImageReplication(Session.getSatelliteToken(), - "e9de1941-b673-4711-b033-d8c37d1e2d3e"); - MainWindow.addPassiveTransfer(token, "POO POO VM", false); - } catch (TException e1) { - ThriftError.showMessage(ImageListWindowLayout.this, null, e1, "BOO BOO"); - } - } - }); - buttonPanel.add(butt); - /* - * END TEST - */ - // put everything together GridManager grid = new GridManager(this, 1); grid.add(infoPanel).fill(true, false).expand(true, false); |