Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Lexical Hightlighting(Lexical Highlighting don't work)
Lexical Hightlighting [message #890197] Thu, 21 June 2012 12:28 Go to next message
Hans-Georg Glöckler is currently offline Hans-Georg GlöcklerFriend
Messages: 88
Registered: July 2009
Member
Hey,

I have implemented Lexical Highlighting in my Grammar but it don't work.
I want to can customize preference page for my DSL like described in:
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/extension-points/org_eclipse_core_runtime_contentTypes.html.

Please can you help me why it don't work.

package org.lunifera.metamodel.dsl.jpa.ui.labeling;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightingConfiguration;
import org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightingConfigurationAcceptor;
import org.eclipse.xtext.ui.editor.utils.TextStyle;

public class JpaHighlightingConfiguration implements IHighlightingConfiguration {

	public static final String JPA_ANNOTATION_ID = "jpaAnnotation";

	public void configure(IHighlightingConfigurationAcceptor acceptor) {
		acceptor.acceptDefaultHighlighting(JPA_ANNOTATION_ID, "JpaAnnotation",
				annotationTextStyle());
	}

	public TextStyle annotationTextStyle() {
		TextStyle textStyle = new TextStyle();
		textStyle.setColor(new RGB(100, 100, 100));
		textStyle.setStyle(SWT.ITALIC);
		return textStyle;
	}

}



package org.lunifera.metamodel.dsl.jpa.ui;

import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.eclipse.xtext.ui.editor.syntaxcoloring.IHighlightingConfiguration;
import org.eclipse.xtext.ui.editor.syntaxcoloring.ISemanticHighlightingCalculator;
import org.lunifera.metamodel.dsl.jpa.ui.labeling.JpaHighlightingConfiguration;
import org.lunifera.metamodel.dsl.jpa.ui.labeling.JpaSemanticHighlightingCalculator;

import com.google.inject.Binder;

/**
 * Use this class to register components to be used within the IDE.
 */
public class JpaUiModule extends
		org.lunifera.metamodel.dsl.jpa.ui.AbstractJpaUiModule {
	public JpaUiModule(AbstractUIPlugin plugin) {
		super(plugin);
	}

	@Override
	public void configure(Binder binder) {
		super.configure(binder);
	}

	public Class<? extends IHighlightingConfiguration> bindIHighlightingConfiguration() {
		return JpaHighlightingConfiguration.class;
	}

	public Class<? extends ISemanticHighlightingCalculator> bindISemanticHighlightingCalculator() {
		return JpaSemanticHighlightingCalculator.class;
	}
}


I use Xtext 2.3 with XbaseWithAnnotations
Re: Lexical Hightlighting [message #890227 is a reply to message #890197] Thu, 21 June 2012 14:13 Go to previous messageGo to next message
Hans-Georg Glöckler is currently offline Hans-Georg GlöcklerFriend
Messages: 88
Registered: July 2009
Member
Hi excuse me, I have solved the problem.
It is working.
Re: Lexical Hightlighting [message #1730059 is a reply to message #890227] Thu, 21 April 2016 08:09 Go to previous message
RamaRao Nandamuri is currently offline RamaRao NandamuriFriend
Messages: 120
Registered: April 2016
Senior Member
Hi,

Could you please post the solution for your problem?
Previous Topic:Remove items in Preferences
Next Topic:Load/Save text from/inro the server
Goto Forum:
  


Current Time: Tue Nov 19 21:32:13 GMT 2019

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

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

Back to the top