溫馨提示×

溫馨提示×

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

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

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

發布時間:2020-08-07 22:26:26 來源:ITPUB博客 閱讀:141 作者:worldblog 欄目:編程語言
在JBuilder5中增加注釋與反注釋工具 (轉)[@more@]

看了levin_zhang寫的注釋與反注釋Comment/Uncomment selected code in Visual C++ 文章, 也想到在JBuilder5中沒有這樣的功能, 于是也寫了一個Comment/Uncomment工具.

JBuilder5提供了一個Open Tools開發工具給使用者來增強JBuilder5的功能。更多的這樣的Open tools工具請看www.borland.com  的community中的code contral.

實現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,  我的這個程式參考了他的JavaDocCreator.

這個工具的名字是JavaCommentCreator.jar,使用時將其放到jbuilder5/lib/ext/目錄中,重新啟動jbuilder即可.

使用方法,選取一段文字,點右鍵出現菜單,選 Comment/Uncomment Selection即可。在所選 文字的兩端加上的/*和*/, Uncomment時從/*選到*/再點Comment/Uncomment Selection菜單即可.

下載地址:

ASP?id=856">http://www.csdn.net/filebbs/read_topic.asp?id=856


 


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

亚洲午夜精品一区二区_中文无码日韩欧免_久久香蕉精品视频_欧美主播一区二区三区美女