Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Add XML outline to DSL IDE(How to add and dispatch one more outline view)
Add XML outline to DSL IDE [message #1705822] Wed, 19 August 2015 11:23 Go to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Hello

I have DSL IDE generated by xtext 2.8.4. It works OK. Due to different reason I have to implement a few editors for different kind of file. I've easy added XML editor with syntax coloring. Also I need to outline view for XML. If I not mistake I have to implement something like this
public class XMLOutlineTreeProvider implements IOutlineTreeStructureProvider, IOutlineTreeProvider, IOutlineTreeProvider.Cancelable {}


I'm sure that there is ready to use implementation for this task, but I could find it. The next question I could not find out how register my implementaion in XText core

Any advises appreciated

Thanks
Alex
Re: Add XML outline to DSL IDE [message #1705823 is a reply to message #1705822] Wed, 19 August 2015 11:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
i am not sure if i understand your question. is this an add or an replace

xtext does the following

	// contributed by org.eclipse.xtext.ui.generator.outline.OutlineTreeProviderFragment
	public Class<? extends org.eclipse.xtext.ui.editor.outline.IOutlineTreeProvider> bindIOutlineTreeProvider() {
		return org.eclipse.xtext.example.domainmodel.ui.outline.DomainmodelOutlineTreeProvider.class;
	}

	// contributed by org.eclipse.xtext.ui.generator.outline.OutlineTreeProviderFragment
	public Class<? extends org.eclipse.xtext.ui.editor.outline.impl.IOutlineTreeStructureProvider> bindIOutlineTreeStructureProvider() {
		return org.eclipse.xtext.example.domainmodel.ui.outline.DomainmodelOutlineTreeProvider.class;
	}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Add XML outline to DSL IDE [message #1705827 is a reply to message #1705823] Wed, 19 August 2015 11:42 Go to previous messageGo to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Hello Christian

I see your point. From this code is clear that we have only one outline provider. Am I right? I cannot bind several and manage its depend on file extension. Am I right?
Re: Add XML outline to DSL IDE [message #1705829 is a reply to message #1705827] Wed, 19 August 2015 11:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
i think you Need multiple outline pages (ContentOutlinePage) then. i dont know if you can have more than one in eclipse

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Add XML outline to DSL IDE [message #1705837 is a reply to message #1705829] Wed, 19 August 2015 12:19 Go to previous messageGo to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Also Eclipse itself has XML outline view. Can I reuse this view in xtext project?
Re: Add XML outline to DSL IDE [message #1705847 is a reply to message #1705837] Wed, 19 August 2015 13:01 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
i cannot answer this.
that is an XML Outline view?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Add XML outline to DSL IDE [message #1705852 is a reply to message #1705847] Wed, 19 August 2015 13:26 Go to previous messageGo to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
if we load xml file in an Eclipse IDE (Java IDE or Eclipse DSL tools for example). We can see outline view for this file
Re: Add XML outline to DSL IDE [message #1705853 is a reply to message #1705852] Wed, 19 August 2015 13:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
but i do not understand what that has to do with xtext. or do you want to drop the xtext outline page completely?

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Add XML outline to DSL IDE [message #1705854 is a reply to message #1705853] Wed, 19 August 2015 13:33 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
p.s.

the outline page is bound as follows

	public Class<? extends IContentOutlinePage> bindIContentOutlinePage() {
		return OutlinePage.class;
	}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Add XML outline to DSL IDE [message #1705860 is a reply to message #1705853] Wed, 19 August 2015 14:01 Go to previous messageGo to next message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Christian Dietrich wrote on Wed, 19 August 2015 13:28
but i do not understand what that has to do with xtext. or do you want to drop the xtext outline page completely?


No I don't drop the xtext outline page. I would like to add the following :

If user open DSL file, he/she sees xtext outline page generated by xtext
if user open XML file. he/she sees xml outline page implemented by me

Re: Add XML outline to DSL IDE [message #1705862 is a reply to message #1705860] Wed, 19 August 2015 14:26 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
hi,

so the questio is Zero related to xtext?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Add XML outline to DSL IDE [message #1705863 is a reply to message #1705862] Wed, 19 August 2015 14:30 Go to previous message
Alex Gor is currently offline Alex GorFriend
Messages: 159
Registered: November 2014
Location: Russia
Senior Member
Christian Dietrich wrote on Wed, 19 August 2015 14:26
hi,

so the questio is Zero related to xtext?


yes



Previous Topic:How to get storable resources to work?
Next Topic:Xbase Expressions supporting xtend extension feature call scoping
Goto Forum:
  


Current Time: Tue Mar 19 04:20:04 GMT 2024

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

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

Back to the top