温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

在JBuilder5中增加注释与反注释工具 (转)

发布时间:2020-08-07 22:26:26 来源:ITPUB博客 阅读:87 作者: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