| Summary: | Allow content assist plugins to provide styling for proposals | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Andrew Eisenberg <andrew.eisenberg> |
| Component: | Editor | Assignee: | Project Inbox <orion.editor-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | antonm, mamacdon, Silenio_Quarti, simon_kaegi, susan |
| Version: | 0.5 | ||
| Target Milestone: | 1.0 M2 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | |||
|
Description
Andrew Eisenberg
(In reply to comment #0) > Any comments or suggestions of better ways to go? Great summary of the possibilities. In the past, we've been very reticent to do #1 and #2 for security reasons. Simon can comment further, he has been very strongly conservative on this. I'm not clear on proposal #3 how the class names would get defined. Would the plugin have to presume to use classes Orion already knows about? If so then that's not really better than #4. I like the idea of #4 but along with having semantic names for the kinds of styles, we could potentially expose those styles in the editor themes, so that end users would have some amount of control over how these proposals appeared. cc'ing Simon and Anton, they might have thoughts on this... Thanks for the feedback, Susan. One of the things that I wanted to do was to apply different styles to different parts of the proposal. In the Java editor in Eclipse you can see that the declaring type is styled differently from the method/field name (for example). This feature is less important to me, but going with #3 or #4 would not allow selective styling (and I agree that #3 and #4 are really the same thing). As a first pass, I will hard-code a few content assist style classes. And then we can think about selective styling. Andrew, you probably already know this, but there is a similar concept in the outliner, where an outliner can give class info (but it just applies to the entire item). http://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Plugging_into_the_editor#orion.edit.outliner Commit is pushed. Here is link: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=58cfe48e3a97134204d7daddf9a89f6029587a6d In the end, I went with the following styles: hr : not really a style, but designates that the proposal should be displayed as a <hr/> in the panel. hr proposals cannot be selected using the up/down arrow keys. emphasis : display the proposal in bold noemphasis : displays proposal in grey with a colored background dfault : non-specified style. Using dfault to avoid using a JS keyword These styles correspond to new css classes in ide.css named proposal-hr, proposal-emphasis, proposal-noemphasis, proposal-default respectively. Now, if you want to add a styling to your proposal object, simply do: proposal.style = emphasis I am happy to change any of the existing styles or add new ones as needed. I will update the docs to include the new changes here: http://wiki.eclipse.org/Orion/Documentation/Developer_Guide/Plugging_into_the_editor#orion.edit.contentAssist |