{"action":"created","comment":{"url":"https://api.github.com/repos/wandernauta/Groep10/pulls/comments/27261415","id":27261415,"diff_hunk":"@@ -81,20 +73,24 @@ private void initializeArguments(int numberOfArguments) {\n \t\n \t/**\n \t * Method to set the value of a specified argument\n-\t * @param the index of the argument field\n-\t * @param the value that the argument should be changed to\n \t */\n \tpublic void setArgument(int i,String arg) {\n \t\targuments[i] = arg;\n \t}\n+\n+\tpublic String getName() {\n+\t\treturn name.get();\n+\t}\n \t\n-\t/**\n-\t * Method to set the name of this FunctionBlock\n-\t * @param name\n-\t */\n \tpublic void setName(String name) {\n-\t\tfunctionName = name;\n-\t\tLabel label = ((Label)this.lookup(\"#label_function_name\"));\n-\t\tlabel.setText(functionName);\n+\t\tthis.name.set(name);\n+\t}\n+\n+\tpublic String getType() {\n+\t\treturn type.get();\n+\t}\n+\n+\tpublic void setType(String type) {\n+\t\tthis.type.set(type);","path":"Code/src/main/java/nl/utwente/group10/ui/components/FunctionBlock.java","position":122,"original_position":122,"commit_id":"096a948aafbe234df48e2cccce96e479c0d7437e","original_commit_id":"096a948aafbe234df48e2cccce96e479c0d7437e","user":{"login":"wandernauta","id":126832,"avatar_url":"https://avatars.githubusercontent.com/u/126832?v=3","gravatar_id":"","url":"https://api.github.com/users/wandernauta","html_url":"https://github.com/wandernauta","followers_url":"https://api.github.com/users/wandernauta/followers","following_url":"https://api.github.com/users/wandernauta/following{/other_user}","gists_url":"https://api.github.com/users/wandernauta/gists{/gist_id}","starred_url":"https://api.github.com/users/wandernauta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wandernauta/subscriptions","organizations_url":"https://api.github.com/users/wandernauta/orgs","repos_url":"https://api.github.com/users/wandernauta/repos","events_url":"https://api.github.com/users/wandernauta/events{/privacy}","received_events_url":"https://api.github.com/users/wandernauta/received_events","type":"User","site_admin":false},"body":"Getters are mandatory.","created_at":"2015-03-26T22:10:56Z","updated_at":"2015-03-26T22:10:56Z","html_url":"https://github.com/wandernauta/Groep10/pull/26#discussion_r27261415","pull_request_url":"https://api.github.com/repos/wandernauta/Groep10/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/wandernauta/Groep10/pulls/comments/27261415"},"html":{"href":"https://github.com/wandernauta/Groep10/pull/26#discussion_r27261415"},"pull_request":{"href":"https://api.github.com/repos/wandernauta/Groep10/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/wandernauta/Groep10/pulls/26","id":32065588,"html_url":"https://github.com/wandernauta/Groep10/pull/26","diff_url":"https://github.com/wandernauta/Groep10/pull/26.diff","patch_url":"https://github.com/wandernauta/Groep10/pull/26.patch","issue_url":"https://api.github.com/repos/wandernauta/Groep10/issues/26","number":26,"state":"closed","locked":false,"title":"Demonstrate JavaFX data binding","user":{"login":"wandernauta","id":126832,"avatar_url":"https://avatars.githubusercontent.com/u/126832?v=3","gravatar_id":"","url":"https://api.github.com/users/wandernauta","html_url":"https://github.com/wandernauta","followers_url":"https://api.github.com/users/wandernauta/followers","following_url":"https://api.github.com/users/wandernauta/following{/other_user}","gists_url":"https://api.github.com/users/wandernauta/gists{/gist_id}","starred_url":"https://api.github.com/users/wandernauta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wandernauta/subscriptions","organizations_url":"https://api.github.com/users/wandernauta/orgs","repos_url":"https://api.github.com/users/wandernauta/repos","events_url":"https://api.github.com/users/wandernauta/events{/privacy}","received_events_url":"https://api.github.com/users/wandernauta/received_events","type":"User","site_admin":false},"body":"Hello hello,\r\n\r\nI noticed some hardcore manual setting of properties going on in frontend stuff so far. This is not a problem in and out of itself, however, JavaFX also has some data binding features which could be of use. Specifically:\r\n\r\n- JavaFX can inject parts of the interface for you by `fx:id`. This replaces `lookup` and friends.\r\n- JavaFX can observe (!) properties from your class and use those as attributes. This replaces `setText` et al.\r\n\r\nThis has a few advantages:\r\n\r\n- No duplicate state: for example, the function name is now stored in one place, not copied from the FunctionBlock to the corresponding label.\r\n- Decoupling: want to add another label with the same content? Easy.\r\n- No need to remember doing `setText()` calls or anything.\r\n- The FXML is a bit simpler and shorter.\r\n- No need to do calls to `this.lookup`. These calls need an (ugly!) cast to do what you want, and they're probably slow besides, as they have to walk through the entire component every time you do a lookup. Injecting happens once.\r\n\r\nThis PR is just a (runnable) demonstration/proof of concept; I'll close it right away. It is provided in the hope that it will be useful.\r\n\r\nCheers,\r\nWander","created_at":"2015-03-26T21:58:51Z","updated_at":"2015-03-26T22:10:56Z","closed_at":"2015-03-26T21:59:05Z","merged_at":null,"merge_commit_sha":"76829164ddf7e3fb2b1bb08570a70fd5442591ba","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wandernauta/Groep10/pulls/26/commits","review_comments_url":"https://api.github.com/repos/wandernauta/Groep10/pulls/26/comments","review_comment_url":"https://api.github.com/repos/wandernauta/Groep10/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wandernauta/Groep10/issues/26/comments","statuses_url":"https://api.github.com/repos/wandernauta/Groep10/statuses/096a948aafbe234df48e2cccce96e479c0d7437e","head":{"label":"wandernauta:fxml-binding","ref":"fxml-binding","sha":"096a948aafbe234df48e2cccce96e479c0d7437e","user":{"login":"wandernauta","id":126832,"avatar_url":"https://avatars.githubusercontent.com/u/126832?v=3","gravatar_id":"","url":"https://api.github.com/users/wandernauta","html_url":"https://github.com/wandernauta","followers_url":"https://api.github.com/users/wandernauta/followers","following_url":"https://api.github.com/users/wandernauta/following{/other_user}","gists_url":"https://api.github.com/users/wandernauta/gists{/gist_id}","starred_url":"https://api.github.com/users/wandernauta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wandernauta/subscriptions","organizations_url":"https://api.github.com/users/wandernauta/orgs","repos_url":"https://api.github.com/users/wandernauta/repos","events_url":"https://api.github.com/users/wandernauta/events{/privacy}","received_events_url":"https://api.github.com/users/wandernauta/received_events","type":"User","site_admin":false},"repo":{"id":30242992,"name":"Groep10","full_name":"wandernauta/Groep10","owner":{"login":"wandernauta","id":126832,"avatar_url":"https://avatars.githubusercontent.com/u/126832?v=3","gravatar_id":"","url":"https://api.github.com/users/wandernauta","html_url":"https://github.com/wandernauta","followers_url":"https://api.github.com/users/wandernauta/followers","following_url":"https://api.github.com/users/wandernauta/following{/other_user}","gists_url":"https://api.github.com/users/wandernauta/gists{/gist_id}","starred_url":"https://api.github.com/users/wandernauta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wandernauta/subscriptions","organizations_url":"https://api.github.com/users/wandernauta/orgs","repos_url":"https://api.github.com/users/wandernauta/repos","events_url":"https://api.github.com/users/wandernauta/events{/privacy}","received_events_url":"https://api.github.com/users/wandernauta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wandernauta/Groep10","description":"Ontwerpproject.","fork":false,"url":"https://api.github.com/repos/wandernauta/Groep10","forks_url":"https://api.github.com/repos/wandernauta/Groep10/forks","keys_url":"https://api.github.com/repos/wandernauta/Groep10/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wandernauta/Groep10/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wandernauta/Groep10/teams","hooks_url":"https://api.github.com/repos/wandernauta/Groep10/hooks","issue_events_url":"https://api.github.com/repos/wandernauta/Groep10/issues/events{/number}","events_url":"https://api.github.com/repos/wandernauta/Groep10/events","assignees_url":"https://api.github.com/repos/wandernauta/Groep10/assignees{/user}","branches_url":"https://api.github.com/repos/wandernauta/Groep10/branches{/branch}","tags_url":"https://api.github.com/repos/wandernauta/Groep10/tags","blobs_url":"https://api.github.com/repos/wandernauta/Groep10/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wandernauta/Groep10/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wandernauta/Groep10/git/refs{/sha}","trees_url":"https://api.github.com/repos/wandernauta/Groep10/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wandernauta/Groep10/statuses/{sha}","languages_url":"https://api.github.com/repos/wandernauta/Groep10/languages","stargazers_url":"https://api.github.com/repos/wandernauta/Groep10/stargazers","contributors_url":"https://api.github.com/repos/wandernauta/Groep10/contributors","subscribers_url":"https://api.github.com/repos/wandernauta/Groep10/subscribers","subscription_url":"https://api.github.com/repos/wandernauta/Groep10/subscription","commits_url":"https://api.github.com/repos/wandernauta/Groep10/commits{/sha}","git_commits_url":"https://api.github.com/repos/wandernauta/Groep10/git/commits{/sha}","comments_url":"https://api.github.com/repos/wandernauta/Groep10/comments{/number}","issue_comment_url":"https://api.github.com/repos/wandernauta/Groep10/issues/comments{/number}","contents_url":"https://api.github.com/repos/wandernauta/Groep10/contents/{+path}","compare_url":"https://api.github.com/repos/wandernauta/Groep10/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wandernauta/Groep10/merges","archive_url":"https://api.github.com/repos/wandernauta/Groep10/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wandernauta/Groep10/downloads","issues_url":"https://api.github.com/repos/wandernauta/Groep10/issues{/number}","pulls_url":"https://api.github.com/repos/wandernauta/Groep10/pulls{/number}","milestones_url":"https://api.github.com/repos/wandernauta/Groep10/milestones{/number}","notifications_url":"https://api.github.com/repos/wandernauta/Groep10/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wandernauta/Groep10/labels{/name}","releases_url":"https://api.github.com/repos/wandernauta/Groep10/releases{/id}","created_at":"2015-02-03T13:04:49Z","updated_at":"2015-03-26T19:17:14Z","pushed_at":"2015-03-26T21:59:19Z","git_url":"git://github.com/wandernauta/Groep10.git","ssh_url":"git@github.com:wandernauta/Groep10.git","clone_url":"https://github.com/wandernauta/Groep10.git","svn_url":"https://github.com/wandernauta/Groep10","homepage":null,"size":2773,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"wandernauta:master","ref":"master","sha":"f157337ba6941edbbd440b0abafacf6d79927a8d","user":{"login":"wandernauta","id":126832,"avatar_url":"https://avatars.githubusercontent.com/u/126832?v=3","gravatar_id":"","url":"https://api.github.com/users/wandernauta","html_url":"https://github.com/wandernauta","followers_url":"https://api.github.com/users/wandernauta/followers","following_url":"https://api.github.com/users/wandernauta/following{/other_user}","gists_url":"https://api.github.com/users/wandernauta/gists{/gist_id}","starred_url":"https://api.github.com/users/wandernauta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wandernauta/subscriptions","organizations_url":"https://api.github.com/users/wandernauta/orgs","repos_url":"https://api.github.com/users/wandernauta/repos","events_url":"https://api.github.com/users/wandernauta/events{/privacy}","received_events_url":"https://api.github.com/users/wandernauta/received_events","type":"User","site_admin":false},"repo":{"id":30242992,"name":"Groep10","full_name":"wandernauta/Groep10","owner":{"login":"wandernauta","id":126832,"avatar_url":"https://avatars.githubusercontent.com/u/126832?v=3","gravatar_id":"","url":"https://api.github.com/users/wandernauta","html_url":"https://github.com/wandernauta","followers_url":"https://api.github.com/users/wandernauta/followers","following_url":"https://api.github.com/users/wandernauta/following{/other_user}","gists_url":"https://api.github.com/users/wandernauta/gists{/gist_id}","starred_url":"https://api.github.com/users/wandernauta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wandernauta/subscriptions","organizations_url":"https://api.github.com/users/wandernauta/orgs","repos_url":"https://api.github.com/users/wandernauta/repos","events_url":"https://api.github.com/users/wandernauta/events{/privacy}","received_events_url":"https://api.github.com/users/wandernauta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wandernauta/Groep10","description":"Ontwerpproject.","fork":false,"url":"https://api.github.com/repos/wandernauta/Groep10","forks_url":"https://api.github.com/repos/wandernauta/Groep10/forks","keys_url":"https://api.github.com/repos/wandernauta/Groep10/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wandernauta/Groep10/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wandernauta/Groep10/teams","hooks_url":"https://api.github.com/repos/wandernauta/Groep10/hooks","issue_events_url":"https://api.github.com/repos/wandernauta/Groep10/issues/events{/number}","events_url":"https://api.github.com/repos/wandernauta/Groep10/events","assignees_url":"https://api.github.com/repos/wandernauta/Groep10/assignees{/user}","branches_url":"https://api.github.com/repos/wandernauta/Groep10/branches{/branch}","tags_url":"https://api.github.com/repos/wandernauta/Groep10/tags","blobs_url":"https://api.github.com/repos/wandernauta/Groep10/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wandernauta/Groep10/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wandernauta/Groep10/git/refs{/sha}","trees_url":"https://api.github.com/repos/wandernauta/Groep10/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wandernauta/Groep10/statuses/{sha}","languages_url":"https://api.github.com/repos/wandernauta/Groep10/languages","stargazers_url":"https://api.github.com/repos/wandernauta/Groep10/stargazers","contributors_url":"https://api.github.com/repos/wandernauta/Groep10/contributors","subscribers_url":"https://api.github.com/repos/wandernauta/Groep10/subscribers","subscription_url":"https://api.github.com/repos/wandernauta/Groep10/subscription","commits_url":"https://api.github.com/repos/wandernauta/Groep10/commits{/sha}","git_commits_url":"https://api.github.com/repos/wandernauta/Groep10/git/commits{/sha}","comments_url":"https://api.github.com/repos/wandernauta/Groep10/comments{/number}","issue_comment_url":"https://api.github.com/repos/wandernauta/Groep10/issues/comments{/number}","contents_url":"https://api.github.com/repos/wandernauta/Groep10/contents/{+path}","compare_url":"https://api.github.com/repos/wandernauta/Groep10/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wandernauta/Groep10/merges","archive_url":"https://api.github.com/repos/wandernauta/Groep10/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wandernauta/Groep10/downloads","issues_url":"https://api.github.com/repos/wandernauta/Groep10/issues{/number}","pulls_url":"https://api.github.com/repos/wandernauta/Groep10/pulls{/number}","milestones_url":"https://api.github.com/repos/wandernauta/Groep10/milestones{/number}","notifications_url":"https://api.github.com/repos/wandernauta/Groep10/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wandernauta/Groep10/labels{/name}","releases_url":"https://api.github.com/repos/wandernauta/Groep10/releases{/id}","created_at":"2015-02-03T13:04:49Z","updated_at":"2015-03-26T19:17:14Z","pushed_at":"2015-03-26T21:59:19Z","git_url":"git://github.com/wandernauta/Groep10.git","ssh_url":"git@github.com:wandernauta/Groep10.git","clone_url":"https://github.com/wandernauta/Groep10.git","svn_url":"https://github.com/wandernauta/Groep10","homepage":null,"size":2773,"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":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wandernauta/Groep10/pulls/26"},"html":{"href":"https://github.com/wandernauta/Groep10/pull/26"},"issue":{"href":"https://api.github.com/repos/wandernauta/Groep10/issues/26"},"comments":{"href":"https://api.github.com/repos/wandernauta/Groep10/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/wandernauta/Groep10/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/wandernauta/Groep10/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wandernauta/Groep10/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/wandernauta/Groep10/statuses/096a948aafbe234df48e2cccce96e479c0d7437e"}}}}