{"action":"created","comment":{"url":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/comments/69272611","id":69272611,"diff_hunk":"@@ -0,0 +1,203 @@\n+package org.obeonetwork.m2doc.sirius;\n+\n+import java.io.File;\n+import java.util.ArrayList;\n+import java.util.Collection;\n+import java.util.HashMap;\n+import java.util.List;\n+import java.util.Map;\n+\n+import org.eclipse.core.runtime.CoreException;\n+import org.eclipse.core.runtime.IPath;\n+import org.eclipse.core.runtime.NullProgressMonitor;\n+import org.eclipse.core.runtime.Path;\n+import org.eclipse.emf.ecore.EObject;\n+import org.eclipse.emf.ecore.util.EcoreUtil;\n+import org.eclipse.emf.edit.domain.EditingDomain;\n+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;\n+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;\n+import org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat;\n+import org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUtil;\n+import org.eclipse.gmf.runtime.notation.Diagram;\n+import org.eclipse.sirius.business.api.dialect.DialectManager;\n+import org.eclipse.sirius.business.api.session.CustomDataConstants;\n+import org.eclipse.sirius.business.api.session.Session;\n+import org.eclipse.sirius.business.api.session.SessionManager;\n+import org.eclipse.sirius.diagram.DDiagram;\n+import org.eclipse.sirius.diagram.DSemanticDiagram;\n+import org.eclipse.sirius.diagram.business.api.query.DDiagramQuery;\n+import org.eclipse.sirius.diagram.business.internal.metamodel.spec.DSemanticDiagramSpec;\n+import org.eclipse.sirius.diagram.description.DiagramDescription;\n+import org.eclipse.sirius.diagram.ui.tools.api.part.DiagramEditPartService;\n+import org.eclipse.sirius.viewpoint.DRepresentation;\n+import org.eclipse.sirius.viewpoint.DView;\n+import org.eclipse.sirius.viewpoint.description.AnnotationEntry;\n+import org.eclipse.sirius.viewpoint.description.Viewpoint;\n+import org.obeonetwork.m2doc.provider.DiagramProvider;\n+import org.obeonetwork.m2doc.provider.IProvider;\n+import org.obeonetwork.m2doc.provider.OptionType;\n+import org.obeonetwork.m2doc.provider.ProviderConstants;\n+import org.obeonetwork.m2doc.provider.ProviderException;\n+\n+/**\n+ * {@link SiriusDiagramByRepresentationAndEObjectProvider} are used to get sirius diagrams from an\n+ * eObject and a name.\n+ * \n+ * @author Romain Guider\n+ */\n+public class SiriusDiagramByRepresentationAndEObjectProvider extends DiagramProvider {\n+\t/**\n+\t * The option key used to retrieve the {@link EObject} root of some diagram representations. \n+\t */\n+\tprivate static final String KEY_TARGET_ROOT_OBJECT = \"rootObject\";\n+\t/**\n+\t * The key used in the map passed to {@link IProvider} to define the Sirius\n+\t * representation title from which image will be computed.\n+\t */\n+\tprivate static final String KEY_DIAGRAM_DESCRIPTION_NAME = \"diagramDescriptionName\";","path":"plugins/org.obeonetwork.m2doc.sirius/src/org/obeonetwork/m2doc/sirius/SiriusDiagramByRepresentationAndEObjectProvider.java","position":null,"original_position":57,"commit_id":"4db093d88de88dd90190cc8605a905c7ec68a004","original_commit_id":"5906ab0a039826748e6149c85b3706cfc95b635c","user":{"login":"RomainGuider","id":1021936,"avatar_url":"https://avatars.githubusercontent.com/u/1021936?v=3","gravatar_id":"","url":"https://api.github.com/users/RomainGuider","html_url":"https://github.com/RomainGuider","followers_url":"https://api.github.com/users/RomainGuider/followers","following_url":"https://api.github.com/users/RomainGuider/following{/other_user}","gists_url":"https://api.github.com/users/RomainGuider/gists{/gist_id}","starred_url":"https://api.github.com/users/RomainGuider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomainGuider/subscriptions","organizations_url":"https://api.github.com/users/RomainGuider/orgs","repos_url":"https://api.github.com/users/RomainGuider/repos","events_url":"https://api.github.com/users/RomainGuider/events{/privacy}","received_events_url":"https://api.github.com/users/RomainGuider/received_events","type":"User","site_admin":false},"body":"same remark as with the previous constant : I would name it DIAGRAM_DESCRIPTION_NAME_KEY","created_at":"2016-07-01T09:24:30Z","updated_at":"2016-07-01T09:24:30Z","html_url":"https://github.com/ObeoNetwork/M2Doc/pull/11#discussion_r69272611","pull_request_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/comments/69272611"},"html":{"href":"https://github.com/ObeoNetwork/M2Doc/pull/11#discussion_r69272611"},"pull_request":{"href":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/11","id":74817068,"html_url":"https://github.com/ObeoNetwork/M2Doc/pull/11","diff_url":"https://github.com/ObeoNetwork/M2Doc/pull/11.diff","patch_url":"https://github.com/ObeoNetwork/M2Doc/pull/11.patch","issue_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/issues/11","number":11,"state":"closed","locked":false,"title":"Wip/provider","user":{"login":"pguilet","id":1279966,"avatar_url":"https://avatars.githubusercontent.com/u/1279966?v=3","gravatar_id":"","url":"https://api.github.com/users/pguilet","html_url":"https://github.com/pguilet","followers_url":"https://api.github.com/users/pguilet/followers","following_url":"https://api.github.com/users/pguilet/following{/other_user}","gists_url":"https://api.github.com/users/pguilet/gists{/gist_id}","starred_url":"https://api.github.com/users/pguilet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pguilet/subscriptions","organizations_url":"https://api.github.com/users/pguilet/orgs","repos_url":"https://api.github.com/users/pguilet/repos","events_url":"https://api.github.com/users/pguilet/events{/privacy}","received_events_url":"https://api.github.com/users/pguilet/received_events","type":"User","site_admin":false},"body":"Contains provider handling","created_at":"2016-06-22T16:38:12Z","updated_at":"2016-07-01T09:24:30Z","closed_at":"2016-06-29T13:46:17Z","merged_at":null,"merge_commit_sha":"84a63924edcb164ef1c95fb2e972f02536c6da61","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/11/commits","review_comments_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/11/comments","review_comment_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/issues/11/comments","statuses_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/statuses/4db093d88de88dd90190cc8605a905c7ec68a004","head":{"label":"ObeoNetwork:wip/provider","ref":"wip/provider","sha":"4db093d88de88dd90190cc8605a905c7ec68a004","user":{"login":"ObeoNetwork","id":651145,"avatar_url":"https://avatars.githubusercontent.com/u/651145?v=3","gravatar_id":"","url":"https://api.github.com/users/ObeoNetwork","html_url":"https://github.com/ObeoNetwork","followers_url":"https://api.github.com/users/ObeoNetwork/followers","following_url":"https://api.github.com/users/ObeoNetwork/following{/other_user}","gists_url":"https://api.github.com/users/ObeoNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/ObeoNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ObeoNetwork/subscriptions","organizations_url":"https://api.github.com/users/ObeoNetwork/orgs","repos_url":"https://api.github.com/users/ObeoNetwork/repos","events_url":"https://api.github.com/users/ObeoNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/ObeoNetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":55606056,"name":"M2Doc","full_name":"ObeoNetwork/M2Doc","owner":{"login":"ObeoNetwork","id":651145,"avatar_url":"https://avatars.githubusercontent.com/u/651145?v=3","gravatar_id":"","url":"https://api.github.com/users/ObeoNetwork","html_url":"https://github.com/ObeoNetwork","followers_url":"https://api.github.com/users/ObeoNetwork/followers","following_url":"https://api.github.com/users/ObeoNetwork/following{/other_user}","gists_url":"https://api.github.com/users/ObeoNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/ObeoNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ObeoNetwork/subscriptions","organizations_url":"https://api.github.com/users/ObeoNetwork/orgs","repos_url":"https://api.github.com/users/ObeoNetwork/repos","events_url":"https://api.github.com/users/ObeoNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/ObeoNetwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ObeoNetwork/M2Doc","description":"","fork":false,"url":"https://api.github.com/repos/ObeoNetwork/M2Doc","forks_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/forks","keys_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/teams","hooks_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/hooks","issue_events_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/issues/events{/number}","events_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/events","assignees_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/assignees{/user}","branches_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/branches{/branch}","tags_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/tags","blobs_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/git/refs{/sha}","trees_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/statuses/{sha}","languages_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/languages","stargazers_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/stargazers","contributors_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/contributors","subscribers_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/subscribers","subscription_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/subscription","commits_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/commits{/sha}","git_commits_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/git/commits{/sha}","comments_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/comments{/number}","issue_comment_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/issues/comments{/number}","contents_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/contents/{+path}","compare_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/merges","archive_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/downloads","issues_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/issues{/number}","pulls_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls{/number}","milestones_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/milestones{/number}","notifications_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/labels{/name}","releases_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/releases{/id}","deployments_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/deployments","created_at":"2016-04-06T13:00:08Z","updated_at":"2016-05-20T09:55:37Z","pushed_at":"2016-06-30T18:48:56Z","git_url":"git://github.com/ObeoNetwork/M2Doc.git","ssh_url":"git@github.com:ObeoNetwork/M2Doc.git","clone_url":"https://github.com/ObeoNetwork/M2Doc.git","svn_url":"https://github.com/ObeoNetwork/M2Doc","homepage":null,"size":70793,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"ObeoNetwork:master","ref":"master","sha":"a1db36c2eed3516afce3c4f0521cc3ab588cbdd0","user":{"login":"ObeoNetwork","id":651145,"avatar_url":"https://avatars.githubusercontent.com/u/651145?v=3","gravatar_id":"","url":"https://api.github.com/users/ObeoNetwork","html_url":"https://github.com/ObeoNetwork","followers_url":"https://api.github.com/users/ObeoNetwork/followers","following_url":"https://api.github.com/users/ObeoNetwork/following{/other_user}","gists_url":"https://api.github.com/users/ObeoNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/ObeoNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ObeoNetwork/subscriptions","organizations_url":"https://api.github.com/users/ObeoNetwork/orgs","repos_url":"https://api.github.com/users/ObeoNetwork/repos","events_url":"https://api.github.com/users/ObeoNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/ObeoNetwork/received_events","type":"Organization","site_admin":false},"repo":{"id":55606056,"name":"M2Doc","full_name":"ObeoNetwork/M2Doc","owner":{"login":"ObeoNetwork","id":651145,"avatar_url":"https://avatars.githubusercontent.com/u/651145?v=3","gravatar_id":"","url":"https://api.github.com/users/ObeoNetwork","html_url":"https://github.com/ObeoNetwork","followers_url":"https://api.github.com/users/ObeoNetwork/followers","following_url":"https://api.github.com/users/ObeoNetwork/following{/other_user}","gists_url":"https://api.github.com/users/ObeoNetwork/gists{/gist_id}","starred_url":"https://api.github.com/users/ObeoNetwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ObeoNetwork/subscriptions","organizations_url":"https://api.github.com/users/ObeoNetwork/orgs","repos_url":"https://api.github.com/users/ObeoNetwork/repos","events_url":"https://api.github.com/users/ObeoNetwork/events{/privacy}","received_events_url":"https://api.github.com/users/ObeoNetwork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ObeoNetwork/M2Doc","description":"","fork":false,"url":"https://api.github.com/repos/ObeoNetwork/M2Doc","forks_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/forks","keys_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/teams","hooks_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/hooks","issue_events_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/issues/events{/number}","events_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/events","assignees_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/assignees{/user}","branches_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/branches{/branch}","tags_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/tags","blobs_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/git/refs{/sha}","trees_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/statuses/{sha}","languages_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/languages","stargazers_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/stargazers","contributors_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/contributors","subscribers_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/subscribers","subscription_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/subscription","commits_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/commits{/sha}","git_commits_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/git/commits{/sha}","comments_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/comments{/number}","issue_comment_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/issues/comments{/number}","contents_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/contents/{+path}","compare_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/merges","archive_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/downloads","issues_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/issues{/number}","pulls_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls{/number}","milestones_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/milestones{/number}","notifications_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/labels{/name}","releases_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/releases{/id}","deployments_url":"https://api.github.com/repos/ObeoNetwork/M2Doc/deployments","created_at":"2016-04-06T13:00:08Z","updated_at":"2016-05-20T09:55:37Z","pushed_at":"2016-06-30T18:48:56Z","git_url":"git://github.com/ObeoNetwork/M2Doc.git","ssh_url":"git@github.com:ObeoNetwork/M2Doc.git","clone_url":"https://github.com/ObeoNetwork/M2Doc.git","svn_url":"https://github.com/ObeoNetwork/M2Doc","homepage":null,"size":70793,"stargazers_count":1,"watchers_count":1,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/11"},"html":{"href":"https://github.com/ObeoNetwork/M2Doc/pull/11"},"issue":{"href":"https://api.github.com/repos/ObeoNetwork/M2Doc/issues/11"},"comments":{"href":"https://api.github.com/repos/ObeoNetwork/M2Doc/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ObeoNetwork/M2Doc/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/ObeoNetwork/M2Doc/statuses/4db093d88de88dd90190cc8605a905c7ec68a004"}}}}
{"actor":{"display_login":"RomainGuider"}}