{"action":"created","comment":{"url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/comments/53151880","id":53151880,"diff_hunk":"@@ -211,4 +223,130 @@ public int hashCode() {\n     public int compareTo(TurboLabel o) {\n         return actualName.compareTo(o.getActualName());\n     }\n+\n+    /**\n+     * Returns the TurboLabel in labels that matches labelName\n+     * Assumption: the labelName matches exactly 1 TurboLabel\n+     *\n+     * @param labels\n+     * @param labelName\n+     * @return\n+     */\n+    public static TurboLabel getMatchingTurboLabel(List<TurboLabel> labels, String labelName) {\n+        assert labels.stream()\n+                .filter(label -> label.getActualName().equals(labelName))\n+                .findFirst()\n+                .isPresent();\n+        return labels.stream()\n+                .filter(label -> label.getActualName().equals(labelName))\n+                .findFirst()\n+                .get();\n+    }\n+\n+    public static List<String> getLabelsNameList(List<TurboLabel> labels) {\n+        return labels.stream()\n+                .map(TurboLabel::getActualName)\n+                .collect(Collectors.toList());\n+    }\n+\n+    /**\n+     * Returns the list of labels which name contains labelName\n+     * @param repoLabels\n+     * @param labelName\n+     * @return\n+     */\n+    public static List<String> filterByPartialName(List<String> repoLabels, String labelName) {\n+        return repoLabels\n+                .stream()\n+                .filter(name -> Utility.containsIgnoreCase(getName(name), labelName))\n+                .collect(Collectors.toList());\n+    }\n+\n+    /**\n+     * Returns the list of labels which group contains labelGroup.","path":"src/main/java/backend/resource/TurboLabel.java","position":75,"original_position":75,"commit_id":"cb4afdde62950b7c6101a8a323252a09293fd80e","original_commit_id":"cb4afdde62950b7c6101a8a323252a09293fd80e","user":{"login":"damithc","id":1673303,"avatar_url":"https://avatars.githubusercontent.com/u/1673303?v=3","gravatar_id":"","url":"https://api.github.com/users/damithc","html_url":"https://github.com/damithc","followers_url":"https://api.github.com/users/damithc/followers","following_url":"https://api.github.com/users/damithc/following{/other_user}","gists_url":"https://api.github.com/users/damithc/gists{/gist_id}","starred_url":"https://api.github.com/users/damithc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/damithc/subscriptions","organizations_url":"https://api.github.com/users/damithc/orgs","repos_url":"https://api.github.com/users/damithc/repos","events_url":"https://api.github.com/users/damithc/events{/privacy}","received_events_url":"https://api.github.com/users/damithc/received_events","type":"User","site_admin":false},"body":"This sentence is hard to understand.","created_at":"2016-02-17T11:32:38Z","updated_at":"2016-02-17T11:32:38Z","html_url":"https://github.com/HubTurbo/HubTurbo/pull/1232#discussion_r53151880","pull_request_url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/1232","_links":{"self":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/comments/53151880"},"html":{"href":"https://github.com/HubTurbo/HubTurbo/pull/1232#discussion_r53151880"},"pull_request":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/1232"}}},"pull_request":{"url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/1232","id":57938141,"html_url":"https://github.com/HubTurbo/HubTurbo/pull/1232","diff_url":"https://github.com/HubTurbo/HubTurbo/pull/1232.diff","patch_url":"https://github.com/HubTurbo/HubTurbo/pull/1232.patch","issue_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/1232","number":1232,"state":"open","locked":false,"title":"Refactor LabelPicker #1215","user":{"login":"jinified","id":3635970,"avatar_url":"https://avatars.githubusercontent.com/u/3635970?v=3","gravatar_id":"","url":"https://api.github.com/users/jinified","html_url":"https://github.com/jinified","followers_url":"https://api.github.com/users/jinified/followers","following_url":"https://api.github.com/users/jinified/following{/other_user}","gists_url":"https://api.github.com/users/jinified/gists{/gist_id}","starred_url":"https://api.github.com/users/jinified/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinified/subscriptions","organizations_url":"https://api.github.com/users/jinified/orgs","repos_url":"https://api.github.com/users/jinified/repos","events_url":"https://api.github.com/users/jinified/events{/privacy}","received_events_url":"https://api.github.com/users/jinified/received_events","type":"User","site_admin":false},"body":"Fixes #1215 \r\n\r\n## Changes \r\n1. Separated view into a [LabelPickerVIew.fxml](https://github.com/nus-fboa2016-ht/HubTurbo/blob/1215-refactor-labelpicker/src/main/resources/ui/fxml/LabelPickerView.fxml#L1-L29)\r\n2. Rendering of UI elements is performed solely by LabelPickerDialog. \r\n3. LabelPickerUILogic provides UI with information needed whenever a change occurs in the. `queryField`. The whole state of the LabelPicker can be determined by content of the `queryField`\r\n4. No longer supports the `up` and `down` shortcut keys to move highlighted label.\r\n\r\n## Currently supported features\r\n1. Changes in `queryField` will trigger update of LabelPickerDialog. \r\n2. On mouse click, the `queryField` will be cleared and disabled. All matched labels will also be clear.\r\n3. Supports pasting of text and trigger changes for every single token i.e `hi ref for` will toggle labels such as \"high\", \"refactoring\" and highlight \"forFirstTimer\".\r\n\r\n## Bugs/Flaws that needed to be fixed\r\n1. Order of addedLabels will change after each `UI` update because a Set is used to stored the labels\r\n2. Failure to match label with more than two words i.e `help wanted`\r\n3. UI behaves erratically on Ubuntu like previous iteration of LabelPicker\r\n4. Multiple copy-paste operation of large amount of text slows down `LabelPicker` to a halt.\r\n\r\n## Planned improvements \r\n1. Use `PickerLabel` to replace String for faster rendition of labels \r\n2. Refactor `LabelPickerDialog` \r\n3. Merge `LabelPickerState` and `LabelPickerUILogic`\r\n","created_at":"2016-02-02T04:07:23Z","updated_at":"2016-02-17T11:32:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b652dcfa75ee1b99b04d82d139e6f571ce820392","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/1232/commits","review_comments_url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/1232/comments","review_comment_url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/1232/comments","statuses_url":"https://api.github.com/repos/HubTurbo/HubTurbo/statuses/cb4afdde62950b7c6101a8a323252a09293fd80e","head":{"label":"nus-fboa2016-ht:1215-refactor-labelpicker","ref":"1215-refactor-labelpicker","sha":"cb4afdde62950b7c6101a8a323252a09293fd80e","user":{"login":"nus-fboa2016-ht","id":16697280,"avatar_url":"https://avatars.githubusercontent.com/u/16697280?v=3","gravatar_id":"","url":"https://api.github.com/users/nus-fboa2016-ht","html_url":"https://github.com/nus-fboa2016-ht","followers_url":"https://api.github.com/users/nus-fboa2016-ht/followers","following_url":"https://api.github.com/users/nus-fboa2016-ht/following{/other_user}","gists_url":"https://api.github.com/users/nus-fboa2016-ht/gists{/gist_id}","starred_url":"https://api.github.com/users/nus-fboa2016-ht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nus-fboa2016-ht/subscriptions","organizations_url":"https://api.github.com/users/nus-fboa2016-ht/orgs","repos_url":"https://api.github.com/users/nus-fboa2016-ht/repos","events_url":"https://api.github.com/users/nus-fboa2016-ht/events{/privacy}","received_events_url":"https://api.github.com/users/nus-fboa2016-ht/received_events","type":"Organization","site_admin":false},"repo":{"id":50709503,"name":"HubTurbo","full_name":"nus-fboa2016-ht/HubTurbo","owner":{"login":"nus-fboa2016-ht","id":16697280,"avatar_url":"https://avatars.githubusercontent.com/u/16697280?v=3","gravatar_id":"","url":"https://api.github.com/users/nus-fboa2016-ht","html_url":"https://github.com/nus-fboa2016-ht","followers_url":"https://api.github.com/users/nus-fboa2016-ht/followers","following_url":"https://api.github.com/users/nus-fboa2016-ht/following{/other_user}","gists_url":"https://api.github.com/users/nus-fboa2016-ht/gists{/gist_id}","starred_url":"https://api.github.com/users/nus-fboa2016-ht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nus-fboa2016-ht/subscriptions","organizations_url":"https://api.github.com/users/nus-fboa2016-ht/orgs","repos_url":"https://api.github.com/users/nus-fboa2016-ht/repos","events_url":"https://api.github.com/users/nus-fboa2016-ht/events{/privacy}","received_events_url":"https://api.github.com/users/nus-fboa2016-ht/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nus-fboa2016-ht/HubTurbo","description":"A companion to GitHub for your desktop","fork":true,"url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo","forks_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/forks","keys_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/teams","hooks_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/hooks","issue_events_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/issues/events{/number}","events_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/events","assignees_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/assignees{/user}","branches_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/branches{/branch}","tags_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/tags","blobs_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/git/refs{/sha}","trees_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/statuses/{sha}","languages_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/languages","stargazers_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/stargazers","contributors_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/contributors","subscribers_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/subscribers","subscription_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/subscription","commits_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/commits{/sha}","git_commits_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/git/commits{/sha}","comments_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/comments{/number}","issue_comment_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/issues/comments{/number}","contents_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/contents/{+path}","compare_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/merges","archive_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/downloads","issues_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/issues{/number}","pulls_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/pulls{/number}","milestones_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/milestones{/number}","notifications_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/labels{/name}","releases_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/releases{/id}","deployments_url":"https://api.github.com/repos/nus-fboa2016-ht/HubTurbo/deployments","created_at":"2016-01-30T04:49:53Z","updated_at":"2016-01-30T04:49:58Z","pushed_at":"2016-02-17T10:07:46Z","git_url":"git://github.com/nus-fboa2016-ht/HubTurbo.git","ssh_url":"git@github.com:nus-fboa2016-ht/HubTurbo.git","clone_url":"https://github.com/nus-fboa2016-ht/HubTurbo.git","svn_url":"https://github.com/nus-fboa2016-ht/HubTurbo","homepage":"http://hubturbo.info","size":133732,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"HubTurbo:master","ref":"master","sha":"53c8abdd3cba07bc875182bf7c94f62e0a017272","user":{"login":"HubTurbo","id":7955871,"avatar_url":"https://avatars.githubusercontent.com/u/7955871?v=3","gravatar_id":"","url":"https://api.github.com/users/HubTurbo","html_url":"https://github.com/HubTurbo","followers_url":"https://api.github.com/users/HubTurbo/followers","following_url":"https://api.github.com/users/HubTurbo/following{/other_user}","gists_url":"https://api.github.com/users/HubTurbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HubTurbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HubTurbo/subscriptions","organizations_url":"https://api.github.com/users/HubTurbo/orgs","repos_url":"https://api.github.com/users/HubTurbo/repos","events_url":"https://api.github.com/users/HubTurbo/events{/privacy}","received_events_url":"https://api.github.com/users/HubTurbo/received_events","type":"Organization","site_admin":false},"repo":{"id":20919534,"name":"HubTurbo","full_name":"HubTurbo/HubTurbo","owner":{"login":"HubTurbo","id":7955871,"avatar_url":"https://avatars.githubusercontent.com/u/7955871?v=3","gravatar_id":"","url":"https://api.github.com/users/HubTurbo","html_url":"https://github.com/HubTurbo","followers_url":"https://api.github.com/users/HubTurbo/followers","following_url":"https://api.github.com/users/HubTurbo/following{/other_user}","gists_url":"https://api.github.com/users/HubTurbo/gists{/gist_id}","starred_url":"https://api.github.com/users/HubTurbo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HubTurbo/subscriptions","organizations_url":"https://api.github.com/users/HubTurbo/orgs","repos_url":"https://api.github.com/users/HubTurbo/repos","events_url":"https://api.github.com/users/HubTurbo/events{/privacy}","received_events_url":"https://api.github.com/users/HubTurbo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HubTurbo/HubTurbo","description":"A companion to GitHub for your desktop","fork":false,"url":"https://api.github.com/repos/HubTurbo/HubTurbo","forks_url":"https://api.github.com/repos/HubTurbo/HubTurbo/forks","keys_url":"https://api.github.com/repos/HubTurbo/HubTurbo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HubTurbo/HubTurbo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HubTurbo/HubTurbo/teams","hooks_url":"https://api.github.com/repos/HubTurbo/HubTurbo/hooks","issue_events_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/events{/number}","events_url":"https://api.github.com/repos/HubTurbo/HubTurbo/events","assignees_url":"https://api.github.com/repos/HubTurbo/HubTurbo/assignees{/user}","branches_url":"https://api.github.com/repos/HubTurbo/HubTurbo/branches{/branch}","tags_url":"https://api.github.com/repos/HubTurbo/HubTurbo/tags","blobs_url":"https://api.github.com/repos/HubTurbo/HubTurbo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HubTurbo/HubTurbo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HubTurbo/HubTurbo/git/refs{/sha}","trees_url":"https://api.github.com/repos/HubTurbo/HubTurbo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HubTurbo/HubTurbo/statuses/{sha}","languages_url":"https://api.github.com/repos/HubTurbo/HubTurbo/languages","stargazers_url":"https://api.github.com/repos/HubTurbo/HubTurbo/stargazers","contributors_url":"https://api.github.com/repos/HubTurbo/HubTurbo/contributors","subscribers_url":"https://api.github.com/repos/HubTurbo/HubTurbo/subscribers","subscription_url":"https://api.github.com/repos/HubTurbo/HubTurbo/subscription","commits_url":"https://api.github.com/repos/HubTurbo/HubTurbo/commits{/sha}","git_commits_url":"https://api.github.com/repos/HubTurbo/HubTurbo/git/commits{/sha}","comments_url":"https://api.github.com/repos/HubTurbo/HubTurbo/comments{/number}","issue_comment_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/comments{/number}","contents_url":"https://api.github.com/repos/HubTurbo/HubTurbo/contents/{+path}","compare_url":"https://api.github.com/repos/HubTurbo/HubTurbo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HubTurbo/HubTurbo/merges","archive_url":"https://api.github.com/repos/HubTurbo/HubTurbo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HubTurbo/HubTurbo/downloads","issues_url":"https://api.github.com/repos/HubTurbo/HubTurbo/issues{/number}","pulls_url":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls{/number}","milestones_url":"https://api.github.com/repos/HubTurbo/HubTurbo/milestones{/number}","notifications_url":"https://api.github.com/repos/HubTurbo/HubTurbo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HubTurbo/HubTurbo/labels{/name}","releases_url":"https://api.github.com/repos/HubTurbo/HubTurbo/releases{/id}","deployments_url":"https://api.github.com/repos/HubTurbo/HubTurbo/deployments","created_at":"2014-06-17T10:35:39Z","updated_at":"2016-01-13T06:03:59Z","pushed_at":"2016-02-17T10:22:30Z","git_url":"git://github.com/HubTurbo/HubTurbo.git","ssh_url":"git@github.com:HubTurbo/HubTurbo.git","clone_url":"https://github.com/HubTurbo/HubTurbo.git","svn_url":"https://github.com/HubTurbo/HubTurbo","homepage":"http://hubturbo.info","size":133284,"stargazers_count":15,"watchers_count":15,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":26,"mirror_url":null,"open_issues_count":169,"forks":26,"open_issues":169,"watchers":15,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/1232"},"html":{"href":"https://github.com/HubTurbo/HubTurbo/pull/1232"},"issue":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/1232"},"comments":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/issues/1232/comments"},"review_comments":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/1232/comments"},"review_comment":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/pulls/1232/commits"},"statuses":{"href":"https://api.github.com/repos/HubTurbo/HubTurbo/statuses/cb4afdde62950b7c6101a8a323252a09293fd80e"}}}}