{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/comments/70368360","id":70368360,"diff_hunk":"@@ -323,4 +327,57 @@ public void modifyText(ModifyEvent event) {\n       checkFlipToNext();\n     }\n   }\n+\n+  /**\n+   * Auto-fills javaPackageField as \"groupId.artifactId\" (or \"groupId\" if artifactId is empty),\n+   * only when 1) javaPackageField is empty; or 2) the field matches previous auto-fill before\n+   * ID modification.\n+   */\n+  private final class AutoPackageNameSetterOnGroupIdChange implements VerifyListener {\n+    @Override\n+    public void verifyText(VerifyEvent event) {\n+      // Below explains how to get text after modification:\n+      // http://stackoverflow.com/questions/32872249/get-text-of-swt-text-component-before-modification\n+      String newGroupId =\n+          getGroupId().substring(0, event.start) + event.text + getGroupId().substring(event.end);\n+\n+      String oldPackageName = suggestPackageName(getGroupId(), getArtifactId());\n+      String newPackageName = suggestPackageName(newGroupId, getArtifactId());\n+      AutoSetPackageNameIfNecessary(oldPackageName, newPackageName);\n+    }\n+  }\n+\n+  /**\n+   * See {@link AutoPackageNameSetterOnGroupIdChange}.\n+   */\n+  private final class AutoPackageNameSetterOnArtifactIdChange implements VerifyListener {\n+    @Override\n+    public void verifyText(VerifyEvent event) {\n+      String newArtifactId = getArtifactId().substring(0, event.start)\n+          + event.text + getArtifactId().substring(event.end);\n+\n+      String oldPackageName = suggestPackageName(getGroupId(), getArtifactId());\n+      String newPackageName = suggestPackageName(getGroupId(), newArtifactId);\n+      AutoSetPackageNameIfNecessary(oldPackageName, newPackageName);\n+    }\n+  }\n+\n+  /**\n+   * See {@link AutoPackageNameSetterOnGroupIdChange#verifyText(VerifyEvent)}.\n+   */\n+  private void AutoSetPackageNameIfNecessary(String oldPackageName, String newPackageName) {\n+    if (getPackageName().isEmpty() || getPackageName().equals(oldPackageName)) {\n+      javaPackageField.setText(newPackageName);\n+    }\n+  }\n+\n+  /**\n+   * Helper function returning a suggested package name based on groupId and artifactId.\n+   */\n+  private static String suggestPackageName(String groupId, String artifactId) {\n+    if (!artifactId.isEmpty()) {","path":"plugins/com.google.cloud.tools.eclipse.appengine.newproject.maven/src/com/google/cloud/tools/eclipse/appengine/newproject/maven/MavenAppEngineStandardWizardPage.java","position":86,"original_position":86,"commit_id":"6ae45b9d5b123bb2917541e916079fa7b07d5c80","original_commit_id":"6ae45b9d5b123bb2917541e916079fa7b07d5c80","user":{"login":"briandealwis","id":202851,"avatar_url":"https://avatars.githubusercontent.com/u/202851?v=3","gravatar_id":"","url":"https://api.github.com/users/briandealwis","html_url":"https://github.com/briandealwis","followers_url":"https://api.github.com/users/briandealwis/followers","following_url":"https://api.github.com/users/briandealwis/following{/other_user}","gists_url":"https://api.github.com/users/briandealwis/gists{/gist_id}","starred_url":"https://api.github.com/users/briandealwis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briandealwis/subscriptions","organizations_url":"https://api.github.com/users/briandealwis/orgs","repos_url":"https://api.github.com/users/briandealwis/repos","events_url":"https://api.github.com/users/briandealwis/events{/privacy}","received_events_url":"https://api.github.com/users/briandealwis/received_events","type":"User","site_admin":false},"body":"Should filter out invalid characters (e.g., dashes) and lower-case everything.  Maven has very few rules for group and artifact IDs.","created_at":"2016-07-12T02:16:49Z","updated_at":"2016-07-12T02:16:49Z","html_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/336#discussion_r70368360","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/336","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/comments/70368360"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/336#discussion_r70368360"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/336"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/336","id":76962482,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/336","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/336.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/336.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/336","number":336,"state":"open","locked":false,"title":"Auto-set package name as groupId in project wizard","user":{"login":"chanseokoh","id":10523105,"avatar_url":"https://avatars.githubusercontent.com/u/10523105?v=3","gravatar_id":"","url":"https://api.github.com/users/chanseokoh","html_url":"https://github.com/chanseokoh","followers_url":"https://api.github.com/users/chanseokoh/followers","following_url":"https://api.github.com/users/chanseokoh/following{/other_user}","gists_url":"https://api.github.com/users/chanseokoh/gists{/gist_id}","starred_url":"https://api.github.com/users/chanseokoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chanseokoh/subscriptions","organizations_url":"https://api.github.com/users/chanseokoh/orgs","repos_url":"https://api.github.com/users/chanseokoh/repos","events_url":"https://api.github.com/users/chanseokoh/events{/privacy}","received_events_url":"https://api.github.com/users/chanseokoh/received_events","type":"User","site_admin":false},"body":"Fixes #229.\r\n\r\n#229 mentions \"groupId.artifactId\", but the label in the wizard page says \"Java package: (defaults to group ID)\". For now, I just set it to groupId, since I believe artifactId usually contains hyphens.","created_at":"2016-07-11T14:23:24Z","updated_at":"2016-07-12T02:16:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a98d90b61f45c4ef58e278d24098d062556c79de","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/336/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/336/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/336/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/statuses/6ae45b9d5b123bb2917541e916079fa7b07d5c80","head":{"label":"GoogleCloudPlatform:autoset-package-name","ref":"autoset-package-name","sha":"6ae45b9d5b123bb2917541e916079fa7b07d5c80","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":53369484,"name":"gcloud-eclipse-tools","full_name":"GoogleCloudPlatform/gcloud-eclipse-tools","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools","description":"Google Cloud Platform plugin for Eclipse","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/deployments","created_at":"2016-03-08T00:30:03Z","updated_at":"2016-07-01T11:55:25Z","pushed_at":"2016-07-12T00:32:02Z","git_url":"git://github.com/GoogleCloudPlatform/gcloud-eclipse-tools.git","ssh_url":"git@github.com:GoogleCloudPlatform/gcloud-eclipse-tools.git","clone_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools.git","svn_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools","homepage":"","size":2513,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":80,"forks":2,"open_issues":80,"watchers":7,"default_branch":"master"}},"base":{"label":"GoogleCloudPlatform:master","ref":"master","sha":"83bb35bcae14a13b7ab580cad3962e4c3b251657","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":53369484,"name":"gcloud-eclipse-tools","full_name":"GoogleCloudPlatform/gcloud-eclipse-tools","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools","description":"Google Cloud Platform plugin for Eclipse","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/deployments","created_at":"2016-03-08T00:30:03Z","updated_at":"2016-07-01T11:55:25Z","pushed_at":"2016-07-12T00:32:02Z","git_url":"git://github.com/GoogleCloudPlatform/gcloud-eclipse-tools.git","ssh_url":"git@github.com:GoogleCloudPlatform/gcloud-eclipse-tools.git","clone_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools.git","svn_url":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools","homepage":"","size":2513,"stargazers_count":7,"watchers_count":7,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":80,"forks":2,"open_issues":80,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/336"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-eclipse-tools/pull/336"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/336"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/issues/336/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/336/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/pulls/336/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-eclipse-tools/statuses/6ae45b9d5b123bb2917541e916079fa7b07d5c80"}}}}
{"actor":{"display_login":"briandealwis"}}