From 24cfe00266a5aea828e3577e05144f2592a44167 Mon Sep 17 00:00:00 2001 From: Jonathan Bauer Date: Mon, 17 Aug 2015 13:20:56 +0200 Subject: [client] function for edit button in lecture list --- .../dozmod/gui/window/LectureListWindow.java | 77 +++++++++------------- 1 file changed, 32 insertions(+), 45 deletions(-) (limited to 'dozentenmodul/src/main/java') diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java index cabcc4f1..7656f8bf 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java @@ -70,27 +70,7 @@ public class LectureListWindow extends LectureListWindowLayout { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { - LectureSummary lecture = lectureTable.getSelectedItem(); - if (lecture == null) - return; - LectureDetailsWindow.open((JFrame)SwingUtilities.getWindowAncestor(me), lecture.getLectureId()); - } - } - }); - - - lectureTable.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - if (e.getClickCount() == 2) { - final LectureSummary lecture = lectureTable.getSelectedItem(); - if (lecture == null) - return; - /* TODO for lecture - ImageDetailsWindow popup = new ImageDetailsWindow(SwingUtilities.windowForComponent(me)); - if (popup != null) - popup.setImage(image.getImageBaseId()); - */ + openSelectedLectureDetails(); } } }); @@ -108,7 +88,7 @@ public class LectureListWindow extends LectureListWindowLayout { editButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - // TODO Auto-generated method stub + openSelectedLectureDetails(); } }); @@ -129,29 +109,11 @@ public class LectureListWindow extends LectureListWindowLayout { }); } - private void refreshList() { - QuickTimer.scheduleOnce(new Task() { - @Override - public void fire() { - final List lectureList = LectureCache.get(false); - Gui.asyncExec(new Runnable() { - @Override - public void run() { - lectureTable.setData(lectureList, true); - } - }); - } - }); - } - - @Override - public boolean requestHide() { - return true; - } - - @Override - public void requestShow() { - refreshList(); + private void openSelectedLectureDetails() { + LectureSummary lecture = lectureTable.getSelectedItem(); + if (lecture == null) + return; + LectureDetailsWindow.open((JFrame)SwingUtilities.getWindowAncestor(me), lecture.getLectureId()); } private void applyFilterOnTable() { @@ -208,4 +170,29 @@ public class LectureListWindow extends LectureListWindowLayout { } } + private void refreshList() { + QuickTimer.scheduleOnce(new Task() { + @Override + public void fire() { + final List lectureList = LectureCache.get(false); + Gui.asyncExec(new Runnable() { + @Override + public void run() { + lectureTable.setData(lectureList, true); + } + }); + } + }); + } + + @Override + public boolean requestHide() { + return true; + } + + @Override + public void requestShow() { + refreshList(); + } + } -- cgit v1.2.3-55-g7522