diff options
| author | Jonathan Bauer | 2015-03-03 19:02:48 +0100 |
|---|---|---|
| committer | Jonathan Bauer | 2015-03-03 19:02:48 +0100 |
| commit | 0447841f3a08890bf746625d0f17976adada6ac8 (patch) | |
| tree | f63bd9f2ac8d77f4732b70cac8e5c0497f4d3a45 /dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java | |
| parent | warnings fix (diff) | |
| download | tutor-module-0447841f3a08890bf746625d0f17976adada6ac8.tar.gz tutor-module-0447841f3a08890bf746625d0f17976adada6ac8.tar.xz tutor-module-0447841f3a08890bf746625d0f17976adada6ac8.zip | |
bwIDM - Shibboleth login working for Freiburg's SP - more to come
rework GUI classes to work with GuiManager: use GuiManager.show(<GUI to show>) and GuiManager.openPopup(<popup like About_GUI or ListAllOtherUsers_GUI>) only!
static openlinks class (models/links.java deleted). There are keywords to open links, e.g. OpenLinks.openWebpage("faq"). Please see the class.
Diffstat (limited to 'dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java')
| -rw-r--r-- | dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java | 117 |
1 files changed, 14 insertions, 103 deletions
diff --git a/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java b/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java index 837b6683..d1c6bed0 100644 --- a/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/CreateLectureLink_GUI.java @@ -1,7 +1,6 @@ package gui.lecture; import gui.image.FTPCreateUploader_GUI; -import gui.intro.About_GUI; import gui.intro.MainMenue_GUI; import java.awt.Color; @@ -15,10 +14,6 @@ import java.awt.event.KeyAdapter; import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.net.URI; -import java.net.URISyntaxException; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -29,11 +24,8 @@ import java.util.Map; import javax.swing.JButton; import javax.swing.JComboBox; -import javax.swing.JFrame; +import javax.swing.JInternalFrame; import javax.swing.JLabel; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JMenuItem; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JRadioButton; @@ -48,6 +40,8 @@ import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.EmptyBorder; import javax.swing.border.TitledBorder; +import javax.swing.event.InternalFrameAdapter; +import javax.swing.event.InternalFrameEvent; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.DefaultTableModel; @@ -55,7 +49,6 @@ import javax.swing.table.TableModel; import javax.swing.table.TableRowSorter; import models.Lecture; -import models.Links; import models.RightsManagement; import models.SessionData; import models.person; @@ -65,10 +58,10 @@ import org.apache.thrift.TException; import org.openslx.sat.thrift.iface.Image; import thrift.ThriftManager; -import util.OpenLinks; +import util.GuiManager; @SuppressWarnings("serial") -public class CreateLectureLink_GUI extends JFrame { +public class CreateLectureLink_GUI extends JInternalFrame { private final static Logger LOGGER = Logger.getLogger(FTPCreateUploader_GUI.class); @@ -100,7 +93,7 @@ public class CreateLectureLink_GUI extends JFrame { String[] titles = { "Image-Name", "Lizenzpflichtig", "OS", "Veranstaltung", "Verantwortlicher", "Letztes Update", "ID", "Version", "Template", "Beschreibung" }; - private static final String HELP_MESSAGE = "<html><div align=\"center\">" + public static final String HELP_MESSAGE = "<html><div align=\"center\">" + "Damit Ihre Veranstaltung geladen werden kann, muss sie mit einem Image verbunden werden.<br />" + "Das Image liegt entweder schon vor, oder Sie haben es im Vorfeld hochgeladen.<br />" + "Wählen Sie das Image aus, das zu Ihrer Veranstaltung passt und klicken Sie anschließend auf \"Veranstaltung erzeugen\"." @@ -129,26 +122,16 @@ public class CreateLectureLink_GUI extends JFrame { /** * Create the dialog. */ - public CreateLectureLink_GUI(Component formerGUI) { + public CreateLectureLink_GUI() { filters.add(RowFilter.regexFilter(".", 0)); rf = RowFilter.orFilter(filters); - addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent arg0) { - try { - ThriftManager.getSatClient().setSessionInvalid(SessionData.session.getAuthToken()); - } catch (TException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - System.exit(0); - } - + + addInternalFrameListener(new InternalFrameAdapter() { @Override - public void windowOpened(WindowEvent arg0) { + public void internalFrameActivated(InternalFrameEvent arg0) { try { initTableModel(modelMyImages); @@ -199,6 +182,7 @@ public class CreateLectureLink_GUI extends JFrame { textFieldName.requestFocusInWindow(); } }); + setResizable(false); try { @@ -210,7 +194,6 @@ public class CreateLectureLink_GUI extends JFrame { } setTitle("bwLehrpool Suite - Veranstaltung erzeugen - "+person.verantwortlicher.getUserID()); setBounds(0, 0, 918, 722); - setLocationRelativeTo(formerGUI); getContentPane().setLayout(null); { @@ -336,10 +319,7 @@ public class CreateLectureLink_GUI extends JFrame { lblHauptmen.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { - - CreateLectureLink_GUI.this.setVisible(false); - MainMenue_GUI main = new MainMenue_GUI(c); - main.setVisible(true); + GuiManager.show(new MainMenue_GUI()); } }); lblHauptmen.setForeground(Color.BLUE); @@ -421,11 +401,7 @@ public class CreateLectureLink_GUI extends JFrame { JButton cancelButton = new JButton("Zurück"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - - PermissionCreateLecture_GUI eVAG = new PermissionCreateLecture_GUI( - c); - eVAG.setVisible(true); - dispose(); + GuiManager.show(new PermissionCreateLecture_GUI()); } }); cancelButton.setActionCommand("CANCEL"); @@ -497,8 +473,7 @@ public class CreateLectureLink_GUI extends JFrame { "Veranstaltung angelegt", JOptionPane.INFORMATION_MESSAGE); // zurueck zum Menue - MainMenue_GUI m = new MainMenue_GUI(c); - m.setVisible(true); + GuiManager.show(new MainMenue_GUI()); } catch (TException e1) { LOGGER.error("Veranstaltung '"+Lecture.lecture.getName()+"' konnte nicht angelegt werden."); @@ -663,69 +638,6 @@ public class CreateLectureLink_GUI extends JFrame { textAreadesc.setBackground(SystemColor.menu); textAreadesc.setFont(new Font("Tahoma", Font.PLAIN, 11)); scrollPane.setViewportView(textAreadesc); - - JMenuBar menuBar = new JMenuBar(); - setJMenuBar(menuBar); - - JMenu mnNewMenu_1 = new JMenu("Hilfe"); - menuBar.add(mnNewMenu_1); - - JMenuItem mntmFaq = new JMenuItem("FAQ"); - mntmFaq.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - URI windows; - try { - windows = new URI(Links.getFAQ()); - - OpenLinks.openWebpage(windows); - - } catch (URISyntaxException e) { - - e.printStackTrace(); - } - } - }); - mnNewMenu_1.add(mntmFaq); - - JMenuItem mntmOtrs = new JMenuItem("OTRS"); - mntmOtrs.addMouseListener(new MouseAdapter() { - @Override - public void mousePressed(MouseEvent arg0) { - URI windows; - try { - windows = new URI(Links.getOTRS()); - - OpenLinks.openWebpage(windows); - - } catch (URISyntaxException e) { - - e.printStackTrace(); - } - - } - }); - mnNewMenu_1.add(mntmOtrs); - - JMenuItem mntmAbout = new JMenuItem("About"); - mntmAbout.addActionListener(new ActionListener() { - public void actionPerformed(ActionEvent e) { - About_GUI ab = new About_GUI(); - ab.setVisible(true); - } - }); - mnNewMenu_1.add(mntmAbout); - - JMenu mnNewMenu_Info = new JMenu("Info"); - mnNewMenu_Info.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent arg0) { - JOptionPane.showMessageDialog(c, HELP_MESSAGE, - "Hilfe zu dieser Oberfläche", - JOptionPane.INFORMATION_MESSAGE); - } - }); - menuBar.add(mnNewMenu_Info); try { @@ -737,7 +649,6 @@ public class CreateLectureLink_GUI extends JFrame { e1.printStackTrace(); } - c = this; } |
