New file extension for Web Tools xml editor [message #736094] |
Thu, 13 October 2011 15:03 |
batorpiotr Messages: 3 Registered: October 2011 |
Junior Member |
|
|
Hi all,
I want to associate Web Tools XML editor with new file extension. I'm trying do it this way:
<!--The org.eclipse.wst.xml.core.xmlsource content type is only for
handling some special cases of ill-formed xml in a reasonable
manner, and should not be emulated by clients. The two content
types are often used interchangeably by the XML component, but
please use org.eclipse.core.runtime.xml instead. -->
<extension point="org.eclipse.wst.sse.ui.editorConfiguration">
<sourceViewerConfiguration
class="org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML"
target="hadesclipse.editor.hml" />
<contentOutlineConfiguration
class="org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration"
target="hadesclipse.editor.hml" />
<quickOutlineConfiguration
class="org.eclipse.wst.xml.ui.internal.quickoutline.XMLQuickOutlineConfiguration"
target="hadesclipse.editor.hml" />
<propertySheetConfiguration
class="org.eclipse.wst.xml.ui.views.properties.XMLPropertySheetConfiguration"
target="hadesclipse.editor.hml" />
<documentationTextHover
class="org.eclipse.wst.xml.ui.internal.taginfo.XMLTagInfoHoverProcessor"
target="hadesclipse.editor.hml">
</documentationTextHover>
<doubleClickStrategy
class="org.eclipse.wst.xml.ui.internal.doubleclick.XMLDoubleClickStrategy"
target="hadesclipse.editor.hml">
</doubleClickStrategy>
<provisionalConfiguration
type="sourceeditingtexttools"
class="org.eclipse.wst.xml.ui.internal.provisional.XMLSourceEditingTextTools"
target="hadesclipse.editor.hml" />
<provisionalConfiguration
type="characterpairmatcher"
class="org.eclipse.wst.xml.ui.internal.text.XMLDocumentRegionEdgeMatcher"
target="hadesclipse.editor.hml" />
<provisionalConfiguration
type="foldingstrategy"
class="org.eclipse.wst.xml.ui.internal.projection.XMLFoldingStrategy"
target="hadesclipse.editor.hml" />
<provisionalConfiguration
type="org.eclipse.jface.text.quickassist.IQuickAssistProcessor"
class="org.eclipse.wst.xml.ui.internal.correction.XMLQuickAssistProcessor"
target="hadesclipse.editor.hml" />
<provisionalConfiguration
type="autoeditstrategy"
class="org.eclipse.wst.xml.ui.internal.autoedit.StructuredAutoEditStrategyXML"
target="hadesclipse.editor.hml" />
<provisionalDefinition
type="preferencepages"
value="org.eclipse.wst.xml.ui.preferences.xml.xml, org.eclipse.wst.sse.ui.preferences.xml.source, org.eclipse.wst.sse.ui.preferences.xml.templates, org.eclipse.wst.sse.ui.preferences.xml.colors, org.eclipse.wst.sse.ui.preferences.xml.contentassist"
target="hadesclipse.editor.hml" />
<provisionalDefinition
type="spellingregions"
value="XML_COMMENT_TEXT, XML_CONTENT, XML_DEFAULT"
target="hadesclipse.editor.hml" />
<provisionalDefinition
type="activecontexts"
value="org.eclipse.core.runtime.xml, org.eclipse.wst.xml.navigation, org.eclipse.wst.xml.cleanup, org.eclipse.wst.xml.selection, org.eclipse.wst.xml.dependencies, org.eclipse.wst.xml.grammar, org.eclipse.wst.xml.expand, org.eclipse.wst.xml.occurrences, org.eclipse.wst.sse.comments"
target="hadesclipse.editor.hml" />
</extension>
<extension
point="org.eclipse.ui.editors">
<editor
contributorClass="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorActionBarContributor"
class="org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart"
icon="icons/sample.gif"
id="hadesclipse.editors.HMLEditor"
name="HMLEditor">
<contentTypeBinding
contentTypeId="hadesclipse.editor.hml"/>
</editor>
</extension>
<!-- HML model content type -->
<extension point="org.eclipse.core.contenttype.contentTypes">
<content-type id="hadesclipse.editor.hml"
base-type="org.eclipse.core.runtime.xml"
name="HML model"
file-extensions="hml"
priority="high">
</content-type>
</extension>
Syntax Colouring, formatting and code folding works, but i have no idea why code completion does not works.When I'm pressing ctrl+spacebar in the left bootom corner shows "No completions avaible". Shoud I add something to plugin.xml ?
please help.
|
|
|
Re: New file extension for Web Tools xml editor [message #736118 is a reply to message #736094] |
Thu, 13 October 2011 15:53 |
|
Is the root issue being able to open the XML Editor on your own filename extension? If so, and those files are valid XML, you can just add a new file-association, or content type whose base type is XML, using the org.eclipse.core.contenttype.contentTypes extension point.
_
Nitin Dahyabhai
Eclipse Web Tools Platform
|
|
|
Re: New file extension for Web Tools xml editor [message #736156 is a reply to message #736118] |
Thu, 13 October 2011 17:23 |
batorpiotr Messages: 3 Registered: October 2011 |
Junior Member |
|
|
Nitin Dahyabhai wrote on Thu, 13 October 2011 11:53... you can just add a new file-association, or content type whose base type is XML, using the org.eclipse.core.contenttype.contentTypes extension point.
I think I'm doing this:
...
<!-- HML model content type -->
<extension point="org.eclipse.core.contenttype.contentTypes">
<content-type id="hadesclipse.editor.hml"
base-type="org.eclipse.core.runtime.xml"
name="HML model"
file-extensions="hml"
priority="high">
</content-type>
</extension>
and editor is associated with *.hml files, but code assistance don't work
[Updated on: Thu, 13 October 2011 17:40] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03803 seconds