Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » SqlStatementArea (sourceviewer) code completion doesn't work
SqlStatementArea (sourceviewer) code completion doesn't work [message #909642] Fri, 07 September 2012 13:26
Ricky de Klerck is currently offline Ricky de KlerckFriend
Messages: 295
Registered: January 2011
Senior Member

For a couple of days now, I'm trying to create an Eclipse view with an area where I can edit sql. I want this area to have syntax highlighting, code completion, auto format, line numbers etc.

I found out that the SqlStatementArea of the Eclipse Data Tools project has this ability. I've used this in my project and the syntax highlighting works out of the box but when I hit CTRL+SPACE nothing happens.

This is my code:

service = new CustomSQLSourceViewerService();
sta = new SQLStatementArea(this, SWT.BORDER, service, true);
CustomSQLSourceViewerConfiguration sqlSourceViewerConfiguration = new CustomSQLSourceViewerConfiguration();
sta.setLayoutData(new GridData(GridData.FILL_BOTH));
document = new Document();
document.set("select * from test");

Allso I made a class which extends SQLSourceViewerConfiguration so I could override getContentFormatter (I want all keywords to be uppercase). This is the code for that:

public IContentFormatter getContentFormatter(ISourceViewer sourceViewer) {
  ContentFormatter formatter = new ContentFormatter();
  formatter.setFormattingStrategy(new SQLWordStrategy(new DefaultSQLSyntax()),
  return formatter;		

But there is no formatting applied.. Hope someone can help? Thanks in advance.

[Updated on: Fri, 07 September 2012 13:26]

Report message to a moderator

Previous Topic:Custom MRU list
Next error
Goto Forum:

Current Time: Wed Dec 01 22:38:04 GMT 2021

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

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

Back to the top