Hi,
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:
Element:
(name=ConfigurationName) &
(model=Model) &
(paramaters=Parameters)? &
;
ConfigurationName:
'name:' configurationname=ID
;
Model:
'modelfile:' modelfile=ModelFile
;
ModelFile:
(ABSOLUTE_FILEPATH | RELATIVE_FILEPATH)
;
Parameters:
'parameters' '{'
(parameterdesc += ParameterDesc)+
'}'
;
ParameterDesc:
datatype=[DataType] name=ID value=Value
;
Here are my text(modelElement) methods:
public Object _text(ConfigurationName cname) {
return new StyledString(
cname.getConfigurationname(),
stylerFactory .createXtextStyleAdapterStyler(getCnTextStyle()));
}
protected TextStyle getCnTextStyle() {
TextStyle textStyle = new TextStyle();
textStyle.setBackgroundColor(new RGB(219, 219, 219));
return textStyle;
}
public Object _text(Model model) {
System.out.println(model.getModelfile());
return new StyledString(model.getModelfile(), stylerFactory.createXtextStyleAdapterStyler(getModelStyle()));
}
...
public Object _text(ParameterDesc param) {
return new StyledString(param.getName(),
stylerFactory .createXtextStyleAdapterStyler(getInterfaceStyle()));
}
...