Attaching standard XML outline view to custom editor [message #211010] |
Tue, 25 March 2008 19:16  |
Eclipse User |
|
|
|
Hi, everyone.
I would like to attach the standard XML outline view of the WST project to
a graphical custom editor for XML files.
How can I return an XML outline page in getAdapter() without subclassing
or using XMLMultiPageEditorPart or the embedded StructuredTextEditor? The
actual outline pages that are created seem to be of the type
ConfigurableContentOutlinePage (configured with
StructuredTextViewerConfigurationXML) which have restricted access. Can I
somehow use these without the SSE editors?
I found the thread "hooking up xml outline view to custom xml
contentType", but the given examples all use or subclass
XMLMultiPageEditorPart. Apart from that, I couldn't find much information
about SSE customization on the newsgroups. If there is more general
documentation available, please point me to it.
Thanks,
Gerrit
|
|
|
Re: Attaching standard XML outline view to custom editor [message #211186 is a reply to message #211010] |
Thu, 27 March 2008 11:23   |
Eclipse User |
|
|
|
Gerrit wrote:
> I would like to attach the standard XML outline view of the WST project
> to a graphical custom editor for XML files.
>
> How can I return an XML outline page in getAdapter() without subclassing
> or using XMLMultiPageEditorPart or the embedded StructuredTextEditor?
> The actual outline pages that are created seem to be of the type
> ConfigurableContentOutlinePage (configured with
> StructuredTextViewerConfigurationXML) which have restricted access. Can
> I somehow use these without the SSE editors?
Yes, the page class, while in an internal, non-API,
we-could-change-this-at-any-time package, is public, and the
XMLContentOutlineConfiguration class we use is itself API. The
StructuredTextEditor.getAdapter(Class) method shows how the page is
constructed, and as long as the model going in is an IDOMModel, the
outline page doesn't care what editor is using it (or, for the most
part, if an editor is using it). If you mean to use it with another
W3C XML DOM implementation, that's not supported.
> I found the thread "hooking up xml outline view to custom xml
> contentType", but the given examples all use or subclass
> XMLMultiPageEditorPart. Apart from that, I couldn't find much
> information about SSE customization on the newsgroups. If there is more
> general documentation available, please point me to it.
The general documentation exists at
http://www.eclipse.org/webtools/sse/ and in EclipseCon presentations
such as at http://www.eclipsecon.org/2008/?page=sub/&id=280 .
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
|
|
|
Re: Attaching standard XML outline view to custom editor [message #211217 is a reply to message #211186] |
Thu, 27 March 2008 22:30   |
Eclipse User |
|
|
|
Originally posted by: david_whiteman.us.ibm.com
Nitin Dahyabhai wrote:
> Gerrit wrote:
>> I would like to attach the standard XML outline view of the WST
>> project to a graphical custom editor for XML files.
>>
>> How can I return an XML outline page in getAdapter() without
>> subclassing or using XMLMultiPageEditorPart or the embedded
>> StructuredTextEditor? The actual outline pages that are created seem
>> to be of the type ConfigurableContentOutlinePage (configured with
>> StructuredTextViewerConfigurationXML) which have restricted access.
>> Can I somehow use these without the SSE editors?
>
> Yes, the page class, while in an internal, non-API,
> we-could-change-this-at-any-time package, is public, and the
> XMLContentOutlineConfiguration class we use is itself API. The
> StructuredTextEditor.getAdapter(Class) method shows how the page is
> constructed, and as long as the model going in is an IDOMModel, the
> outline page doesn't care what editor is using it (or, for the most
> part, if an editor is using it). If you mean to use it with another W3C
> XML DOM implementation, that's not supported.
>
>> I found the thread "hooking up xml outline view to custom xml
>> contentType", but the given examples all use or subclass
>> XMLMultiPageEditorPart. Apart from that, I couldn't find much
>> information about SSE customization on the newsgroups. If there is
>> more general documentation available, please point me to it.
>
> The general documentation exists at http://www.eclipse.org/webtools/sse/
> and in EclipseCon presentations such as at
> http://www.eclipsecon.org/2008/?page=sub/&id=280 .
>
> ---
> Nitin Dahyabhai
> Eclipse WTP Source Editing
> IBM Rational
I tried the approach of switching the source tab of my multi-page editor
from a TextEditor to a StructuredTextEditor, and the outline view didn't
show initially, until I clicked on it and then clicked away from it. Is
there a reason that would happen, and is there a way I can force the
outline to display as soon as the editor opens?
My apologies if this is discussed somewhere in the doc, but I suspect
that it describes a more complex approach, and I'm trying to fit it into
my current design.
Thanks,
David
|
|
|
|
|
|
|
|
|
Re: Attaching standard XML outline view to custom editor [message #211861 is a reply to message #211812] |
Sat, 05 April 2008 19:21  |
Eclipse User |
|
|
|
David Whiteman wrote:
> Nitin Dahyabhai wrote:
>> Were you returning that adapter regardless of which editor page you
>> were showing when opening your editor?
>
> I guess. It depends on when that gets called. Since the structured
> text editor is just on one page, I had assumed (without checking) that
> the adapter gets called when the editor page is activated.
No, none of the other parts know about the internals of a multi-page
editor--your editor is effectively asked once. If you want to show
different outlines for each of your pages, you need to manage them
yourself somehow.
--
---
Nitin Dahyabhai
Eclipse WTP Source Editing
IBM Rational
|
|
|
Powered by
FUDForum. Page generated in 0.25963 seconds