diff options
author | Simon Rettberg | 2015-08-10 12:04:57 +0200 |
---|---|---|
committer | Simon Rettberg | 2015-08-10 12:04:57 +0200 |
commit | 0f2b3dc159681149a656459dd1f719c5f3576acc (patch) | |
tree | a4a246fb880fab09695094bef320c149f99f49e6 /dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/UserListWindow.java | |
parent | [client] Fix confirm quit lofig for UiFeedback windows (diff) | |
download | tutor-module-0f2b3dc159681149a656459dd1f719c5f3576acc.tar.gz tutor-module-0f2b3dc159681149a656459dd1f719c5f3576acc.tar.xz tutor-module-0f2b3dc159681149a656459dd1f719c5f3576acc.zip |
[client] Add email column to UserTable
Diffstat (limited to 'dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/UserListWindow.java')
-rw-r--r-- | dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/UserListWindow.java | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/UserListWindow.java b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/UserListWindow.java index 680a934a..f7399beb 100644 --- a/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/UserListWindow.java +++ b/dozentenmodul/src/main/java/org/openslx/dozmod/gui/window/UserListWindow.java @@ -30,7 +30,7 @@ public class UserListWindow extends UserListWindowLayout { public UserListWindow(final Frame modalParent, final UserAddedCallback callback) { super(modalParent); - + addWindowListener(new WindowAdapter() { @Override public void windowOpened(WindowEvent e) { @@ -47,10 +47,10 @@ public class UserListWindow extends UserListWindowLayout { }); } }); - + } }); - + // filter the objects in the table depending on the search field searchUserField.getDocument().addDocumentListener(new DocumentListener() { @Override @@ -66,7 +66,8 @@ public class UserListWindow extends UserListWindowLayout { @Override public void changedUpdate(DocumentEvent e) { try { - userTable.getRowSorter().setRowFilter(RowFilter.regexFilter("(?i)"+searchUserField.getText(), 0)); + userTable.getRowSorter().setRowFilter( + RowFilter.regexFilter("(?i)" + searchUserField.getText())); searchUserField.setForeground(UIManager.getColor("TextField.foreground")); } catch (IllegalArgumentException ex) { // TODO set background color of search field to something redish @@ -75,28 +76,29 @@ public class UserListWindow extends UserListWindowLayout { } }); - // ActionListener for the two buttons - final ActionListener al = new ActionListener() { + // ActionListener for the two buttons + final ActionListener al = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { - if ("Set".equals(e.getActionCommand())) { + if ("Set".equals(e.getActionCommand())) { final UserInfo user = userTable.getSelectedItem(); - if (user == null) return; + if (user == null) + return; callback.userAdded(user); - } - if ("Cancel".equals(e.getActionCommand())) { - setVisible(false); - dispose(); - } + } + if ("Cancel".equals(e.getActionCommand())) { + setVisible(false); + dispose(); + } } }; setButton.setActionCommand("Set"); setButton.addActionListener(al); - cancelButton.setActionCommand("Cancel"); - cancelButton.addActionListener(al); - getRootPane().setDefaultButton(setButton); + cancelButton.setActionCommand("Cancel"); + cancelButton.addActionListener(al); + getRootPane().setDefaultButton(setButton); - userTable.addMouseListener(new MouseAdapter() { + userTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { @@ -104,6 +106,7 @@ public class UserListWindow extends UserListWindowLayout { } } }); + this.setLocationRelativeTo(modalParent); } public static void open(Frame modalParent, final UserAddedCallback callback) { |