{"action":"created","comment":{"url":"https://api.github.com/repos/kiegroup/drools-wb/pulls/comments/109224997","pull_request_review_id":30317972,"id":109224997,"diff_hunk":"@@ -0,0 +1,131 @@\n+/*\n+ * Copyright 2017 Red Hat, Inc. and/or its affiliates.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *       http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.drools.workbench.screens.guided.dtable.client.wizard.column.plugins.commons;\n+\n+import com.google.gwt.user.client.ui.IsWidget;\n+import com.google.gwt.user.client.ui.Widget;\n+import org.drools.workbench.models.datamodel.oracle.DataType;\n+import org.drools.workbench.models.guided.dtable.shared.model.ActionInsertFactCol52;\n+import org.drools.workbench.models.guided.dtable.shared.model.ActionSetFieldCol52;\n+import org.drools.workbench.models.guided.dtable.shared.model.ConditionCol52;\n+import org.drools.workbench.models.guided.dtable.shared.model.DTCellValue52;\n+import org.drools.workbench.models.guided.dtable.shared.model.DTColumnConfig52;\n+import org.drools.workbench.models.guided.dtable.shared.model.Pattern52;\n+import org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView;\n+import org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.CellUtilities;\n+import org.drools.workbench.screens.guided.dtable.client.widget.table.utilities.ColumnUtilities;\n+import org.drools.workbench.screens.guided.dtable.client.wizard.column.commons.HasValueOptionsPage;\n+\n+// TODO <karreiro> - Remove all instanceofs\n+public class DefaultWidgetFactory<T extends BaseDecisionTableColumnPlugin & HasValueOptionsPage> extends BaseWidgetFactory<T> {\n+\n+    public DefaultWidgetFactory(final T plugin) {\n+        super(plugin);\n+    }\n+\n+    public IsWidget create() {\n+        if (getDefaultValue() == null) {\n+            setDefaultValue();\n+        }\n+\n+        final DTCellValue52 defaultValue = prepareDefaultValue();\n+\n+        return getWidget(defaultValue);\n+    }\n+\n+    private Widget getWidget(final DTCellValue52 defaultValue) {\n+        final DTColumnConfig52 column = getPlugin().editingCol();\n+        final Pattern52 pattern = getPlugin().editingPattern();","path":"drools-wb-screens/drools-wb-guided-dtable-editor/drools-wb-guided-dtable-editor-client/src/main/java/org/drools/workbench/screens/guided/dtable/client/wizard/column/plugins/commons/DefaultWidgetFactory.java","position":51,"original_position":52,"commit_id":"28bd9c28e86f8cb4c1610687494682286ad896f9","original_commit_id":"10a8ecec75968eec8fd57e83e82499622eb4e9dd","user":{"login":"karreiro","id":1079279,"avatar_url":"https://avatars2.githubusercontent.com/u/1079279?v=3","gravatar_id":"","url":"https://api.github.com/users/karreiro","html_url":"https://github.com/karreiro","followers_url":"https://api.github.com/users/karreiro/followers","following_url":"https://api.github.com/users/karreiro/following{/other_user}","gists_url":"https://api.github.com/users/karreiro/gists{/gist_id}","starred_url":"https://api.github.com/users/karreiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karreiro/subscriptions","organizations_url":"https://api.github.com/users/karreiro/orgs","repos_url":"https://api.github.com/users/karreiro/repos","events_url":"https://api.github.com/users/karreiro/events{/privacy}","received_events_url":"https://api.github.com/users/karreiro/received_events","type":"User","site_admin":false},"body":"All plugins those implement `HasValueOptionsPage` are associeted with Pattern52.","created_at":"2017-03-31T18:38:14Z","updated_at":"2017-03-31T18:38:14Z","html_url":"https://github.com/kiegroup/drools-wb/pull/431#discussion_r109224997","pull_request_url":"https://api.github.com/repos/kiegroup/drools-wb/pulls/431","_links":{"self":{"href":"https://api.github.com/repos/kiegroup/drools-wb/pulls/comments/109224997"},"html":{"href":"https://github.com/kiegroup/drools-wb/pull/431#discussion_r109224997"},"pull_request":{"href":"https://api.github.com/repos/kiegroup/drools-wb/pulls/431"}}},"pull_request":{"url":"https://api.github.com/repos/kiegroup/drools-wb/pulls/431","id":112894324,"html_url":"https://github.com/kiegroup/drools-wb/pull/431","diff_url":"https://github.com/kiegroup/drools-wb/pull/431.diff","patch_url":"https://github.com/kiegroup/drools-wb/pull/431.patch","issue_url":"https://api.github.com/repos/kiegroup/drools-wb/issues/431","number":431,"state":"open","locked":false,"title":"GDT Editor - New column Wizard","user":{"login":"karreiro","id":1079279,"avatar_url":"https://avatars2.githubusercontent.com/u/1079279?v=3","gravatar_id":"","url":"https://api.github.com/users/karreiro","html_url":"https://github.com/karreiro","followers_url":"https://api.github.com/users/karreiro/followers","following_url":"https://api.github.com/users/karreiro/following{/other_user}","gists_url":"https://api.github.com/users/karreiro/gists{/gist_id}","starred_url":"https://api.github.com/users/karreiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karreiro/subscriptions","organizations_url":"https://api.github.com/users/karreiro/orgs","repos_url":"https://api.github.com/users/karreiro/repos","events_url":"https://api.github.com/users/karreiro/events{/privacy}","received_events_url":"https://api.github.com/users/karreiro/received_events","type":"User","site_admin":false},"body":"The new Wizard purpose is to improve the UX for creating new columns, refactor the current popups to the MVP pattern and make the plugins for new column creation pluggable using CDI to \"discover\" all implementations.\r\n\r\n#### Plugins:\r\n- Add a simple Condition\r\n  ![w1](https://cloud.githubusercontent.com/assets/1079279/24390679/e092781c-1360-11e7-94a6-3d2b1ed3b3a1.gif)\r\n- Delete an existing fact\r\n  ![w2](https://cloud.githubusercontent.com/assets/1079279/24390683/e665a2b4-1360-11e7-943d-8c8d7a7d491d.gif)\r\n- Set the value of a field\r\n  ![w3](https://cloud.githubusercontent.com/assets/1079279/24390685/e68743ce-1360-11e7-8cbe-54bc17678b1e.gif)\r\n- Add a Condition BRL fragment\r\n  ![w4](https://cloud.githubusercontent.com/assets/1079279/24390687/e69f95be-1360-11e7-8439-172bd863dd3c.gif)\r\n- Add a new Attribute column\r\n  ![w5](https://cloud.githubusercontent.com/assets/1079279/24390686/e69fb378-1360-11e7-87b1-b8ff25079e66.gif)\r\n- Add a new Metadata column\r\n  ![w6](https://cloud.githubusercontent.com/assets/1079279/24390688/e6a0eeb4-1360-11e7-858b-1fc440d4f1f4.gif)\r\n- Add an Action BRL fragment\r\n  ![w7](https://cloud.githubusercontent.com/assets/1079279/24390689/e6a10390-1360-11e7-8830-8ecbcc7b12cf.gif)\r\n- Execute a Work Item\r\n  ![w8](https://cloud.githubusercontent.com/assets/1079279/24390690/e6a0cd58-1360-11e7-87e9-7a4edd67b1ff.gif)\r\n- Set the value of a field with a Work Item parameter\r\n  ![w9](https://cloud.githubusercontent.com/assets/1079279/24390691/e6a45d92-1360-11e7-9653-1f63d5a83687.gif)\r\n","created_at":"2017-03-28T05:49:24Z","updated_at":"2017-03-31T18:38:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f12978d9efa693d09cc13eada30a2eedda469cdc","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kiegroup/drools-wb/pulls/431/commits","review_comments_url":"https://api.github.com/repos/kiegroup/drools-wb/pulls/431/comments","review_comment_url":"https://api.github.com/repos/kiegroup/drools-wb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kiegroup/drools-wb/issues/431/comments","statuses_url":"https://api.github.com/repos/kiegroup/drools-wb/statuses/28bd9c28e86f8cb4c1610687494682286ad896f9","head":{"label":"karreiro:new-column-wizard","ref":"new-column-wizard","sha":"28bd9c28e86f8cb4c1610687494682286ad896f9","user":{"login":"karreiro","id":1079279,"avatar_url":"https://avatars2.githubusercontent.com/u/1079279?v=3","gravatar_id":"","url":"https://api.github.com/users/karreiro","html_url":"https://github.com/karreiro","followers_url":"https://api.github.com/users/karreiro/followers","following_url":"https://api.github.com/users/karreiro/following{/other_user}","gists_url":"https://api.github.com/users/karreiro/gists{/gist_id}","starred_url":"https://api.github.com/users/karreiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karreiro/subscriptions","organizations_url":"https://api.github.com/users/karreiro/orgs","repos_url":"https://api.github.com/users/karreiro/repos","events_url":"https://api.github.com/users/karreiro/events{/privacy}","received_events_url":"https://api.github.com/users/karreiro/received_events","type":"User","site_admin":false},"repo":{"id":61569788,"name":"drools-wb","full_name":"karreiro/drools-wb","owner":{"login":"karreiro","id":1079279,"avatar_url":"https://avatars2.githubusercontent.com/u/1079279?v=3","gravatar_id":"","url":"https://api.github.com/users/karreiro","html_url":"https://github.com/karreiro","followers_url":"https://api.github.com/users/karreiro/followers","following_url":"https://api.github.com/users/karreiro/following{/other_user}","gists_url":"https://api.github.com/users/karreiro/gists{/gist_id}","starred_url":"https://api.github.com/users/karreiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karreiro/subscriptions","organizations_url":"https://api.github.com/users/karreiro/orgs","repos_url":"https://api.github.com/users/karreiro/repos","events_url":"https://api.github.com/users/karreiro/events{/privacy}","received_events_url":"https://api.github.com/users/karreiro/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/karreiro/drools-wb","description":"Drools Workbench is the web application and repository to govern Drools assets.","fork":true,"url":"https://api.github.com/repos/karreiro/drools-wb","forks_url":"https://api.github.com/repos/karreiro/drools-wb/forks","keys_url":"https://api.github.com/repos/karreiro/drools-wb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/karreiro/drools-wb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/karreiro/drools-wb/teams","hooks_url":"https://api.github.com/repos/karreiro/drools-wb/hooks","issue_events_url":"https://api.github.com/repos/karreiro/drools-wb/issues/events{/number}","events_url":"https://api.github.com/repos/karreiro/drools-wb/events","assignees_url":"https://api.github.com/repos/karreiro/drools-wb/assignees{/user}","branches_url":"https://api.github.com/repos/karreiro/drools-wb/branches{/branch}","tags_url":"https://api.github.com/repos/karreiro/drools-wb/tags","blobs_url":"https://api.github.com/repos/karreiro/drools-wb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/karreiro/drools-wb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/karreiro/drools-wb/git/refs{/sha}","trees_url":"https://api.github.com/repos/karreiro/drools-wb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/karreiro/drools-wb/statuses/{sha}","languages_url":"https://api.github.com/repos/karreiro/drools-wb/languages","stargazers_url":"https://api.github.com/repos/karreiro/drools-wb/stargazers","contributors_url":"https://api.github.com/repos/karreiro/drools-wb/contributors","subscribers_url":"https://api.github.com/repos/karreiro/drools-wb/subscribers","subscription_url":"https://api.github.com/repos/karreiro/drools-wb/subscription","commits_url":"https://api.github.com/repos/karreiro/drools-wb/commits{/sha}","git_commits_url":"https://api.github.com/repos/karreiro/drools-wb/git/commits{/sha}","comments_url":"https://api.github.com/repos/karreiro/drools-wb/comments{/number}","issue_comment_url":"https://api.github.com/repos/karreiro/drools-wb/issues/comments{/number}","contents_url":"https://api.github.com/repos/karreiro/drools-wb/contents/{+path}","compare_url":"https://api.github.com/repos/karreiro/drools-wb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/karreiro/drools-wb/merges","archive_url":"https://api.github.com/repos/karreiro/drools-wb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/karreiro/drools-wb/downloads","issues_url":"https://api.github.com/repos/karreiro/drools-wb/issues{/number}","pulls_url":"https://api.github.com/repos/karreiro/drools-wb/pulls{/number}","milestones_url":"https://api.github.com/repos/karreiro/drools-wb/milestones{/number}","notifications_url":"https://api.github.com/repos/karreiro/drools-wb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/karreiro/drools-wb/labels{/name}","releases_url":"https://api.github.com/repos/karreiro/drools-wb/releases{/id}","deployments_url":"https://api.github.com/repos/karreiro/drools-wb/deployments","created_at":"2016-06-20T18:13:14Z","updated_at":"2016-06-20T18:13:21Z","pushed_at":"2017-03-31T18:29:32Z","git_url":"git://github.com/karreiro/drools-wb.git","ssh_url":"git@github.com:karreiro/drools-wb.git","clone_url":"https://github.com/karreiro/drools-wb.git","svn_url":"https://github.com/karreiro/drools-wb","homepage":"","size":136414,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kiegroup:master","ref":"master","sha":"0128918d1500f4dfd4390b52d965aa55f4919fd6","user":{"login":"kiegroup","id":517980,"avatar_url":"https://avatars0.githubusercontent.com/u/517980?v=3","gravatar_id":"","url":"https://api.github.com/users/kiegroup","html_url":"https://github.com/kiegroup","followers_url":"https://api.github.com/users/kiegroup/followers","following_url":"https://api.github.com/users/kiegroup/following{/other_user}","gists_url":"https://api.github.com/users/kiegroup/gists{/gist_id}","starred_url":"https://api.github.com/users/kiegroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiegroup/subscriptions","organizations_url":"https://api.github.com/users/kiegroup/orgs","repos_url":"https://api.github.com/users/kiegroup/repos","events_url":"https://api.github.com/users/kiegroup/events{/privacy}","received_events_url":"https://api.github.com/users/kiegroup/received_events","type":"Organization","site_admin":false},"repo":{"id":10522020,"name":"drools-wb","full_name":"kiegroup/drools-wb","owner":{"login":"kiegroup","id":517980,"avatar_url":"https://avatars0.githubusercontent.com/u/517980?v=3","gravatar_id":"","url":"https://api.github.com/users/kiegroup","html_url":"https://github.com/kiegroup","followers_url":"https://api.github.com/users/kiegroup/followers","following_url":"https://api.github.com/users/kiegroup/following{/other_user}","gists_url":"https://api.github.com/users/kiegroup/gists{/gist_id}","starred_url":"https://api.github.com/users/kiegroup/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiegroup/subscriptions","organizations_url":"https://api.github.com/users/kiegroup/orgs","repos_url":"https://api.github.com/users/kiegroup/repos","events_url":"https://api.github.com/users/kiegroup/events{/privacy}","received_events_url":"https://api.github.com/users/kiegroup/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kiegroup/drools-wb","description":"Drools Workbench is the web application and repository to govern Drools assets.","fork":false,"url":"https://api.github.com/repos/kiegroup/drools-wb","forks_url":"https://api.github.com/repos/kiegroup/drools-wb/forks","keys_url":"https://api.github.com/repos/kiegroup/drools-wb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kiegroup/drools-wb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kiegroup/drools-wb/teams","hooks_url":"https://api.github.com/repos/kiegroup/drools-wb/hooks","issue_events_url":"https://api.github.com/repos/kiegroup/drools-wb/issues/events{/number}","events_url":"https://api.github.com/repos/kiegroup/drools-wb/events","assignees_url":"https://api.github.com/repos/kiegroup/drools-wb/assignees{/user}","branches_url":"https://api.github.com/repos/kiegroup/drools-wb/branches{/branch}","tags_url":"https://api.github.com/repos/kiegroup/drools-wb/tags","blobs_url":"https://api.github.com/repos/kiegroup/drools-wb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kiegroup/drools-wb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kiegroup/drools-wb/git/refs{/sha}","trees_url":"https://api.github.com/repos/kiegroup/drools-wb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kiegroup/drools-wb/statuses/{sha}","languages_url":"https://api.github.com/repos/kiegroup/drools-wb/languages","stargazers_url":"https://api.github.com/repos/kiegroup/drools-wb/stargazers","contributors_url":"https://api.github.com/repos/kiegroup/drools-wb/contributors","subscribers_url":"https://api.github.com/repos/kiegroup/drools-wb/subscribers","subscription_url":"https://api.github.com/repos/kiegroup/drools-wb/subscription","commits_url":"https://api.github.com/repos/kiegroup/drools-wb/commits{/sha}","git_commits_url":"https://api.github.com/repos/kiegroup/drools-wb/git/commits{/sha}","comments_url":"https://api.github.com/repos/kiegroup/drools-wb/comments{/number}","issue_comment_url":"https://api.github.com/repos/kiegroup/drools-wb/issues/comments{/number}","contents_url":"https://api.github.com/repos/kiegroup/drools-wb/contents/{+path}","compare_url":"https://api.github.com/repos/kiegroup/drools-wb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kiegroup/drools-wb/merges","archive_url":"https://api.github.com/repos/kiegroup/drools-wb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kiegroup/drools-wb/downloads","issues_url":"https://api.github.com/repos/kiegroup/drools-wb/issues{/number}","pulls_url":"https://api.github.com/repos/kiegroup/drools-wb/pulls{/number}","milestones_url":"https://api.github.com/repos/kiegroup/drools-wb/milestones{/number}","notifications_url":"https://api.github.com/repos/kiegroup/drools-wb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kiegroup/drools-wb/labels{/name}","releases_url":"https://api.github.com/repos/kiegroup/drools-wb/releases{/id}","deployments_url":"https://api.github.com/repos/kiegroup/drools-wb/deployments","created_at":"2013-06-06T08:26:25Z","updated_at":"2017-02-26T20:35:09Z","pushed_at":"2017-03-31T18:29:34Z","git_url":"git://github.com/kiegroup/drools-wb.git","ssh_url":"git@github.com:kiegroup/drools-wb.git","clone_url":"https://github.com/kiegroup/drools-wb.git","svn_url":"https://github.com/kiegroup/drools-wb","homepage":"","size":136213,"stargazers_count":21,"watchers_count":21,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":138,"mirror_url":null,"open_issues_count":3,"forks":138,"open_issues":3,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kiegroup/drools-wb/pulls/431"},"html":{"href":"https://github.com/kiegroup/drools-wb/pull/431"},"issue":{"href":"https://api.github.com/repos/kiegroup/drools-wb/issues/431"},"comments":{"href":"https://api.github.com/repos/kiegroup/drools-wb/issues/431/comments"},"review_comments":{"href":"https://api.github.com/repos/kiegroup/drools-wb/pulls/431/comments"},"review_comment":{"href":"https://api.github.com/repos/kiegroup/drools-wb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kiegroup/drools-wb/pulls/431/commits"},"statuses":{"href":"https://api.github.com/repos/kiegroup/drools-wb/statuses/28bd9c28e86f8cb4c1610687494682286ad896f9"}}}}
{"actor":{"display_login":"karreiro"}}