Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » about outline view
about outline view [message #1075635] Mon, 29 July 2013 19:43 Go to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
Hi,
I have grammar which only defines one kind of element with one feature-content.

def _createChildren(DocumentRootNode parentNode, LCFGModel lcfgmodel) {
for(Element element: lcfgmodel.getElements()) {
createNode(parentNode, element)
}
}
works good but

def createChildren(IOutlineNode parentNode, Element element) {
createEStructuralFeatureNode(parentNode,element,LCFGPackage.Literals.ELEMENT__CONTENT, null, "abc", false)
}

never be invoked?

Could anyone tell me why this happens?

thanks
Re: about outline view [message #1075638 is a reply to message #1075635] Mon, 29 July 2013 19:48 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi

cause the signature is _createChildren


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1075645 is a reply to message #1075638] Mon, 29 July 2013 20:11 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
no, I used _createChildren but nothing happened.
sorry i copy the wrong one to the forum
Re: about outline view [message #1075651 is a reply to message #1075645] Mon, 29 July 2013 20:28 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi can you can please share a complete grammar and provider?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1075656 is a reply to message #1075651] Mon, 29 July 2013 20:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
P.S.

you may have to customize _isLeaf too


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1075669 is a reply to message #1075656] Mon, 29 July 2013 20:56 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
HI here are the files
Re: about outline view [message #1075801 is a reply to message #1075669] Tue, 30 July 2013 05:09 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
as said before adding a _isleaf for Element and returning false should do the trick

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1076001 is a reply to message #1075801] Tue, 30 July 2013 13:48 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
Thanks Christ.
It works as expected.
BTW, do you have any way to remove the (-) before the lines/?
please see the image attachedindex.php/fa/15774/0/
In my case, each line is recognized as an element(object).
Re: about outline view [message #1076104 is a reply to message #1076001] Tue, 30 July 2013 18:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi,

you have to customize folder to have no folding. (org.eclipse.xtext.ui.editor.folding.IFoldingRegionProvider)


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1076136 is a reply to message #1076104] Tue, 30 July 2013 19:39 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
HI,
So a way to do this is to write a class extends IFoldingRegionProvider and then ...

It seems pretty hard. I guess i'd better give up Very Happy
If I do change the IFoldingRegionProvider, then there would be no line wrapping available. Right?

Thanks Christ
Re: about outline view [message #1076138 is a reply to message #1076136] Tue, 30 July 2013 19:43 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
as i said return nothing, nada, empty collection

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1076188 is a reply to message #1076138] Tue, 30 July 2013 22:39 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
could you show me where could i implement this?
I found the IFoldingRegionProvider, but do not know where to use it and how?

Thanks
Re: about outline view [message #1076290 is a reply to message #1076188] Wed, 31 July 2013 05:38 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Hi,

i dont understand your problem

public class NullFoldingRegionProvider implements IFoldingRegionProvider {

	@Override
	public Collection<FoldedPosition> getFoldingRegions(
			IXtextDocument xtextDocument) {
		return Collections.emptyList();
	}

}


public class MyDslUiModule extends AbstractMyDslUiModule {
	public MyDslUiModule(AbstractUIPlugin plugin) {
		super(plugin);
	}
	
	public Class<? extends IFoldingRegionProvider> bindIFoldingRegionProvider() {
		return NullFoldingRegionProvider.class;
	}
}


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1076455 is a reply to message #1076290] Wed, 31 July 2013 12:22 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
index.php/fa/15789/0/
My problem is i don't know where to put this thing~i mean NullFoldingRegionProvider Crying or Very Sad here is the layout

Thanks

[Updated on: Wed, 31 July 2013 12:24]

Report message to a moderator

Re: about outline view [message #1076459 is a reply to message #1076455] Wed, 31 July 2013 12:29 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
What about right next to the ui module. or in a own subpackage. or even a own plugin project.
you have the choice


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1076552 is a reply to message #1076459] Wed, 31 July 2013 15:13 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
Great Thanks. is it possible to selectively displace the(-)?
like only when the element is a multi-line one.

Thanks
Re: about outline view [message #1076562 is a reply to message #1076552] Wed, 31 July 2013 15:21 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Then you have to implement a provider that does that (have a look at
the default imol)

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1076570 is a reply to message #1076562] Wed, 31 July 2013 15:35 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
Sorry, i don't mean to bother.
But i am quite a new hand to Xtext, and I cannot come up with any clue when you said something like 'default imol'

Crying or Very Sad
Re: about outline view [message #1076573 is a reply to message #1076570] Wed, 31 July 2013 15:37 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Sorry type I meant the default implementation of the interface

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1076592 is a reply to message #1076573] Wed, 31 July 2013 16:05 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
Hi, no worries, that is ok.

BTW, last time you mention to how to create an own project wizard:
fragment = projectWizard.SimpleProjectWizardFragment auto-inject {
generatorProjectName = "${projectName}"
}

I add this to the work flow, but nothing happened. I mean when i launch a new Eclipse, I didn't see option for creating a project of a new type. I found nothing about this part except this:
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.xtext.doc%2Fhelp%2Fprojectwizard.html

but it is not detailed enough.
Could you tell me something about this?

Thanks

[Updated on: Wed, 31 July 2013 16:07]

Report message to a moderator

Re: about outline view [message #1076598 is a reply to message #1076592] Wed, 31 July 2013 16:10 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Merge plugin.XML:_gen to plugin.xml

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1076623 is a reply to message #1076598] Wed, 31 July 2013 16:56 Go to previous messageGo to next message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
HI, Yes i found the new project type under the xtext project.
But when i create a new project, it generates a generator.mwe2 which contains an error at the line:
component = @workflow.LCFGGenerator auto-inject {}
it can be fixed by deleting the work.flow..
Is there any way to fix this before it happens.

I did not find any words like this in the plugin.xml file.

Thanks
Re: about outline view [message #1076629 is a reply to message #1076623] Wed, 31 July 2013 17:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14716
Registered: July 2009
Senior Member
Sorry have n idea on this. Did you configure the generator fragment
to create a workflow?

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: about outline view [message #1076761 is a reply to message #1076629] Wed, 31 July 2013 20:41 Go to previous message
Yueming Hong is currently offline Yueming HongFriend
Messages: 87
Registered: April 2013
Member
No, I didn't~~ but I found them in the template file(.xpt file)

«IMPORT org::ui::wizard»

«DEFINE main FOR LCFGProjectInfo»
«EXPAND model FOR this»
«EXPAND workflow FOR this»
«ENDDEFINE»

«DEFINE model FOR LCFGProjectInfo»
«FILE "src/model/Model.lcfg"-»
/*
* This is an example model
*/
Hello Xtext!
«ENDFILE»
«ENDDEFINE»

«DEFINE workflow FOR LCFGProjectInfo»
«FILE "src/Generator.mwe2"-»
module Generator

var targetDir = "src-gen"
var modelPath = "src/model"

Workflow {
component = @workflow.LCFGGenerator auto-inject {}
}
«ENDFILE»
«ENDDEFINE»
Previous Topic:Xtext: Include "enum"
Next Topic:EcoreGeneratorFragment: path is unmapped
Goto Forum:
  


Current Time: Sun Sep 22 13:20:50 GMT 2024

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

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

Back to the top