From 395ff8158c60cf37fc3e4de5a15b292104af56ea Mon Sep 17 00:00:00 2001 From: Nino Breuer Date: Mon, 3 Nov 2014 10:15:46 +0100 Subject: initialize all lectures with ALL lectures... --- .../main/java/gui/lecture/SearchLecture_GUI.java | 39 +++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java') diff --git a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java index cb319c9f..d2ab3a45 100644 --- a/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java +++ b/dozentenmodul/src/main/java/gui/lecture/SearchLecture_GUI.java @@ -132,7 +132,7 @@ public class SearchLecture_GUI extends JFrame { public void windowOpened(WindowEvent arg0) { try { initTableModel(modelMyLectures); - initTableModel(modelAll); + initTableModelAll(modelAll); } catch (ParseException e) { // TODO Auto-generated catch block @@ -625,6 +625,43 @@ public class SearchLecture_GUI extends JFrame { return model; } + // Initiale Beffuelung eines Table models + public DefaultTableModel initTableModelAll(DefaultTableModel model) throws ParseException { + List lectures; + try { + // Hole eine Liste der erlaubten Images für die diese Person + //lectures = client.getLectureList(); + lectures = client.getLectureList(); + Iterator i = lectures.iterator(); + SimpleDateFormat in=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat out=new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); + int x = 0; + + while (i.hasNext()) { + // erzeuge Objekte fuer die Tabelle + Object[] obj = { + lectures.get(x).lecturename, + lectures.get(x).desc, + out.format(in.parse(lectures.get(x).starttime)) + " " + + out.format(in.parse(lectures.get(x).endtime)), + lectures.get(x).isActive, out.format(in.parse(lectures.get(x).lastused)), + lectures.get(x).username, + lectures.get(x).imagename," " ,lectures.get(x).id }; + // Fuege diese Objekte der Tabelle hinzu + model.addRow(obj); + x++; + i.next(); + + } + + return model; + } catch (TException e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } + return model; + } + private void resetLectureInfo() { //reset the detailed information on the right hand side when changing search string -- cgit v1.2.3-55-g7522