diff options
author | Jonathan Bauer | 2016-05-12 11:37:49 +0200 |
---|---|---|
committer | Jonathan Bauer | 2016-05-12 11:37:49 +0200 |
commit | 7c284dca69f4c42ca3e188479034db107d982f77 (patch) | |
tree | 95eb7e808ebff9449b6537cc3b269066277eca7b /dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java | |
parent | [client] add confirmation message before uploading an image to the masterserver (diff) | |
download | tutor-module-7c284dca69f4c42ca3e188479034db107d982f77.tar.gz tutor-module-7c284dca69f4c42ca3e188479034db107d982f77.tar.xz tutor-module-7c284dca69f4c42ca3e188479034db107d982f77.zip |
[client] add search field to the ImagePublishedWindow
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java index 5a7fd9d2..59789c75 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/control/ImageListViewer.java @@ -39,8 +39,8 @@ public class ImageListViewer extends QLabel { private static final Logger LOGGER = Logger.getLogger(ImageListViewer.class); // search/filter components - protected JTextField searchTextField; - protected JComboBox<FilterType> filterCbo; + protected JTextField txtSearch; + protected JComboBox<FilterType> cboFilter; protected JLabel imageCountLabel; // image table @@ -123,13 +123,13 @@ public class ImageListViewer extends QLabel { JPanel filterPanel = new JPanel(); filterPanel.setBorder(new TitledBorder("Suchen")); filterPanel.setLayout(new BoxLayout(filterPanel, BoxLayout.LINE_AXIS)); - searchTextField = new JTextField(); - filterCbo = new JComboBox<FilterType>(); + txtSearch = new JTextField(); + cboFilter = new JComboBox<FilterType>(); for (FilterType s : FilterType.values()) { - filterCbo.addItem(s); + cboFilter.addItem(s); } - filterPanel.add(searchTextField); - filterPanel.add(filterCbo); + filterPanel.add(txtSearch); + filterPanel.add(cboFilter); // Panel for itemCount JPanel imageCountPanel = new JPanel(); @@ -151,31 +151,31 @@ public class ImageListViewer extends QLabel { * ActionListeners */ // filter the objects in the table depending on the search field - searchTextField.getDocument().addDocumentListener(new TextChangeListener() { + txtSearch.getDocument().addDocumentListener(new TextChangeListener() { @Override public void changed() { - String str = searchTextField.getText(); + String str = txtSearch.getText(); if (str == null || str.isEmpty()) { searchFieldPattern = null; } else { try { searchFieldPattern = Pattern.compile(str, Pattern.CASE_INSENSITIVE); - searchTextField.setForeground(UIManager.getColor("TextField.foreground")); + txtSearch.setForeground(UIManager.getColor("TextField.foreground")); } catch (PatternSyntaxException ex) { - searchTextField.setForeground(Color.RED); + txtSearch.setForeground(Color.RED); } } applyFilterOnTable(); } }); - filterCbo.addActionListener(new ActionListener() { + cboFilter.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { applyFilterOnTable(); } }); - filterCbo.setSelectedItem(defaultFilter == null ? FilterType.USABLE : defaultFilter); + cboFilter.setSelectedItem(defaultFilter == null ? FilterType.USABLE : defaultFilter); } /** @@ -190,7 +190,7 @@ public class ImageListViewer extends QLabel { filters.add(filterSearchTerm); } - FilterType filterType = (FilterType) filterCbo.getSelectedItem(); + FilterType filterType = (FilterType) cboFilter.getSelectedItem(); switch (filterType) { case ALL: // all.... |