{"action":"created","issue":{"url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/1568","labels_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/1568/labels{/name}","comments_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/1568/comments","events_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/1568/events","html_url":"https://github.com/ControlSystemStudio/cs-studio/issues/1568","id":126896703,"number":1568,"title":"OPI Editor perspective should open if you open an OPI file in OPI editor","user":{"login":"willrogers","id":2440055,"avatar_url":"https://avatars.githubusercontent.com/u/2440055?v=3","gravatar_id":"","url":"https://api.github.com/users/willrogers","html_url":"https://github.com/willrogers","followers_url":"https://api.github.com/users/willrogers/followers","following_url":"https://api.github.com/users/willrogers/following{/other_user}","gists_url":"https://api.github.com/users/willrogers/gists{/gist_id}","starred_url":"https://api.github.com/users/willrogers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willrogers/subscriptions","organizations_url":"https://api.github.com/users/willrogers/orgs","repos_url":"https://api.github.com/users/willrogers/repos","events_url":"https://api.github.com/users/willrogers/events{/privacy}","received_events_url":"https://api.github.com/users/willrogers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/milestones/34","html_url":"https://github.com/ControlSystemStudio/cs-studio/milestones/4.3.0%20-%20testing%20(master)","labels_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/milestones/34/labels","id":1415911,"number":34,"title":"4.3.0 - testing (master)","description":"","creator":{"login":"berryma4","id":854021,"avatar_url":"https://avatars.githubusercontent.com/u/854021?v=3","gravatar_id":"","url":"https://api.github.com/users/berryma4","html_url":"https://github.com/berryma4","followers_url":"https://api.github.com/users/berryma4/followers","following_url":"https://api.github.com/users/berryma4/following{/other_user}","gists_url":"https://api.github.com/users/berryma4/gists{/gist_id}","starred_url":"https://api.github.com/users/berryma4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/berryma4/subscriptions","organizations_url":"https://api.github.com/users/berryma4/orgs","repos_url":"https://api.github.com/users/berryma4/repos","events_url":"https://api.github.com/users/berryma4/events{/privacy}","received_events_url":"https://api.github.com/users/berryma4/received_events","type":"User","site_admin":false},"open_issues":21,"closed_issues":40,"state":"open","created_at":"2015-11-17T14:18:52Z","updated_at":"2016-01-26T14:44:09Z","due_on":"2016-06-30T04:00:00Z","closed_at":null},"comments":4,"created_at":"2016-01-15T15:38:37Z","updated_at":"2016-01-26T14:47:07Z","closed_at":null,"body":"First-time users of CS-Studio typically go to File | New | OPI File and create an OPI.\r\n\r\nAn OPI editor opens, but the properties view isn't there.  It kind of looks like you can create an OPI, but you really can't.\r\n\r\nThis applies to me too: I often open an OPI file in the editor but then need to manually select the OPI Editor perspective.\r\n\r\nI think OPI editor perspective should be chosen automatically if you open an OPI file in the editor."},"comment":{"url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/comments/175054659","html_url":"https://github.com/ControlSystemStudio/cs-studio/issues/1568#issuecomment-175054659","issue_url":"https://api.github.com/repos/ControlSystemStudio/cs-studio/issues/1568","id":175054659,"user":{"login":"kasemir","id":1932421,"avatar_url":"https://avatars.githubusercontent.com/u/1932421?v=3","gravatar_id":"","url":"https://api.github.com/users/kasemir","html_url":"https://github.com/kasemir","followers_url":"https://api.github.com/users/kasemir/followers","following_url":"https://api.github.com/users/kasemir/following{/other_user}","gists_url":"https://api.github.com/users/kasemir/gists{/gist_id}","starred_url":"https://api.github.com/users/kasemir/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kasemir/subscriptions","organizations_url":"https://api.github.com/users/kasemir/orgs","repos_url":"https://api.github.com/users/kasemir/repos","events_url":"https://api.github.com/users/kasemir/events{/privacy}","received_events_url":"https://api.github.com/users/kasemir/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T14:47:06Z","updated_at":"2016-01-26T14:47:06Z","body":"Well, trying to guess which perspective the user needs is difficult..\r\n\r\nStill, this is for the editor, so people who simply execute existing displays won't be affected, only those who really need to edit displays. I can't think of a place other than the editor's init(). Maybe do this:\r\n```\r\n .. init(..)\r\n{\r\n  IPerspectiveDescriptor persp =\r\n        PlatformUI.getWorkbench().getActiveWorkbenchWindow()\r\n                         .getActivePage().getPerspective();\r\n  if (! persp.getId().equals(\"..opi editor perspective ID\"))\r\n  {\r\n      .. dialog \"Do you want to switch to the OPI editor perspective\" ..\r\n```\r\n\r\nThat way, those who do want to edit will get the prompt.\r\nOn startup, if you had the editor open on shutdown, that was very likely in the OPI editor perspective, so you won't be bothered with another dialog.\r\n"}}