{"action":"created","comment":{"url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/comments/106035009","pull_request_review_id":26938717,"id":106035009,"diff_hunk":"@@ -17,46 +18,103 @@\n public class DatabaseChooserController implements SourceChooser<DataSource> {\n \n     @FXML\n-    public BorderPane rootPane;\n+    private BorderPane rootPaneDatabase;\n     @FXML\n-    public TextField uriField;\n+    private TextField ipField;\n+    @FXML\n+    private TextField databaseNameField;\n+    @FXML\n+    private TextField portField;\n     @FXML\n     public Label uriError;\n \n-    private ReadOnlyObjectWrapper<URI> databaseUriProperty;\n+    private ReadOnlyObjectWrapper<URI> databaseURIProperty;\n+    private ReadOnlyObjectWrapper<String> databaseNameProperty;\n+    private ReadOnlyObjectWrapper<Integer> portProperty;\n+    private ReadOnlyObjectWrapper<URI> completeURIProperty;\n     private ObservableBooleanValue uriChosen;\n \n     @FXML\n     public void initialize() {\n-        databaseUriProperty = new ReadOnlyObjectWrapper<>();\n-        uriChosen = databaseUriProperty.isNotNull();\n+        databaseURIProperty = new ReadOnlyObjectWrapper<>();\n+        databaseNameProperty = new ReadOnlyObjectWrapper<>();\n+        portProperty = new ReadOnlyObjectWrapper<>();\n+        completeURIProperty = new ReadOnlyObjectWrapper<>();\n+        uriChosen = completeURIProperty.isNotNull();\n \n-        uriField.textProperty().addListener((o, oldValue, newValue) -> {\n+        ipField.textProperty().addListener((o, oldValue, newValue) -> {\n             if (newValue == null || newValue.trim().isEmpty()) {\n-                databaseUriProperty.set(null);\n+                databaseURIProperty.set(null);\n                 return;\n             }\n             URI uri = null;\n+            newValue = newValue.trim();\n             try {\n                 uri = new URI(newValue);\n-                databaseUriProperty.set(uri);\n+                databaseURIProperty.set(uri);\n+                check();\n             } catch (URISyntaxException ignored) {\n-                System.out.println(ignored.getMessage());\n-                databaseUriProperty.set(null);\n+                String message = String.format(\"%s is not a valid URI.\", newValue);\n+                Logger.getLogger(getClass().getName()).info(message);\n             } finally {\n                 // Display the error message if the URI hasn't been set\n                 uriError.setVisible(uri == null);\n             }\n         });\n \n-        URI initialUri = getInitialUri();\n-        uriField.setText(initialUri == null ? \"\" : initialUri.toString());\n+        databaseNameProperty.bindBidirectional(databaseNameField.textProperty());\n \n-        databaseUriProperty.addListener((observable, oldValue, newValue) -> {\n-            if (newValue != null) {\n-                setInitialUri(newValue);\n+        portField.textProperty().addListener((observable, oldValue, newValue) -> {\n+            newValue = newValue.trim();\n+            try {\n+                int port = Integer.valueOf(newValue);\n+                portProperty.set(port);\n+                check();\n+            } catch (NumberFormatException ignored) {\n+                portProperty.set(null);\n             }\n         });\n+\n+        loadInitialValues();\n+    }\n+\n+    private void loadInitialValues() {\n+        String configKey = ConfigKey.initialDatabaseUri.getKey();\n+        String uriString = ConfigFile.getInstance().getProperty(configKey);\n+        if (uriString != null && !uriString.isEmpty()) {\n+            try {\n+                URI uri = URI.create(uriString);\n+                ipField.setText(String.format(\"%s://%s\", uri.getScheme(), uri.getHost()));\n+                portField.setText(String.valueOf(uri.getPort()));","path":"src/main/java/com/github/bachelorpraktikum/dbvisualization/view/sourcechooser/DatabaseChooserController.java","position":94,"original_position":94,"commit_id":"e1cf66d3c136cb75fe1e87f34ec8959d0015396a","original_commit_id":"e1cf66d3c136cb75fe1e87f34ec8959d0015396a","user":{"login":"BjoernPetersen","id":2513555,"avatar_url":"https://avatars1.githubusercontent.com/u/2513555?v=3","gravatar_id":"","url":"https://api.github.com/users/BjoernPetersen","html_url":"https://github.com/BjoernPetersen","followers_url":"https://api.github.com/users/BjoernPetersen/followers","following_url":"https://api.github.com/users/BjoernPetersen/following{/other_user}","gists_url":"https://api.github.com/users/BjoernPetersen/gists{/gist_id}","starred_url":"https://api.github.com/users/BjoernPetersen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BjoernPetersen/subscriptions","organizations_url":"https://api.github.com/users/BjoernPetersen/orgs","repos_url":"https://api.github.com/users/BjoernPetersen/repos","events_url":"https://api.github.com/users/BjoernPetersen/events{/privacy}","received_events_url":"https://api.github.com/users/BjoernPetersen/received_events","type":"User","site_admin":false},"body":"URI.getPort() returns -1 if no port was specified. We should probably fall back to the default MySQL port (3306) here.","created_at":"2017-03-14T21:42:51Z","updated_at":"2017-03-14T21:53:19Z","html_url":"https://github.com/Bachelorpraktikum/DBVisualization/pull/79#discussion_r106035009","pull_request_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/79","_links":{"self":{"href":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/comments/106035009"},"html":{"href":"https://github.com/Bachelorpraktikum/DBVisualization/pull/79#discussion_r106035009"},"pull_request":{"href":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/79"}}},"pull_request":{"url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/79","id":110492157,"html_url":"https://github.com/Bachelorpraktikum/DBVisualization/pull/79","diff_url":"https://github.com/Bachelorpraktikum/DBVisualization/pull/79.diff","patch_url":"https://github.com/Bachelorpraktikum/DBVisualization/pull/79.patch","issue_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/issues/79","number":79,"state":"open","locked":false,"title":"New database chooser layout","user":{"login":"Chabare","id":7738181,"avatar_url":"https://avatars3.githubusercontent.com/u/7738181?v=3","gravatar_id":"","url":"https://api.github.com/users/Chabare","html_url":"https://github.com/Chabare","followers_url":"https://api.github.com/users/Chabare/followers","following_url":"https://api.github.com/users/Chabare/following{/other_user}","gists_url":"https://api.github.com/users/Chabare/gists{/gist_id}","starred_url":"https://api.github.com/users/Chabare/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chabare/subscriptions","organizations_url":"https://api.github.com/users/Chabare/orgs","repos_url":"https://api.github.com/users/Chabare/repos","events_url":"https://api.github.com/users/Chabare/events{/privacy}","received_events_url":"https://api.github.com/users/Chabare/received_events","type":"User","site_admin":false},"body":"Introduces 3 different fields for the database values.\r\n\r\n- IP/URI\r\n- Name of the database\r\n- Port\r\n\r\nThe fields are shown below each other in the order defined above.\r\n\r\nOn startup the data from the config file is loaded.","created_at":"2017-03-13T20:36:18Z","updated_at":"2017-03-14T21:53:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"68f5917d443d48f244ca35f51bca4cec608e9934","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/79/commits","review_comments_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/79/comments","review_comment_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/issues/79/comments","statuses_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/statuses/e1cf66d3c136cb75fe1e87f34ec8959d0015396a","head":{"label":"Bachelorpraktikum:feature/databaseNewChooserLayout","ref":"feature/databaseNewChooserLayout","sha":"e1cf66d3c136cb75fe1e87f34ec8959d0015396a","user":{"login":"Bachelorpraktikum","id":23262132,"avatar_url":"https://avatars1.githubusercontent.com/u/23262132?v=3","gravatar_id":"","url":"https://api.github.com/users/Bachelorpraktikum","html_url":"https://github.com/Bachelorpraktikum","followers_url":"https://api.github.com/users/Bachelorpraktikum/followers","following_url":"https://api.github.com/users/Bachelorpraktikum/following{/other_user}","gists_url":"https://api.github.com/users/Bachelorpraktikum/gists{/gist_id}","starred_url":"https://api.github.com/users/Bachelorpraktikum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bachelorpraktikum/subscriptions","organizations_url":"https://api.github.com/users/Bachelorpraktikum/orgs","repos_url":"https://api.github.com/users/Bachelorpraktikum/repos","events_url":"https://api.github.com/users/Bachelorpraktikum/events{/privacy}","received_events_url":"https://api.github.com/users/Bachelorpraktikum/received_events","type":"Organization","site_admin":false},"repo":{"id":72854900,"name":"DBVisualization","full_name":"Bachelorpraktikum/DBVisualization","owner":{"login":"Bachelorpraktikum","id":23262132,"avatar_url":"https://avatars1.githubusercontent.com/u/23262132?v=3","gravatar_id":"","url":"https://api.github.com/users/Bachelorpraktikum","html_url":"https://github.com/Bachelorpraktikum","followers_url":"https://api.github.com/users/Bachelorpraktikum/followers","following_url":"https://api.github.com/users/Bachelorpraktikum/following{/other_user}","gists_url":"https://api.github.com/users/Bachelorpraktikum/gists{/gist_id}","starred_url":"https://api.github.com/users/Bachelorpraktikum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bachelorpraktikum/subscriptions","organizations_url":"https://api.github.com/users/Bachelorpraktikum/orgs","repos_url":"https://api.github.com/users/Bachelorpraktikum/repos","events_url":"https://api.github.com/users/Bachelorpraktikum/events{/privacy}","received_events_url":"https://api.github.com/users/Bachelorpraktikum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bachelorpraktikum/DBVisualization","description":null,"fork":false,"url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization","forks_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/forks","keys_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/teams","hooks_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/hooks","issue_events_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/issues/events{/number}","events_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/events","assignees_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/assignees{/user}","branches_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/branches{/branch}","tags_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/tags","blobs_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/statuses/{sha}","languages_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/languages","stargazers_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/stargazers","contributors_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/contributors","subscribers_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/subscribers","subscription_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/subscription","commits_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/contents/{+path}","compare_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/merges","archive_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/downloads","issues_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/issues{/number}","pulls_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls{/number}","milestones_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/milestones{/number}","notifications_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/labels{/name}","releases_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/releases{/id}","deployments_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/deployments","created_at":"2016-11-04T14:27:39Z","updated_at":"2016-11-10T19:02:57Z","pushed_at":"2017-03-14T02:55:13Z","git_url":"git://github.com/Bachelorpraktikum/DBVisualization.git","ssh_url":"git@github.com:Bachelorpraktikum/DBVisualization.git","clone_url":"https://github.com/Bachelorpraktikum/DBVisualization.git","svn_url":"https://github.com/Bachelorpraktikum/DBVisualization","homepage":null,"size":545,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"Bachelorpraktikum:develop","ref":"develop","sha":"67d1765e4104f0f068539bfbc21b676b34ef8839","user":{"login":"Bachelorpraktikum","id":23262132,"avatar_url":"https://avatars1.githubusercontent.com/u/23262132?v=3","gravatar_id":"","url":"https://api.github.com/users/Bachelorpraktikum","html_url":"https://github.com/Bachelorpraktikum","followers_url":"https://api.github.com/users/Bachelorpraktikum/followers","following_url":"https://api.github.com/users/Bachelorpraktikum/following{/other_user}","gists_url":"https://api.github.com/users/Bachelorpraktikum/gists{/gist_id}","starred_url":"https://api.github.com/users/Bachelorpraktikum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bachelorpraktikum/subscriptions","organizations_url":"https://api.github.com/users/Bachelorpraktikum/orgs","repos_url":"https://api.github.com/users/Bachelorpraktikum/repos","events_url":"https://api.github.com/users/Bachelorpraktikum/events{/privacy}","received_events_url":"https://api.github.com/users/Bachelorpraktikum/received_events","type":"Organization","site_admin":false},"repo":{"id":72854900,"name":"DBVisualization","full_name":"Bachelorpraktikum/DBVisualization","owner":{"login":"Bachelorpraktikum","id":23262132,"avatar_url":"https://avatars1.githubusercontent.com/u/23262132?v=3","gravatar_id":"","url":"https://api.github.com/users/Bachelorpraktikum","html_url":"https://github.com/Bachelorpraktikum","followers_url":"https://api.github.com/users/Bachelorpraktikum/followers","following_url":"https://api.github.com/users/Bachelorpraktikum/following{/other_user}","gists_url":"https://api.github.com/users/Bachelorpraktikum/gists{/gist_id}","starred_url":"https://api.github.com/users/Bachelorpraktikum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bachelorpraktikum/subscriptions","organizations_url":"https://api.github.com/users/Bachelorpraktikum/orgs","repos_url":"https://api.github.com/users/Bachelorpraktikum/repos","events_url":"https://api.github.com/users/Bachelorpraktikum/events{/privacy}","received_events_url":"https://api.github.com/users/Bachelorpraktikum/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bachelorpraktikum/DBVisualization","description":null,"fork":false,"url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization","forks_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/forks","keys_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/teams","hooks_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/hooks","issue_events_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/issues/events{/number}","events_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/events","assignees_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/assignees{/user}","branches_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/branches{/branch}","tags_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/tags","blobs_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/statuses/{sha}","languages_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/languages","stargazers_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/stargazers","contributors_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/contributors","subscribers_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/subscribers","subscription_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/subscription","commits_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/contents/{+path}","compare_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/merges","archive_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/downloads","issues_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/issues{/number}","pulls_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls{/number}","milestones_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/milestones{/number}","notifications_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/labels{/name}","releases_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/releases{/id}","deployments_url":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/deployments","created_at":"2016-11-04T14:27:39Z","updated_at":"2016-11-10T19:02:57Z","pushed_at":"2017-03-14T02:55:13Z","git_url":"git://github.com/Bachelorpraktikum/DBVisualization.git","ssh_url":"git@github.com:Bachelorpraktikum/DBVisualization.git","clone_url":"https://github.com/Bachelorpraktikum/DBVisualization.git","svn_url":"https://github.com/Bachelorpraktikum/DBVisualization","homepage":null,"size":545,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/79"},"html":{"href":"https://github.com/Bachelorpraktikum/DBVisualization/pull/79"},"issue":{"href":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/issues/79"},"comments":{"href":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/issues/79/comments"},"review_comments":{"href":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/79/comments"},"review_comment":{"href":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/pulls/79/commits"},"statuses":{"href":"https://api.github.com/repos/Bachelorpraktikum/DBVisualization/statuses/e1cf66d3c136cb75fe1e87f34ec8959d0015396a"}}}}
{"actor":{"display_login":"BjoernPetersen"}}