summaryrefslogtreecommitdiffstats
path: root/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java
diff options
context:
space:
mode:
authorJonathan Bauer2015-08-10 15:10:14 +0200
committerJonathan Bauer2015-08-10 15:10:14 +0200
commit6013bb59a21cdb4efde06a37a1fe1b4dd4e8a62c (patch)
tree681729dad34264237006a258603a17408d41eb7d /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java
parentMerge branch 'v1.1' of git.openslx.org:openslx-ng/tutor-module into v1.1 (diff)
downloadtutor-module-6013bb59a21cdb4efde06a37a1fe1b4dd4e8a62c.tar.gz
tutor-module-6013bb59a21cdb4efde06a37a1fe1b4dd4e8a62c.tar.xz
tutor-module-6013bb59a21cdb4efde06a37a1fe1b4dd4e8a62c.zip
[client] removed right info pane for lecture. Added start/end date in table.
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java')
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/LectureListWindow.java49
1 files changed, 11 insertions, 38 deletions
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 eb4dc1ee..cf54c22a 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
@@ -1,5 +1,6 @@
package org.openslx.dozmod.gui.window;
+import java.awt.Color;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
@@ -7,12 +8,11 @@ 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.UIManager;
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.LectureSummary;
@@ -21,8 +21,6 @@ import org.openslx.dozmod.gui.MainWindow;
import org.openslx.dozmod.gui.window.layout.LectureListWindowLayout;
import org.openslx.dozmod.gui.wizard.LectureWizard;
import org.openslx.dozmod.thrift.LectureCache;
-import org.openslx.dozmod.thrift.UserCache;
-import org.openslx.dozmod.util.FormatHelper;
import org.openslx.util.QuickTimer;
import org.openslx.util.QuickTimer.Task;
@@ -49,7 +47,14 @@ public class LectureListWindow extends LectureListWindowLayout {
@Override
public void changedUpdate(DocumentEvent e) {
- // TODO: Set filter
+ // stuff
+ try {
+ lectureTable.getRowSorter().setRowFilter(RowFilter.regexFilter("(?i)"+searchTextField.getText(), 0, 1, 2));
+ searchTextField.setForeground(UIManager.getColor("TextField.foreground"));
+ } catch (IllegalArgumentException ex) {
+ // TODO set background color of search field to something redish
+ searchTextField.setForeground(Color.RED);
+ }
}
});
@@ -65,39 +70,7 @@ public class LectureListWindow extends LectureListWindowLayout {
}
});
- lectureTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
- @Override
- public void valueChanged(ListSelectionEvent e) {
- final LectureSummary lecture = lectureTable.getSelectedItem();
- if (lecture == null)
- return;
- // Fill detail information fields
- // Lecture name
- setFieldText(lectureName, lecture.getLectureName());
- // id of the lecture
- setFieldText(idInfo, lecture.getLectureId());
- // id of the image linked to the lecture
- setFieldText(imageBaseId, lecture.getImageBaseId());
- // the owner of the selected lecture
- setFieldText(ownerInfo, FormatHelper.userName(UserCache.find(lecture.getOwnerId())));
- // set the time, the lecture has last been used
- lastusedInfo.setText(FormatHelper.longDate(lecture.getLastUsed()));
- // set the start time of the lecture
- startTime.setText(FormatHelper.longDate(lecture.getStartTime()));
- // set the end time of the lecture
- endTime.setText(FormatHelper.longDate(lecture.getEndTime()));
- me.invalidate();
- me.validate();
- }
- private void setFieldText(JTextField control, String content) {
- if (content == null) {
- control.setText("<null>");
- } else {
- control.setText(content);
- }
- }
- });
lectureTable.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {