Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Embedding XMLEditor in multipageditor(question about xmleditor - structuredtexteditor)
Embedding XMLEditor in multipageditor [message #499497] Mon, 23 November 2009 02:35 Go to next message
Max is currently offline MaxFriend
Messages: 2
Registered: November 2009
Junior Member
Hi all,
I'm trying to create a multipageeditor with a page that contains a text xml. So I'd like to use the Xml editor that it is present in WST. I read the tutorial http://www.eclipse.org/webtools/wst/components/sse/tutorials /multipage-editor-tutorial.html but I don't manage to do that .
In particular I follow al the tutorial but when I launch an eclipse application Eclipse says that there isn't the cntent-type associated.
Thank you for any help

[Updated on: Tue, 24 November 2009 15:42]

Report message to a moderator

Re: Embedding XMLEditor in multipageditor [message #501033 is a reply to message #499497] Mon, 30 November 2009 18:19 Go to previous messageGo to next message
David Carver is currently offline David CarverFriend
Messages: 174
Registered: July 2009
Senior Member
Did you define your content-type, or add it to the existing xml content-type?
Re: Embedding XMLEditor in multipageditor [message #501104 is a reply to message #499497] Tue, 01 December 2009 04:24 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 2332
Registered: July 2009
Senior Member
Massi wrote:
> Hi all,
> I'm trying to create a multipageeditor with a page that contains a text
> xml. So I'd like to use the Xml editor that is present in WST. I read
> the tutorial
> http://www.eclipse.org/webtools/wst/components/sse/tutorials /multipage-editor-tutorial.html
> but I don't understand a thing : -Is it sufficient override the
> createSite method to have a page with all the features of the xml
> editor(highlighting, content assist, source validation), or I have to
> insert those features as extensions point in the plugin.xml?

Let's get back to basics: the wizard that the tutorial has you run
starts out by creating a multi-page editor with a plain text editor
for the source page. The next step is just switching the class for
the source page from TextEditor to the StructuredTextEditor from the
org.eclipse.wst.sse.ui plug-in. With content types provided in WTP,
a large amount of functionality works just from doing that. The
editor site comes into play in order to make sure the UI is using
the right IDs for loading actions and other contributions by the
platform's extension points.

There are other extension points defined in org.eclipse.wst.sse.ui,
but most of those will automatically be picked up by the
StructuredTextEditor instance at runtime. For example, if you're
editing an XML file, just by using the StructuredTextEditor class,
it'll know to use XML as the language to syntax color, validate, and
for which to provide content assist and outline support. Unless you
want to modify any of that behavior, you're fine ignoring these last
extension points when you're starting out.

--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Embedding XMLEditor in multipageditor [message #501379 is a reply to message #501104] Wed, 02 December 2009 01:53 Go to previous message
Max is currently offline MaxFriend
Messages: 2
Registered: November 2009
Junior Member
Thank you very much Nitin!
I managed to do what I wanted to do.
I created a new multipageeditor with an extension ".xxx" and then I did 3 things :
1)TextEditor-->StructuredTextEditor
2)I added in the plugin.xml
<extension
point="org.eclipse.core.contenttype.contentTypes">
<file-association
content-type="org.eclipse.core.runtime.xml"
file-extensions="xxx"
>
</file-association>
</extension>
3) I put "true" to the editor property default
So I reached to have a multipageeditor with a page that contains the xml source with all the features of the xml editor of wst
Previous Topic:Bug with links containing "&amp;"?
Next Topic:can't run sql query from war
Goto Forum:
  


Current Time: Sun Nov 23 08:42:21 GMT 2014

Powered by FUDForum. Page generated in 0.01780 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software