new Javascript editor [message #697896] |
Mon, 18 July 2011 05:55  |
Eclipse User |
|
|
|
Have created a new plugin project in which trying to create a JavaScript editor. In plugin.xml have specified
<extension
point="org.eclipse.ui.editors">
<editor
class="com.eclipse.ide.sourceeditors.NewCSSStructuredTextEditor"
default="false"
extensions="css"
id="com.eclipse.ide.editor1"
name="New CSS Editor">
</editor>
<editor
class="com.eclipse.ide.sourceeditors.NewJavaScriptStructuredTextEditor"
default="false"
extensions="js"
id="com.eclipse.ide.editor3"
name="New JavaScript Editor">
</editor>
</extension>
and NewCSSStructuredTextEditor and NewJavaScriptStructuredTextEditor extends StructuredTextEditor. when I launch another instance of eclipse I can open CSS files with New CSS Editor and code completion works fine.
but when tried to open a JS page with New JavaScript Editor getting an error as
"Unsupported content type in editor
To associate file extension with a supported content type,
please see content type prefernce page"
also getting the errors on console as:
!ENTRY org.eclipse.wst.sse.ui 2 2 2011-07-18 15:13:30.520
!MESSAGE StructuredTextEditor being used without StructuredDocument
!ENTRY org.eclipse.wst.sse.ui 2 2 2011-07-18 15:13:30.520
!MESSAGE Input Name: new.js
!ENTRY org.eclipse.wst.sse.ui 2 2 2011-07-18 15:13:30.520
!MESSAGE Unexpected IDocument implementation: org.eclipse.core.internal.filebuffers.SynchronizableDocument
IDocumentProvider implementation: org.eclipse.ui.editors.text.TextFileDocumentProvider
How to solve this???
[Updated on: Tue, 26 July 2011 03:44] by Moderator
|
|
|
Re: new Javascript editor [message #698283 is a reply to message #697896] |
Tue, 19 July 2011 04:00   |
Eclipse User |
|
|
|
There's not much to "solve" here. A number of classes (parser, reparser, model loader, adapter factory provider, viewer configurations, etc.) have to be authored for languages WTP supports through the StructuredTextEditor, and no such implementation is provided for JavaScript. The messages you're seeing indicate that the JavaScript content type isn't one of the languages supported through the StructuredTextEditor. While it's not impossible to create such classes, the existing JavaScript support in WTP has more in common with the Java plug-ins provided in the Eclipse project than the editors built on SSE.
What is it that you're trying to do that requires subclassing StructuredTextEditor? For the most part we discourage doing so except for very specific scenarios where the input to the editor, either due to timing issues or other corner cases, can't be used to alter its behavior in the way desired. If you're just reusing the editors, you don't have to subclass them. If you're trying to inject your own template proposals from your own template context, you really want to approach it by contributing content assist computers (with the org.eclipse.wst.sse.ui.completionProposal extension point) rather than entire editors.
|
|
|
|
|
|
|
|
|
|
Re: new Javascript editor [message #766053 is a reply to message #758392] |
Thu, 15 December 2011 01:25  |
Eclipse User |
|
|
|
Hi,
Using extension point "org.eclipse.ui.editors.templates" have added template view to my editor where templates have few new ContextType like html and JS. have added contextTypes using AbstractJavaContextType. I could see the templates sorted according to the context types.
Now the problem is adding new template, edit the template and remove template options are not working. after some investigation found that
getTemplateStore().save(); or getTemplateStore().delete(..); getTemplateStore().add(..);
are not working. where as getTemplateStore() returns the correct set of templates which i have inserted.
what could be the reason for this?? how can I solve this??
waiting for reply,
Sulakshana
|
|
|
Powered by
FUDForum. Page generated in 0.04311 seconds