{"action":"created","issue":{"url":"https://api.github.com/repos/eugener/oxbow/issues/11","labels_url":"https://api.github.com/repos/eugener/oxbow/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/eugener/oxbow/issues/11/comments","events_url":"https://api.github.com/repos/eugener/oxbow/issues/11/events","html_url":"https://github.com/eugener/oxbow/issues/11","id":5733889,"number":11,"title":"Filter pop up not updating","user":{"login":"chrisjones2004","id":2011114,"avatar_url":"https://avatars.githubusercontent.com/u/2011114?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisjones2004","html_url":"https://github.com/chrisjones2004","followers_url":"https://api.github.com/users/chrisjones2004/followers","following_url":"https://api.github.com/users/chrisjones2004/following{/other_user}","gists_url":"https://api.github.com/users/chrisjones2004/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisjones2004/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisjones2004/subscriptions","organizations_url":"https://api.github.com/users/chrisjones2004/orgs","repos_url":"https://api.github.com/users/chrisjones2004/repos","events_url":"https://api.github.com/users/chrisjones2004/events{/privacy}","received_events_url":"https://api.github.com/users/chrisjones2004/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/eugener/oxbow/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":{"login":"eugener","id":341840,"avatar_url":"https://avatars.githubusercontent.com/u/341840?v=3","gravatar_id":"","url":"https://api.github.com/users/eugener","html_url":"https://github.com/eugener","followers_url":"https://api.github.com/users/eugener/followers","following_url":"https://api.github.com/users/eugener/following{/other_user}","gists_url":"https://api.github.com/users/eugener/gists{/gist_id}","starred_url":"https://api.github.com/users/eugener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugener/subscriptions","organizations_url":"https://api.github.com/users/eugener/orgs","repos_url":"https://api.github.com/users/eugener/repos","events_url":"https://api.github.com/users/eugener/events{/privacy}","received_events_url":"https://api.github.com/users/eugener/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/eugener/oxbow/milestones/1","html_url":"https://github.com/eugener/oxbow/milestones/SwingBits%20v1.0.0","labels_url":"https://api.github.com/repos/eugener/oxbow/milestones/1/labels","id":140080,"number":1,"title":"SwingBits v1.0.0","description":"","creator":{"login":"eugener","id":341840,"avatar_url":"https://avatars.githubusercontent.com/u/341840?v=3","gravatar_id":"","url":"https://api.github.com/users/eugener","html_url":"https://github.com/eugener","followers_url":"https://api.github.com/users/eugener/followers","following_url":"https://api.github.com/users/eugener/following{/other_user}","gists_url":"https://api.github.com/users/eugener/gists{/gist_id}","starred_url":"https://api.github.com/users/eugener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugener/subscriptions","organizations_url":"https://api.github.com/users/eugener/orgs","repos_url":"https://api.github.com/users/eugener/repos","events_url":"https://api.github.com/users/eugener/events{/privacy}","received_events_url":"https://api.github.com/users/eugener/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":13,"state":"open","created_at":"2012-07-02T23:23:02Z","updated_at":"2013-03-06T20:16:12Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2012-07-20T10:15:57Z","updated_at":"2016-01-11T12:56:05Z","closed_at":"2012-07-21T15:27:16Z","body":"1. Filter the column \"Ints\" for value 1 only.\n2. Click \"New data\" which changes some of the values in the column\n3. Clear the filter\n\nThe filter popup does not show the correct values which are now in the column\n\n\n\n\n\nimport java.awt.BorderLayout;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\n\n\nimport javax.swing.*;\nimport javax.swing.table.DefaultTableModel;\n\nimport org.oxbow.swingbits.table.filter.IFilterChangeListener;\nimport org.oxbow.swingbits.table.filter.ITableFilter;\nimport org.oxbow.swingbits.table.filter.JTableFilter;\nimport org.oxbow.swingbits.table.filter.TableRowFilterSupport;\n\nimport java.awt.event.*;\n\n\n\npublic class TableFilter {\n\tfinal JTable table;\n\tJTableFilter tableFilter;\n\n\tpublic TableFilter() {\n\n\t\tfinal String[] cols = { \"Checkbox\", \"Ints\", \"Strings\", \"Bools\", \"test\" };\n\t\tObject[][] data = { { false, 1, \"A\", false, \"hide\" },\n\t\t\t\t{ false, 1, \"B\", false, \"hide\" },\n\t\t\t\t{ false, 1, \"C\", false, \"hide\" } ,{false, 3, \"C\", false, \"hide\" }};\n\n\t\tfinal DefaultTableModel model = newModel(cols, data);\n\t\ttable = new JTable(model) {\n\t\t\t@Override\n\t\t\tpublic boolean isCellEditable(int row, int col) {\n\t\t\t\t\treturn true;\n\t\t\t}\n\n\t\t};\n\t\ttable.getTableHeader().setReorderingAllowed(false);\n\n\t\ttableFilter = new JTableFilter(table);\n\t\ttableFilter.addChangeListener(new IFilterChangeListener(){\n\n\t\t\t@Override\n\t\t\tpublic void filterChanged(ITableFilter<?> arg0) {\n\t\t\t\tSystem.out.println(\"Fitler Event\");\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tTableRowFilterSupport.forFilter(tableFilter).searchable(true).apply();\n\n\t\tJButton newDataButton = new JButton(\"New Data\");\n\t\tnewDataButton.addActionListener(new ActionListener() {\n\n\t\t\t@Override\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tfor(int i = 0;i<table.getRowCount();i++){\n\t\t\t\t\ttable.setValueAt(i+5, i, 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t});\n\t\t\n\n\t\tJPanel buttonPanel = new JPanel();\n\t\tbuttonPanel.add(newDataButton);\n\n\t\tJPanel panel = new JPanel(new BorderLayout());\n\t\tpanel.add(new JScrollPane(table), BorderLayout.CENTER);\n\t\tpanel.add(buttonPanel, BorderLayout.SOUTH);\n\n\t\tJFrame frame = new JFrame();\n\t\tframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\tframe.add(panel);\n\t\tframe.pack();\n\t\tframe.setVisible(true);\n\t}\n\t\n\tpublic void updateNewFilter(){\n\t\ttableFilter = new JTableFilter(table);\n\t}\n\n\tprivate DefaultTableModel newModel(final String[] cols, Object[][] data) {\n\t\treturn new DefaultTableModel(data, cols) {\n\t\t\t@Override\n\t\t\tpublic Class<?> getColumnClass(int column) {\n\t\t\t\tClass returnValue;\n\t\t\t\tif ((column >= 0) && (column < getColumnCount())\n\t\t\t\t\t\t&& getRowCount() > 0 && getValueAt(0, column) != null) {\n\t\t\t\t\treturnValue = getValueAt(0, column).getClass();\n\t\t\t\t} else {\n\t\t\t\t\treturnValue = Object.class;\n\t\t\t\t}\n\t\t\t\treturn returnValue;\n\t\t\t}\n\t\t};\n\t}\n\n\n\n\n\tpublic static void main(String[] args) {\n\t\tnew TableFilter();\n\t}\n\n\t\n\n}"},"comment":{"url":"https://api.github.com/repos/eugener/oxbow/issues/comments/170539699","html_url":"https://github.com/eugener/oxbow/issues/11#issuecomment-170539699","issue_url":"https://api.github.com/repos/eugener/oxbow/issues/11","id":170539699,"user":{"login":"priyath","id":10166923,"avatar_url":"https://avatars.githubusercontent.com/u/10166923?v=3","gravatar_id":"","url":"https://api.github.com/users/priyath","html_url":"https://github.com/priyath","followers_url":"https://api.github.com/users/priyath/followers","following_url":"https://api.github.com/users/priyath/following{/other_user}","gists_url":"https://api.github.com/users/priyath/gists{/gist_id}","starred_url":"https://api.github.com/users/priyath/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/priyath/subscriptions","organizations_url":"https://api.github.com/users/priyath/orgs","repos_url":"https://api.github.com/users/priyath/repos","events_url":"https://api.github.com/users/priyath/events{/privacy}","received_events_url":"https://api.github.com/users/priyath/received_events","type":"User","site_admin":false},"created_at":"2016-01-11T12:56:05Z","updated_at":"2016-01-11T12:56:05Z","body":"[Fix issue #11. Properly listen for data changes in the table model](https://github.com/eugener/oxbow/commit/a40b27c532275985fb21e47bac8b9b7303396d14?diff=unified)\r\n\r\nWhy doesn't the source code reflect the above changes?\r\nsource: https://github.com/eugener/oxbow/blob/master/swingbits/src/main/java/org/oxbow/swingbits/table/filter/AbstractTableFilter.java"}}