Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Editor with JFace Text
Editor with JFace Text [message #490157] Wed, 07 October 2009 15:07
StefanK  is currently offline StefanK Friend
Messages: 25
Registered: July 2009
Junior Member
Hello everybody,

I´m currently programming a text editor based on the JFace Text framework. Syntax highlighting works just fine, my problem is the content formatting.

	public IContentFormatter getContentFormatter(ISourceViewer pSourceViewer) {
		ContentFormatter lFormatter = new ContentFormatter();
		A4LFunctionFormattingStrategy lFunctionStrategy = new A4LFunctionFormattingStrategy();
		return lFormatter;

public class A4LFunctionFormattingStrategy implements IFormattingStrategy

	public String format(String content, boolean isLineStart, String indentation, int[] positions) {
			return content;
		} else {
			return content;

	public void formatterStarts(String arg0) {

	public void formatterStops() {


the function getContentFormatter is executed, the editor starts just fine. But no matter what I´m doing, the format function in A4LFunctionFormattingStrategy is never called. How can i call this method? I thought something like CTRL+SHIFT+F, just like eclipse.
I´m pretty desperate right now, so I would be greatly appreciative for all your advices.

Best regards
Previous Topic:StringFieldEditor & conditional errorMessages
Next Topic:TitleAreaDialog: Widgets disposed after click on the OK-Button
Goto Forum:

Current Time: Fri Oct 09 12:16:48 GMT 2015

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

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