Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How to use java syntax coloring for non java files
How to use java syntax coloring for non java files [message #336442] Thu, 11 June 2009 19:55
Eclipse UserFriend
Originally posted by:


I open a java source without extension, how programmatically to make the
editor highlight syntax? I don't want to register any extensions in
preferences. I need to do that programmatically for any extension.

My code for opening a file:

// Get id of java editor
String editorId =
PlatformUI.getWorkbench().getEditorRegistry().getDefaultEdit or(
"" ).getId( );
// Open a file
ITextEditor editor = ( ITextEditor ) IDE.openEditor( page,
fileToOpen.toURI( ), editorId, true );

Thanks in advance,
Sergey Klimov
Previous Topic:Heeelp! How to define a command group for "Customize Perspective..."->"Command Gr
Next Topic:How to be notified of an editor being dragged and dropped
Goto Forum:

Current Time: Fri Mar 23 09:23:35 GMT 2018

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

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