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: 7871
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
Previous Topic:Rename shifts from expectation
Next Topic:Problem running xtext workflow in Plugin Environment
Goto Forum:

Current Time: Sun Nov 29 03:45:42 GMT 2015

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

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