溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

在JBuilder5中增加注釋與反注釋工具 (轉(zhuǎn))

發(fā)布時(shí)間:2020-08-07 22:26:26 來(lái)源:ITPUB博客 閱讀:95 作者:worldblog 欄目:編程語(yǔ)言
在JBuilder5中增加注釋與反注釋工具 (轉(zhuǎn))[@more@]

看了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


 


向AI問(wèn)一下細(xì)節(jié)

免責(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)容。

AI