Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html /
 
 package org.eclipse.xtext.ui.editor.syntaxcoloring;
import  org.eclipse.jface.preference.FieldEditor;

Author(s):
Dennis H´┐Żbner - Initial contribution and API
Sebastian Zarnekow
public class SyntaxColoringPreferencePage extends AbstractPreferencePage implements IHighlightingConfigurationAcceptorComparator<Triple<StringStringTextStyle>> {
	}
	protected String qualifiedName() {
		return PreferenceStoreAccessor.syntaxColorerTag(getLanguageName());
	}
	public void collectHighlightings(IHighlightingConfiguration configuration) {
		configuration.configure(this);
	}
	public void acceptDefaultHighlighting(String idString nameTextStyle style) {
		.add(Tuples.create(idnamestyle));
	}
	protected void createFieldEditors() {
	}
	protected void refreshAttributes() {
		Collections.sort(this);
		for (Triple<StringStringTextStylehighlighting : ) {
			.populateTextStyle(highlighting.getFirst(), new TextStyle(), highlighting.getThird());
		}
	}
	public int compare(Triple<StringStringTextStyleleftTriple<StringStringTextStyleright) {
		return left.getSecond().compareTo(right.getSecond());
	}

TODO: better use unqualified names in preference store. Left this workaround not to break API.
	protected void addField(FieldEditor editor) {
		editor.setPreferenceName(qualifiedName() + "." + editor.getPreferenceName());
		super.addField(editor);
	}
New to GrepCode? Check out our FAQ X