| Summary: | Issue with the editor service "orion.navigate.openWith" | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Pradyut Sarma <pradyutksarma> |
| Component: | Client | Assignee: | Project Inbox <orion.client-inbox> |
| Status: | CLOSED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mamacdon |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
The problem with this service is that it combines two things: 1) Registering new editors 2) Associating editors with file types You are just attempting to do 2). You are not trying to define a new editor. I think the "openWith" service should just do 2), and it would associate file types with some symbolic editor id. The current approach of using a hard-coded href to the editor location is problematic because another Orion server may want to put the edit.html code in another location. Then, another service (perhaps "orion.navigate.editor") would be used to declare editor types, but without specifying which file types it works on. It would essentially just establish a mapping of editorId -> editorHref. Hi John, I guess your proposal of introducing a new service to register an editor and another one to register a file type to it is definitely more scalable. This also leaves the door open for me to contribute editors that are NOT JUST code editors, but something else ;) Thanks and Regards, Pradyut. > The problem with this service is that it combines two things: > 1) Registering new editors > 2) Associating editors with file types (In reply to comment #1) Bug 364481 has fixed this. (1) and (2) are now separate concepts. You register with the "orion.edit.editor" service to do (1), and the "orion.navigate.openWith" service to do (2). There's also a third service, (3) "orion.file.contentType" for telling Orion about a brand new type of file. The combination of services can be used to associate a file type with an editor. See webEditingPlugin.html in the Orion source code for an example. I believe this covers the use cases Pradyut mentioned in Comment 2. *** This bug has been marked as a duplicate of bug 364481 *** |
Build Identifier: M8 With M8, Orion allows us to contribute new editor types (or should I say file types) to the Orion editor. I was trying to contribute to the same for a file type ".mtd" which is a custom file type for an internal implementation. The way I have contributed it is shown below, <script type="text/javascript"> window.onload = function() { var provider = new eclipse.PluginProvider(); var ps = provider.registerServiceProvider ("orion.navigate.openWith", {}, { name: "MTD Editor", href: "/edit/edit.html#${Location}", validationProperties: {Name: "*.(mtd)"} }); provider.connect(); }; </script> My issue here is, why is the parameter "href" in the above contribution i.e. "href: "/edit/edit.html#${Location}"," necessary or compulsory in the above contribution. This is because, I would expect that the orion editor be reused for rendering my file type. This would be the same for any file type which would want to reuse the orion code editor....wouldn't it? Even the location can be identified by the selection/click on the Navigator. That parameter probably would be necessary only if I want to contribute some other kind of editor that does more than just code/text editing. But in that case, it still shouldn't be a compulsory parameter for contribution. P.S: It definitely, is not a bug. Please transfer it to the relevant category ;-) Thanks and Regards, Pradyut. Reproducible: Always Steps to Reproduce: Check "Details" Section.