您好,登錄后才能下訂單哦!
看了levin_zhang寫(xiě)的注釋與反注釋Comment/Uncomment selected code in Visual C++ 文章, 也想到在JBuilder5中沒(méi)有這樣的功能, 于是也寫(xiě)了一個(gè)Comment/Uncomment工具.
JBuilder5提供了一個(gè)Open Tools開(kāi)發(fā)工具給使用者來(lái)增強(qiáng)JBuilder5的功能。更多的這樣的Open tools工具請(qǐng)看www.borland.com 的community中的code contral.
實(shí)現(xiàn)comment/uncomment的功能代碼如下:
private boolean CreateComment()
{
String selection = target.getSelectedText();
String newSelection;
if ( (selection.trim().startsWith("/*") && selection.trim().endsWith("*/")))
{
StringBuffer sb = new StringBuffer(selection);
newSelection = sb.substring(2,selection.length()-2);
}else
{
newSelection = "/*" + selection + "*/";
}
target.replaceSelection(newSelection);
return true;
}
感謝.NET">Christopher Fitch, 我的這個(gè)程式參考了他的JavaDocCreator.
這個(gè)工具的名字是JavaCommentCreator.jar,使用時(shí)將其放到j(luò)builder5/lib/ext/目錄中,重新啟動(dòng)jbuilder即可.
使用方法,選取一段文字,點(diǎn)右鍵出現(xiàn)菜單,選 Comment/Uncomment Selection即可。在所選 文字的兩端加上的/*和*/, Uncomment時(shí)從/*選到*/再點(diǎn)Comment/Uncomment Selection菜單即可.
下載地址:
ASP?id=856">http://www.csdn.net/filebbs/read_topic.asp?id=856
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。