How to use toggle comment API in JDT [message #1323014] |
Wed, 30 April 2014 04:13 |
May Yang Messages: 1 Registered: April 2014 |
Junior Member |
|
|
Extremely frustrating. My purpose is to create a eclipse plugin that can commment or uncomment source code that is embraced by a leading keyword and a trailing keyword, such as:
//#ifdef keyword
source code 1
source code 2
//#endif
if keyword does not exist in configuration file, i would like to comment "source code 1" and "source code 2":
//#ifdef keyword
//source code 1
//source code 2
//#endif
Of cos i am able to do it using FileReader to find the keyword and using FileWriter to add // to the souce code lines in between and write new contents to the source file. But i wonder since eclipse IDE provides "Source" menu inside which, there are actions: "comment", "uncomment", "toggle comment", is it possible that such comment manipulation APIs are provided in JDT as well so that we can use the API to achieve my above goals?
Unfortunately, i have been searching in JDT API reference, and google all over, and came up with no such thing.
Help please?
|
|
|
|
Powered by
FUDForum. Page generated in 0.03701 seconds