Skip to main content



      Home
Home » Language IDEs » ServerTools (WTP) » Structured Source Editor example?
Structured Source Editor example? [message #70832] Tue, 01 February 2005 10:43 Go to next message
Eclipse UserFriend
Originally posted by: esnible.acm.org

Where can I find an example of putting a Structured Source Editor in a
multi-page editor? Currently I'm using my own editor that subclasses
AbstractTextEditor as one of the pages. I'd like to replace that with the
structured editor.
Re: Structured Source Editor example? [message #70888 is a reply to message #70832] Tue, 01 February 2005 12:02 Go to previous message
Eclipse UserFriend
Ed Snible wrote:
> Where can I find an example of putting a Structured Source Editor in a
> multi-page editor? Currently I'm using my own editor that subclasses
> AbstractTextEditor as one of the pages. I'd like to replace that with
> the structured editor.
>

The HTML example editor combines a Preview page with the source
editor as a Source page. It can be pulled out of Web Tools' CVS from
wst/components/html/examples/org.eclipse.wst.html.ui.example s.editors.
It is currently not built for download.

You can readily replace your instantiation of AbstractTextEditor
with org.eclipse.wst.html.ui.StructuredTextEditorHTML (or even its
superclass) in most cases and just keep going. The biggest
restriction right now is that the document in the editor must be an
org.eclipse.wst.sse.core.text. IStructuredDocument. Currently, this
works as-is for inputs who's content-types are among the
SSE-provided content types. We register an IDocumentFactory for
each of those content types to ensure that the document instance
satisfies the IStructuredDocument requirement. This also means that
if an IDocumentProvider is registered for a content type, there's a
chance things will go wrong (PHPeclipse's DTD editor being present
comes to mind) since it can create its own IDocument instance.

A lot of the time you won't have to do any additional setup beyond
telling the StructuredTextEditor what your top-level IEditorPart is.
I'd strongly recommend you forward any .getAdapter() requests you
don't plan to implement in your IEditorPart to the
StructuredTextEditor instance. This will get you the Outline view,
Property sheet, and more for free.

--
- Nitin
Previous Topic:JSP contentType Page Directive
Next Topic:iBM.zip
Goto Forum:
  


Current Time: Sun Jul 13 10:34:08 EDT 2025

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

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

Back to the top