Skip to main content


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: bulklodd.yandex.ru

Hello,

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(
"x.java" ).getId( );
// Open a file
ITextEditor editor = ( ITextEditor ) IDE.openEditor( page,
fileToOpen.toURI( ), editorId, true );

Thanks in advance,
Sergey Klimov
Previous Topic:Commands and Toolbar and Toggle style buttons?
Next Topic:How to be notified of an editor being dragged and dropped
Goto Forum:
  


Current Time: Thu Apr 25 16:12:57 GMT 2024

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

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

Back to the top