Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] onInputChange: how are file types decided?

Is it platform code, or a pluggable service? Either way, we definitely don't want multiple copies of that code floating around.

McQ.

Inactive hide details for "John J. Barton" ---2011/06/09 11:48:27---I accidentally stumbled on the answer in examples/editor/em"John J. Barton" ---2011/06/09 11:48:27---I accidentally stumbled on the answer in examples/editor/embeddededitor:


From:

"John J. Barton" <johnjbarton@xxxxxxxxxxxxxxx>

To:

Orion developer discussions <orion-dev@xxxxxxxxxxx>

Date:

2011/06/09 11:48

Subject:

Re: [orion-dev] onInputChange: how are file types decided?




I accidentally stumbled on the answer in examples/editor/embeddededitor:

if (fileName) {
                var splits = fileName.split(".");
                var extension = splits.pop().toLowerCase();
                if (splits.length > 0) {
                    switch(extension) {
                        case "js":
                            this.styler = new
examples.textview.TextStyler(editorWidget, "js");
                            break;
                        case "java":
                            this.styler = new
examples.textview.TextStyler(editorWidget, "java");
                            break;
                        case "css":
                            this.styler = new
examples.textview.TextStyler(editorWidget, "css");
                            break;
                        case "html":
                            this.styler = new
orion.editor.TextMateStyler(editorWidget, orion.editor.HtmlGrammar.grammar);
                            break;
                    }
                }
            }

This should be a platform call so we call get the same answer and don't
dupe code.

jjb
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev


GIF image

GIF image


Back to the top