summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Schwaer2015-08-17 13:19:54 +0200
committerStephan Schwaer2015-08-17 13:19:54 +0200
commit834cd142dfbc94ecf491fb42a5f1d65cd608c9bb (patch)
treeaca9a6874931178b7f0916b1621c368a5f44b907
parent[client] Remove obsolete TODOs, debug output (diff)
downloadtutor-module-834cd142dfbc94ecf491fb42a5f1d65cd608c9bb.tar.gz
tutor-module-834cd142dfbc94ecf491fb42a5f1d65cd608c9bb.tar.xz
tutor-module-834cd142dfbc94ecf491fb42a5f1d65cd608c9bb.zip
[client] Add filter for only templates in image list.
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/ImageListWindow.java8
-rw-r--r--dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/layout/ImageListWindowLayout.java4
2 files changed, 10 insertions, 2 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 d3d975b9..6543d35d 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/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);