Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools Project (WTP) » Attaching standard XML outline view to custom editor
Attaching standard XML outline view to custom editor [message #211010] Tue, 25 March 2008 23:16 Go to next message
Gerrit  is currently offline Gerrit
Messages: 30
Registered: July 2009
Member
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 15:23 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2315
Registered: July 2009
Senior Member
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


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Attaching standard XML outline view to custom editor [message #211217 is a reply to message #211186] Fri, 28 March 2008 02:30 Go to previous messageGo to next message
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 #211300 is a reply to message #211217] Fri, 28 March 2008 18:34 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2315
Registered: July 2009
Senior Member
David Whiteman wrote:
> 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.

Do you mean the view wasn't open or that it was visible but empty
initially?

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


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Attaching standard XML outline view to custom editor [message #211324 is a reply to message #211300] Sat, 29 March 2008 12:06 Go to previous messageGo to next message
Eclipse User
Originally posted by: david_whiteman.us.ibm.com

Nitin Dahyabhai wrote:
> David Whiteman wrote:
>> 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.
>
> Do you mean the view wasn't open or that it was visible but empty
> initially?
>

Sorry, the latter. The view was visible but empty.
Re: Attaching standard XML outline view to custom editor [message #211399 is a reply to message #211324] Tue, 01 April 2008 13:13 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2315
Registered: July 2009
Senior Member
David Whiteman wrote:
> Nitin Dahyabhai wrote:
>> Do you mean the view wasn't open or that it was visible but empty
>> initially?
> Sorry, the latter. The view was visible but empty.

Could you post the code you're using to create and set the input on
the outline page? I've never seen that behavior before.

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


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Attaching standard XML outline view to custom editor [message #211434 is a reply to message #211399] Tue, 01 April 2008 14:17 Go to previous messageGo to next message
Eclipse User
Originally posted by: david_whiteman.us.ibm.com

Nitin Dahyabhai wrote:
> David Whiteman wrote:
>> Nitin Dahyabhai wrote:
>>> Do you mean the view wasn't open or that it was visible but empty
>>> initially?
>> Sorry, the latter. The view was visible but empty.
>
> Could you post the code you're using to create and set the input on the
> outline page? I've never seen that behavior before.
>

I actually don't have any code for that. I have a subclass of
StructuredTextEditor, and am relying on the inherited behavior from the
adapter retrival method.

David
Re: Attaching standard XML outline view to custom editor [message #211517 is a reply to message #211434] Wed, 02 April 2008 03:41 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2315
Registered: July 2009
Senior Member
David Whiteman wrote:
> Nitin Dahyabhai wrote:
>> David Whiteman wrote:
>>> Nitin Dahyabhai wrote:
>>>> Do you mean the view wasn't open or that it was visible but empty
>>>> initially?
>>> Sorry, the latter. The view was visible but empty.
>>
>> Could you post the code you're using to create and set the input on
>> the outline page? I've never seen that behavior before.
>>
>
> I actually don't have any code for that. I have a subclass of
> StructuredTextEditor, and am relying on the inherited behavior from the
> adapter retrival method.

Were you returning that adapter regardless of which editor page you
were showing when opening your editor?

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


---
Nitin Dahyabhai
Eclipse WTP, IBM
Re: Attaching standard XML outline view to custom editor [message #211812 is a reply to message #211517] Fri, 04 April 2008 16:35 Go to previous messageGo to next message
Eclipse User
Originally posted by: david_whiteman.us.ibm.com

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.
Re: Attaching standard XML outline view to custom editor [message #211861 is a reply to message #211812] Sat, 05 April 2008 23:21 Go to previous message
Nitin Dahyabhai is currently offline Nitin Dahyabhai
Messages: 2315
Registered: July 2009
Senior Member
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


---
Nitin Dahyabhai
Eclipse WTP, IBM
Previous Topic:JBoss and WTP
Next Topic:Re: dreamwaver
Goto Forum:
  


Current Time: Sat Nov 01 09:56:19 GMT 2014

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

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