diff options
author | Simon Rettberg | 2015-08-17 15:07:10 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-08-17 15:07:10 +0200 |
commit | b196305c96426983efb4cc183796f315d913c91a (patch) | |
tree | 3ecb3c2532c777710164cdaa674f65a2a45cbbda | |
parent | [client] ImagePerms.canEdit for ImageSummaryRead (diff) | |
parent | Merge branch 'v1.1' of git.openslx.org:openslx-ng/tutor-module into v1.1 (diff) | |
download | tutor-module-b196305c96426983efb4cc183796f315d913c91a.tar.gz tutor-module-b196305c96426983efb4cc183796f315d913c91a.tar.xz tutor-module-b196305c96426983efb4cc183796f315d913c91a.zip |
Merge branch 'v1.1' of git.openslx.org:openslx-ng/tutor-module into v1.1
5 files changed, 47 insertions, 49 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java index 26ef7bf4..335219fa 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java @@ -298,6 +298,14 @@ public class ImageListWindow extends ImageListWindowLayout { }; filters.add(filter); break; + case 3: + // show only templates + RowFilter<Object, Object> templateFilter = new RowFilter<Object, Object>() { + public boolean include(Entry entry) { + return imageTable.getModelRow((Integer) entry.getIdentifier()).isTemplate; + } + }; + filters.add(templateFilter); default: break; } 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<LectureSummary> 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<LectureSummary> 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(); + } + } 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 ae64ee6f..1343127d 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 @@ -33,7 +33,7 @@ public abstract class ImageListWindowLayout extends CompositePage { protected final static String backButtonLabel = "Zurück"; protected final static String tableGroupLabel = "Images"; protected final static String filterGroupLabel = "Filter"; - protected final static String[] showOwnedLabel = {"Alle anzeigen", "Nur eigene Anzeigen", "Nur editierbare anzeigen"}; + protected final static String[] filterLabels = {"Alle anzeigen", "Nur eigene Anzeigen", "Nur editierbare anzeigen", "Nur Vorlagen zeigen"}; // -------------------------------------- // search field, table and buttons @@ -68,7 +68,7 @@ public abstract class ImageListWindowLayout extends CompositePage { filterPanel.setLayout(new BoxLayout(filterPanel, BoxLayout.LINE_AXIS)); searchTextField = new JTextField(); filterCbo = new JComboBox<String>(); - for (String s: showOwnedLabel){ + for (String s: filterLabels){ filterCbo.addItem(s); } filterPanel.add(searchTextField); diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java index 2bfe0edf..e479085b 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/layout/ImageMetaDataPageLayout.java @@ -25,6 +25,7 @@ public abstract class ImageMetaDataPageLayout extends WizardPage { protected JTextArea descriptionText; protected JCheckBox licencedSoftwareCheck; protected JCheckBox setActiveCheck; + protected JCheckBox isTemplate; // permissions checks protected JCheckBox readPermissionsCheck; @@ -93,6 +94,9 @@ public abstract class ImageMetaDataPageLayout extends WizardPage { grid.add(permissionsGroup, 2, 1).fill(true, false).expand(true, false); grid.nextRow(); // -- end permissions group -- + isTemplate = new JCheckBox("Vorlage erstellen"); + grid.add(isTemplate); + grid.nextRow(); grid.finish(true); } diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCreationPage.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCreationPage.java index cd26da82..373e0931 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCreationPage.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/wizard/page/LectureCreationPage.java @@ -105,8 +105,7 @@ public class LectureCreationPage extends LectureCreationPageLayout { final Date now = new Date(); final Date start = getDateFrom(startDate, startTime); final Date end = getDateFrom(endDate, endTime); - LOGGER.debug(start); - LOGGER.debug(end); + if (start.after(end)) { setWarningMessage("Startzeit is nach Endzeit!"); return false; |