Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Null pointer through customizing outline view
Null pointer through customizing outline view [message #1004520] Wed, 23 January 2013 11:43 Go to next message
Phil H is currently offline Phil HFriend
Messages: 267
Registered: November 2012
Senior Member

according to the documentation, I tried to style my outline view. Where it works for the rule ConfiguratioName (see below), I got the following Errormessage by modeling a Model or Parameters: "'Refreshing outline' has encountered a problem. Error refreshing outline" ( Error stack). When I ignore this error and model on, the element will be shown in the outline view in the defined styled way.

Here are my Grammar Rules:
	(name=ConfigurationName) &
	(model=Model) &
	(paramaters=Parameters)? &

	'name:' configurationname=ID

	'modelfile:' modelfile=ModelFile


	'parameters' '{'
		(parameterdesc += ParameterDesc)+

	datatype=[DataType] name=ID value=Value

Here are my text(modelElement) methods:

public Object _text(ConfigurationName cname) {
		return new StyledString(
				stylerFactory		.createXtextStyleAdapterStyler(getCnTextStyle()));

	protected TextStyle getCnTextStyle() {
		TextStyle textStyle = new TextStyle();
		textStyle.setBackgroundColor(new RGB(219, 219, 219));
		return textStyle;

public Object _text(Model model) {
		return new StyledString(model.getModelfile(),				stylerFactory.createXtextStyleAdapterStyler(getModelStyle()));


public Object _text(ParameterDesc param) {
		return new StyledString(param.getName(),
				stylerFactory					.createXtextStyleAdapterStyler(getInterfaceStyle()));

Re: Null pointer through customizing outline view [message #1004534 is a reply to message #1004520] Wed, 23 January 2013 12:13 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13357
Registered: July 2009
Senior Member
Hi since you enter first the reference and then the name what about a
classical null check on get name?

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

Need professional support for Xtext, Xpand, EMF?
Go to:
Twitter : @chrdietrich
Blog :
Previous Topic:Rename shifts from expectation
Next Topic:Problem running xtext workflow in Plugin Environment
Goto Forum:

Current Time: Wed Feb 19 23:02:37 GMT 2020

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

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

Back to the top