{"action":"created","comment":{"url":"https://api.github.com/repos/LiteracyBridge/acm/pulls/comments/64270312","id":64270312,"diff_hunk":"@@ -0,0 +1,107 @@\n+package org.literacybridge.acm.gui.ResourceView.audioItems;\n+\n+import java.util.Comparator;\n+import java.util.Locale;\n+\n+import org.literacybridge.acm.gui.resourcebundle.LabelProvider;\n+import org.literacybridge.acm.gui.util.AudioItemNode;\n+import org.literacybridge.acm.store.AudioItem;\n+import org.literacybridge.acm.store.MetadataField;\n+import org.literacybridge.acm.store.MetadataValue;\n+\n+public final class ColumnInfo<T> {\n+    public final static int WIDTH_NOT_SET = -1;\n+\n+    private int columnIndex;\n+    private Comparator<AudioItemNode<T>> comparator;\n+    private final String columnLabelProperty;\n+    private final int preferredWidth;\n+    private final int maxWidth;\n+    private final ValueProvider<T> valueProvider;\n+\n+    private ColumnInfo(\n+            String columnLabelProperty,\n+            int maxWidth,\n+            int preferredWidth,\n+            ValueProvider<T> valueProvider) {\n+        this.columnLabelProperty = columnLabelProperty;\n+        this.preferredWidth = preferredWidth;\n+        this.maxWidth = maxWidth;\n+        this.valueProvider = valueProvider;\n+    }\n+\n+    ColumnInfo<T> setColumnIndex(int columnIndex) {\n+        this.columnIndex = columnIndex;\n+        return this;\n+    }\n+\n+    ColumnInfo<T> setComparator(Comparator<AudioItemNode<T>> comparator) {\n+        this.comparator = comparator;\n+        return this;\n+    }\n+\n+    public int getColumnIndex() {\n+        return columnIndex;\n+    }\n+\n+    public String getColumnName(Locale locale) {\n+        return columnLabelProperty == null\n+                ? \"\" : LabelProvider.getLabel(columnLabelProperty , locale);\n+    }\n+\n+    public int getPreferredWidth() {\n+        return preferredWidth;\n+    }\n+\n+    public int getMaxWidth() {\n+        return maxWidth;\n+    }\n+\n+    public ValueProvider<T> getValueProvider() {\n+        return valueProvider;\n+    }\n+\n+    /**\n+     * @return null, if no custom comparator was set for this ColumnInfo. In that case the table will\n+     * use a default String comparator using the values' toString() methods.\n+     */\n+    public Comparator<AudioItemNode<T>> getComparator() {\n+        return comparator;\n+    }\n+\n+    static <T> ColumnInfo<T> newColumnInfo(\n+            String columnLabelProperty,\n+            int maxWidth,\n+            int preferredWidth,\n+            ValueProvider<T> valueProvider) {\n+        return new ColumnInfo<>(columnLabelProperty, maxWidth, preferredWidth, valueProvider);\n+    }\n+\n+    static <T> ColumnInfo<T> newMetadataColumnInfo(\n+            String columnLabelProperty,\n+            int maxWidth,\n+            int preferredWidth,\n+            final MetadataField<T> metadataField) {\n+        return new ColumnInfo<>(columnLabelProperty, maxWidth, preferredWidth, new ValueProvider<T>(true) {\n+            @Override\n+            protected AudioItemNode<T> getValue(AudioItem audioItem) {\n+                MetadataValue<T> value = audioItem.getMetadata().getMetadataValue(metadataField);\n+                return new AudioItemNode<T>(audioItem, value != null ? value.getValue() : null);\n+            }\n+        });\n+    }\n+\n+    public static abstract class ValueProvider<T> {\n+        private final boolean valueCachable;","path":"acm/src/main/java/org/literacybridge/acm/gui/ResourceView/audioItems/ColumnInfo.java","position":95,"original_position":95,"commit_id":"b03498847d66592118f4b8564a9a83531636f5db","original_commit_id":"b03498847d66592118f4b8564a9a83531636f5db","user":{"login":"billev","id":16808880,"avatar_url":"https://avatars.githubusercontent.com/u/16808880?v=3","gravatar_id":"","url":"https://api.github.com/users/billev","html_url":"https://github.com/billev","followers_url":"https://api.github.com/users/billev/followers","following_url":"https://api.github.com/users/billev/following{/other_user}","gists_url":"https://api.github.com/users/billev/gists{/gist_id}","starred_url":"https://api.github.com/users/billev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billev/subscriptions","organizations_url":"https://api.github.com/users/billev/orgs","repos_url":"https://api.github.com/users/billev/repos","events_url":"https://api.github.com/users/billev/events{/privacy}","received_events_url":"https://api.github.com/users/billev/received_events","type":"User","site_admin":false},"body":"Why does this class care about cachability?","created_at":"2016-05-23T19:03:54Z","updated_at":"2016-05-23T19:03:54Z","html_url":"https://github.com/LiteracyBridge/acm/pull/5#discussion_r64270312","pull_request_url":"https://api.github.com/repos/LiteracyBridge/acm/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/LiteracyBridge/acm/pulls/comments/64270312"},"html":{"href":"https://github.com/LiteracyBridge/acm/pull/5#discussion_r64270312"},"pull_request":{"href":"https://api.github.com/repos/LiteracyBridge/acm/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/LiteracyBridge/acm/pulls/5","id":68180693,"html_url":"https://github.com/LiteracyBridge/acm/pull/5","diff_url":"https://github.com/LiteracyBridge/acm/pull/5.diff","patch_url":"https://github.com/LiteracyBridge/acm/pull/5.patch","issue_url":"https://api.github.com/repos/LiteracyBridge/acm/issues/5","number":5,"state":"open","locked":false,"title":"Significantly improve sorting and scrolling performance of the AudioItem table","user":{"login":"michibusch","id":2133334,"avatar_url":"https://avatars.githubusercontent.com/u/2133334?v=3","gravatar_id":"","url":"https://api.github.com/users/michibusch","html_url":"https://github.com/michibusch","followers_url":"https://api.github.com/users/michibusch/followers","following_url":"https://api.github.com/users/michibusch/following{/other_user}","gists_url":"https://api.github.com/users/michibusch/gists{/gist_id}","starred_url":"https://api.github.com/users/michibusch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michibusch/subscriptions","organizations_url":"https://api.github.com/users/michibusch/orgs","repos_url":"https://api.github.com/users/michibusch/repos","events_url":"https://api.github.com/users/michibusch/events{/privacy}","received_events_url":"https://api.github.com/users/michibusch/received_events","type":"User","site_admin":false},"body":"Rewrite of AudioItemTableModel to improve sort and scrolling performance of the main AudioItem table.\r\nThis change also cleans up the code that manages the AudioItem table.\r\n\r\nPlease see commit messages for details.","created_at":"2016-04-28T08:17:33Z","updated_at":"2016-05-23T19:03:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6622e3000e329cf64fda151ba84e32488ed34eb8","assignee":{"login":"billev","id":16808880,"avatar_url":"https://avatars.githubusercontent.com/u/16808880?v=3","gravatar_id":"","url":"https://api.github.com/users/billev","html_url":"https://github.com/billev","followers_url":"https://api.github.com/users/billev/followers","following_url":"https://api.github.com/users/billev/following{/other_user}","gists_url":"https://api.github.com/users/billev/gists{/gist_id}","starred_url":"https://api.github.com/users/billev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billev/subscriptions","organizations_url":"https://api.github.com/users/billev/orgs","repos_url":"https://api.github.com/users/billev/repos","events_url":"https://api.github.com/users/billev/events{/privacy}","received_events_url":"https://api.github.com/users/billev/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/LiteracyBridge/acm/pulls/5/commits","review_comments_url":"https://api.github.com/repos/LiteracyBridge/acm/pulls/5/comments","review_comment_url":"https://api.github.com/repos/LiteracyBridge/acm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/LiteracyBridge/acm/issues/5/comments","statuses_url":"https://api.github.com/repos/LiteracyBridge/acm/statuses/b03498847d66592118f4b8564a9a83531636f5db","head":{"label":"LiteracyBridge:improve_table_model","ref":"improve_table_model","sha":"b03498847d66592118f4b8564a9a83531636f5db","user":{"login":"LiteracyBridge","id":5314813,"avatar_url":"https://avatars.githubusercontent.com/u/5314813?v=3","gravatar_id":"","url":"https://api.github.com/users/LiteracyBridge","html_url":"https://github.com/LiteracyBridge","followers_url":"https://api.github.com/users/LiteracyBridge/followers","following_url":"https://api.github.com/users/LiteracyBridge/following{/other_user}","gists_url":"https://api.github.com/users/LiteracyBridge/gists{/gist_id}","starred_url":"https://api.github.com/users/LiteracyBridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiteracyBridge/subscriptions","organizations_url":"https://api.github.com/users/LiteracyBridge/orgs","repos_url":"https://api.github.com/users/LiteracyBridge/repos","events_url":"https://api.github.com/users/LiteracyBridge/events{/privacy}","received_events_url":"https://api.github.com/users/LiteracyBridge/received_events","type":"Organization","site_admin":false},"repo":{"id":27016494,"name":"acm","full_name":"LiteracyBridge/acm","owner":{"login":"LiteracyBridge","id":5314813,"avatar_url":"https://avatars.githubusercontent.com/u/5314813?v=3","gravatar_id":"","url":"https://api.github.com/users/LiteracyBridge","html_url":"https://github.com/LiteracyBridge","followers_url":"https://api.github.com/users/LiteracyBridge/followers","following_url":"https://api.github.com/users/LiteracyBridge/following{/other_user}","gists_url":"https://api.github.com/users/LiteracyBridge/gists{/gist_id}","starred_url":"https://api.github.com/users/LiteracyBridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiteracyBridge/subscriptions","organizations_url":"https://api.github.com/users/LiteracyBridge/orgs","repos_url":"https://api.github.com/users/LiteracyBridge/repos","events_url":"https://api.github.com/users/LiteracyBridge/events{/privacy}","received_events_url":"https://api.github.com/users/LiteracyBridge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LiteracyBridge/acm","description":null,"fork":false,"url":"https://api.github.com/repos/LiteracyBridge/acm","forks_url":"https://api.github.com/repos/LiteracyBridge/acm/forks","keys_url":"https://api.github.com/repos/LiteracyBridge/acm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LiteracyBridge/acm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LiteracyBridge/acm/teams","hooks_url":"https://api.github.com/repos/LiteracyBridge/acm/hooks","issue_events_url":"https://api.github.com/repos/LiteracyBridge/acm/issues/events{/number}","events_url":"https://api.github.com/repos/LiteracyBridge/acm/events","assignees_url":"https://api.github.com/repos/LiteracyBridge/acm/assignees{/user}","branches_url":"https://api.github.com/repos/LiteracyBridge/acm/branches{/branch}","tags_url":"https://api.github.com/repos/LiteracyBridge/acm/tags","blobs_url":"https://api.github.com/repos/LiteracyBridge/acm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LiteracyBridge/acm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LiteracyBridge/acm/git/refs{/sha}","trees_url":"https://api.github.com/repos/LiteracyBridge/acm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LiteracyBridge/acm/statuses/{sha}","languages_url":"https://api.github.com/repos/LiteracyBridge/acm/languages","stargazers_url":"https://api.github.com/repos/LiteracyBridge/acm/stargazers","contributors_url":"https://api.github.com/repos/LiteracyBridge/acm/contributors","subscribers_url":"https://api.github.com/repos/LiteracyBridge/acm/subscribers","subscription_url":"https://api.github.com/repos/LiteracyBridge/acm/subscription","commits_url":"https://api.github.com/repos/LiteracyBridge/acm/commits{/sha}","git_commits_url":"https://api.github.com/repos/LiteracyBridge/acm/git/commits{/sha}","comments_url":"https://api.github.com/repos/LiteracyBridge/acm/comments{/number}","issue_comment_url":"https://api.github.com/repos/LiteracyBridge/acm/issues/comments{/number}","contents_url":"https://api.github.com/repos/LiteracyBridge/acm/contents/{+path}","compare_url":"https://api.github.com/repos/LiteracyBridge/acm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LiteracyBridge/acm/merges","archive_url":"https://api.github.com/repos/LiteracyBridge/acm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LiteracyBridge/acm/downloads","issues_url":"https://api.github.com/repos/LiteracyBridge/acm/issues{/number}","pulls_url":"https://api.github.com/repos/LiteracyBridge/acm/pulls{/number}","milestones_url":"https://api.github.com/repos/LiteracyBridge/acm/milestones{/number}","notifications_url":"https://api.github.com/repos/LiteracyBridge/acm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LiteracyBridge/acm/labels{/name}","releases_url":"https://api.github.com/repos/LiteracyBridge/acm/releases{/id}","deployments_url":"https://api.github.com/repos/LiteracyBridge/acm/deployments","created_at":"2014-11-22T23:50:28Z","updated_at":"2016-02-02T01:18:20Z","pushed_at":"2016-05-23T03:35:25Z","git_url":"git://github.com/LiteracyBridge/acm.git","ssh_url":"git@github.com:LiteracyBridge/acm.git","clone_url":"https://github.com/LiteracyBridge/acm.git","svn_url":"https://github.com/LiteracyBridge/acm","homepage":null,"size":64507,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"LiteracyBridge:master","ref":"master","sha":"5419c8591fad62629b996cf8623ff0d879cbd195","user":{"login":"LiteracyBridge","id":5314813,"avatar_url":"https://avatars.githubusercontent.com/u/5314813?v=3","gravatar_id":"","url":"https://api.github.com/users/LiteracyBridge","html_url":"https://github.com/LiteracyBridge","followers_url":"https://api.github.com/users/LiteracyBridge/followers","following_url":"https://api.github.com/users/LiteracyBridge/following{/other_user}","gists_url":"https://api.github.com/users/LiteracyBridge/gists{/gist_id}","starred_url":"https://api.github.com/users/LiteracyBridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiteracyBridge/subscriptions","organizations_url":"https://api.github.com/users/LiteracyBridge/orgs","repos_url":"https://api.github.com/users/LiteracyBridge/repos","events_url":"https://api.github.com/users/LiteracyBridge/events{/privacy}","received_events_url":"https://api.github.com/users/LiteracyBridge/received_events","type":"Organization","site_admin":false},"repo":{"id":27016494,"name":"acm","full_name":"LiteracyBridge/acm","owner":{"login":"LiteracyBridge","id":5314813,"avatar_url":"https://avatars.githubusercontent.com/u/5314813?v=3","gravatar_id":"","url":"https://api.github.com/users/LiteracyBridge","html_url":"https://github.com/LiteracyBridge","followers_url":"https://api.github.com/users/LiteracyBridge/followers","following_url":"https://api.github.com/users/LiteracyBridge/following{/other_user}","gists_url":"https://api.github.com/users/LiteracyBridge/gists{/gist_id}","starred_url":"https://api.github.com/users/LiteracyBridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiteracyBridge/subscriptions","organizations_url":"https://api.github.com/users/LiteracyBridge/orgs","repos_url":"https://api.github.com/users/LiteracyBridge/repos","events_url":"https://api.github.com/users/LiteracyBridge/events{/privacy}","received_events_url":"https://api.github.com/users/LiteracyBridge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/LiteracyBridge/acm","description":null,"fork":false,"url":"https://api.github.com/repos/LiteracyBridge/acm","forks_url":"https://api.github.com/repos/LiteracyBridge/acm/forks","keys_url":"https://api.github.com/repos/LiteracyBridge/acm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LiteracyBridge/acm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LiteracyBridge/acm/teams","hooks_url":"https://api.github.com/repos/LiteracyBridge/acm/hooks","issue_events_url":"https://api.github.com/repos/LiteracyBridge/acm/issues/events{/number}","events_url":"https://api.github.com/repos/LiteracyBridge/acm/events","assignees_url":"https://api.github.com/repos/LiteracyBridge/acm/assignees{/user}","branches_url":"https://api.github.com/repos/LiteracyBridge/acm/branches{/branch}","tags_url":"https://api.github.com/repos/LiteracyBridge/acm/tags","blobs_url":"https://api.github.com/repos/LiteracyBridge/acm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LiteracyBridge/acm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LiteracyBridge/acm/git/refs{/sha}","trees_url":"https://api.github.com/repos/LiteracyBridge/acm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LiteracyBridge/acm/statuses/{sha}","languages_url":"https://api.github.com/repos/LiteracyBridge/acm/languages","stargazers_url":"https://api.github.com/repos/LiteracyBridge/acm/stargazers","contributors_url":"https://api.github.com/repos/LiteracyBridge/acm/contributors","subscribers_url":"https://api.github.com/repos/LiteracyBridge/acm/subscribers","subscription_url":"https://api.github.com/repos/LiteracyBridge/acm/subscription","commits_url":"https://api.github.com/repos/LiteracyBridge/acm/commits{/sha}","git_commits_url":"https://api.github.com/repos/LiteracyBridge/acm/git/commits{/sha}","comments_url":"https://api.github.com/repos/LiteracyBridge/acm/comments{/number}","issue_comment_url":"https://api.github.com/repos/LiteracyBridge/acm/issues/comments{/number}","contents_url":"https://api.github.com/repos/LiteracyBridge/acm/contents/{+path}","compare_url":"https://api.github.com/repos/LiteracyBridge/acm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LiteracyBridge/acm/merges","archive_url":"https://api.github.com/repos/LiteracyBridge/acm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LiteracyBridge/acm/downloads","issues_url":"https://api.github.com/repos/LiteracyBridge/acm/issues{/number}","pulls_url":"https://api.github.com/repos/LiteracyBridge/acm/pulls{/number}","milestones_url":"https://api.github.com/repos/LiteracyBridge/acm/milestones{/number}","notifications_url":"https://api.github.com/repos/LiteracyBridge/acm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LiteracyBridge/acm/labels{/name}","releases_url":"https://api.github.com/repos/LiteracyBridge/acm/releases{/id}","deployments_url":"https://api.github.com/repos/LiteracyBridge/acm/deployments","created_at":"2014-11-22T23:50:28Z","updated_at":"2016-02-02T01:18:20Z","pushed_at":"2016-05-23T03:35:25Z","git_url":"git://github.com/LiteracyBridge/acm.git","ssh_url":"git@github.com:LiteracyBridge/acm.git","clone_url":"https://github.com/LiteracyBridge/acm.git","svn_url":"https://github.com/LiteracyBridge/acm","homepage":null,"size":64507,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/LiteracyBridge/acm/pulls/5"},"html":{"href":"https://github.com/LiteracyBridge/acm/pull/5"},"issue":{"href":"https://api.github.com/repos/LiteracyBridge/acm/issues/5"},"comments":{"href":"https://api.github.com/repos/LiteracyBridge/acm/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/LiteracyBridge/acm/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/LiteracyBridge/acm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/LiteracyBridge/acm/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/LiteracyBridge/acm/statuses/b03498847d66592118f4b8564a9a83531636f5db"}}}}
{"actor":{"display_login":"billev"}}