| Summary: | provide a delegated UI mechanism for Shell page plug-ins | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Grant Gayed <grant_gayed> |
| Component: | Client | Assignee: | Grant Gayed <grant_gayed> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 3.0 | ||
| Target Milestone: | 3.0 M1 | ||
| Hardware: | PC | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Grant Gayed
A first implementation of this is released > 20130307, commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=fe2eb76796b90fd164fbdfb2bf0c12ce6d459bd6 . It uses an identical approach to the orion.edit.command delegated UI, which is described in https://orion.eclipse.org/help/index.jsp?topic=%2Forg.eclipse.orion.doc.isv%2FWikiDoc%2FOrion%2FDocumentation%2FDeveloper_Guide%2FPlugging_into_the_editor%2Forion-edit-command.html&cp=0_0_6_1 . A Shell command that needs a delegated UI should return an Orion Deferred as its result, and then some time later send a "progress" on that deferred whose object has the uriTemplate:/width:/height: values. Example: {the command} callback: function(args) { var result = new orion.Deferred(); var url = window.location.href; url = url.substring(0, url.lastIndexOf('/')); //$NON-NLS-0$ setTimeout(function() { result.progress({uriTemplate: url + "/authenticationPrompter.html", width: "400px", height: "100px"}); }); return result; } {authenticationPrompter.html} <head> <script> function doit() { var result = "Authenticated user: " + document.getElementById("username").value; window.parent.postMessage(JSON.stringify({pageService: "orion.page.delegatedUI", source: "login", result: result}), "*"); return true; } </script> </head> <body> User name:<input type="text" id="username"><br> Password:<input type="password" id="password"> <button type="button" onclick="doit();" value="Submit">Submit</button> </body> Closing report as fixed, will log subsequent bugs for revisions to this as appropriate. |