- 浏览: 46515 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
elf8848:
引用
readonly
不可编辑,可以获得焦点,背景颜色默认 ...
Input的readonly 属性与disabled属性
eclipse 之 scrapbook
在日常的编码过程中,经常会遇到一些还不确定功能或性能的方法或者代码片段,如果需要测试这段代码,一般需要单独写一个class类来验证,最近在网上不经意间看到一个可以单独运行代码片段的小工具,使用起来挺方便,故摘录下来,以备参考:
Using Scrapbook Pages
At 6:28 PM on Jan 8, 2006, João Almeida Javalobby Newcomers wrote:
One of the most undervalued and forgotten features of Eclipse is the scrapbook page , which allows to execute Java expressions without having to create a new Java program. This is a neat way to quickly test an existing class or evaluate a code snippet.
To create a scrapbook page choose File -> New -> Other -> Java -> Java Run/Debug -> Scrapbook Page , choose a name and destination folder and that's it. Now there's an empty page where regular Java expressions can be written and evaluated, to do so just select the expression and choose one of the available operations (either in the toolbar now available or the context menu).
Try this: write new java.util.Date() , select the text and click Display or Inspect .
Display will evaluate the expression and print the result directly on the scrapbook, basically the return of a toString() applied to that object or the return value of the selected Java method.
If the information displayed is not enough, there's the Inspect feature (see below) which shows an debug window with all the details of the selected object, and all this happens without executing any code or switching to the Debug perspective.
To evaluate code snippets there's the Execute feature, this will execute a block of code, just like in a regular java program. A quick way to try this is to send something to the standard output: just write System.out.println("Scrapbook example") , select the text and hit Run , this should print something on the Console window (see below).
Because it's created within a Java project a scrapbook page , all the classpath libraries and projects references can be used here; another nice feature is having code assist, just like in a regular Java editor page. In a scrapbook page the class names fully qualified, there's no, this isn't much of a problem because the code completion handles this nicely, but if you're working with unusually large class names you can check the Set Imports option, this will open new window where all the import expressions can be inserted (just the import section of a regular class file).
A scrapbook page is not as fully featured as the Java editor, there's no outline and the code assist is somehow limited, but is not meant to be like that; the idea is working with just a few lines, and this where the scrapbook page can be useful: to quickly test Java expressions and code blocks present in a project in this kind of sandbox.
参考地址:http://www.eclipsezone.com/eclipse/forums/t61137.html
在日常的编码过程中,经常会遇到一些还不确定功能或性能的方法或者代码片段,如果需要测试这段代码,一般需要单独写一个class类来验证,最近在网上不经意间看到一个可以单独运行代码片段的小工具,使用起来挺方便,故摘录下来,以备参考:
Using Scrapbook Pages
At 6:28 PM on Jan 8, 2006, João Almeida Javalobby Newcomers wrote:
One of the most undervalued and forgotten features of Eclipse is the scrapbook page , which allows to execute Java expressions without having to create a new Java program. This is a neat way to quickly test an existing class or evaluate a code snippet.
To create a scrapbook page choose File -> New -> Other -> Java -> Java Run/Debug -> Scrapbook Page , choose a name and destination folder and that's it. Now there's an empty page where regular Java expressions can be written and evaluated, to do so just select the expression and choose one of the available operations (either in the toolbar now available or the context menu).
Try this: write new java.util.Date() , select the text and click Display or Inspect .
Display will evaluate the expression and print the result directly on the scrapbook, basically the return of a toString() applied to that object or the return value of the selected Java method.
If the information displayed is not enough, there's the Inspect feature (see below) which shows an debug window with all the details of the selected object, and all this happens without executing any code or switching to the Debug perspective.
To evaluate code snippets there's the Execute feature, this will execute a block of code, just like in a regular java program. A quick way to try this is to send something to the standard output: just write System.out.println("Scrapbook example") , select the text and hit Run , this should print something on the Console window (see below).
Because it's created within a Java project a scrapbook page , all the classpath libraries and projects references can be used here; another nice feature is having code assist, just like in a regular Java editor page. In a scrapbook page the class names fully qualified, there's no, this isn't much of a problem because the code completion handles this nicely, but if you're working with unusually large class names you can check the Set Imports option, this will open new window where all the import expressions can be inserted (just the import section of a regular class file).
A scrapbook page is not as fully featured as the Java editor, there's no outline and the code assist is somehow limited, but is not meant to be like that; the idea is working with just a few lines, and this where the scrapbook page can be useful: to quickly test Java expressions and code blocks present in a project in this kind of sandbox.
参考地址:http://www.eclipsezone.com/eclipse/forums/t61137.html
发表评论
-
eclipse调节java编辑器中文字体大小
2015-07-06 19:35 691使用eclipse的过程中,有部分中文注释,在java ... -
JFreeChart 学习(2)-struts2+maven3
2015-06-20 11:53 1047该资源均来自网络,稍作了整理,以便查询 开发环境: ecli ... -
strusts2.0+servlet
2015-06-19 21:26 0在struts2.0中加入servlet -
JFreeChart 学习(1)-获取图片
2015-06-19 21:35 709jfreechart版本:1.0.13 maven依赖配置: ... -
js 计算特殊字符CRLF
2012-03-28 15:48 0js计算CRLF长度为1还是为2? -
linux 下 jboss7的安装
2011-12-31 09:22 0linux 下 jboss7的安装 环境: linux 2.6 ... -
maven 体验
2011-12-22 13:59 0使用maven管理web项目尝试 开发环境: win7, c ... -
eclise导入已存在工程报 Faceted Project Problem 错误
2011-11-01 17:42 4141现象: 向eclipse里面导入已存在工程时,报如下错误: ... -
eclipse3.6 在 tomcat6上部署web应用
2011-08-18 14:43 0本文做为一个简单练习总结,探索一个简单web工程从创建到部署的 ... -
eclipse添加findbugs plugin
2011-08-06 08:09 1023eclipse添加findbug plugin Eclips ... -
eclipse添加打开文件夹资源快捷方式
2011-08-05 08:59 1675eclipse添加打开文件夹资源快捷方式 在eclipse ... -
支持IE及FIRFOX 添加连接到收藏夹的简易操作
2011-07-21 09:55 1139支持IE及FIRFOX 添加连接到收藏夹的简易操作 ... -
使用jquery及javascript实现文本滚动效果
2011-07-15 17:22 1471使用jquery及javascript实现文本滚动效果 ... -
eclipse3.2.2 整合 weblogic81
2011-07-13 11:28 0eclipse3.2.2 整合 weblogic8.1 -
修改eclipse启动jdk版本
2011-07-13 10:49 0修改eclipse启动jdk版本 1.eclipse3.3 ... -
eclipse indigo 安装 weblogic插件
2011-07-12 12:34 0eclipse indigo 中 安装 Oracle WebL ... -
velocity中使用jquery出现的问题
2011-07-07 12:45 2294velocity中使用jquery: 代码: <!D ... -
把中文版netbeans改成英文版
2011-05-18 17:36 1076netbeans6.5 找到安装目录的文件etc/ne ... -
Ajax学习笔记(一)
2010-08-05 01:21 826功能 1、使用ajax实现分页功能 一、概念 二、使用到的技 ... -
jquery学习笔记(一)
2010-07-12 15:46 0实现功能: 通过ajax、json从后台查询数 ...
相关推荐
4 .5 Java 实时运算簿页面 (Java Scrapbook Page ) 4 .6自订开发环境 4 .7产生 getter 与 setter 4 .8建立 JAR 档案 4 .9.建立 Javadoc 文件 4 .10 工作集 (Working Sets ) 5 .除错 5 .1错误的程序 5 .2设定岔断点 ...
156 4.5 Java即時運算簿頁面(Java Scrapbook Page) 159 4.6自訂開發環境... 166 4.6.1程式碼格式... 166 4.6.2程式碼產生模板... 168 4.6.3 Javadoc註解... 170 4.7產生 getter 與 ...
Eclipse – 整合开发工具(基础篇) Jacky Lee 2005/03/01 教程特点: 1、图文并茂的详细介绍了eclipse的使用方法 2、虽然是pdf,但是非影音版,所有相当清晰 3、含文档结构目录,可以方便的跳转到对应章节 4、允许...
45 Java 实时运算簿页面(Java Scrapbook Page) 160 46 自订开发环境 167 461 程序代码格式 167 462 程序代码产生模板 169 463 Javadoc 批注 171 47 产生 getter 与 setter 176 48 建立 JAR 档案 177 481 建立...
4.5 Java 实时运算簿页面(Java Scrapbook Page)..... 160 4.6 自订开发环境......... 167 4.6.1 程序代码格式... 167 4.6.2 程序代码产生模板....................... 169 4.6.3 Javadoc 批注... 171 4.7 产生 ...
4.5 Java即時運算簿頁面(Java Scrapbook Page) 159 4.6自訂開發環境 166 4.6.1程式碼格式 166 4.6.2程式碼產生模板 168 4.6.3 Javadoc註解 170 4.7產生 getter 與 setter 。175 4.8建立 JAR 檔案 176 4.8.1建立新的 ...
4.5 Java即時運算簿頁面(Java Scrapbook Page) 159 4.6自訂開發環境 166 4.6.1程式碼格式 166 4.6.2程式碼產生模板 168 4.6.3 Javadoc註解 170 4.7產生 getter 與 setter 。175 4.8建立 JAR 檔案 176 4.8.1建立新的 ...
4.5 Java实时运算簿页面(Java Scrapbook Page) 115 4.6自订开发环境 122 4.6.1程序代码格式 122 4.6.2程序代码产生模板 123 4.6.3 Javadoc批注 125 4.7产生 getter 与 setter 129 4.8建立 JAR 档案 131 4.8.1建立新...
Eclipse中文教程三册全集 0.环境说明 .................................................................... 8 1.Eclipse 简介................................................................. 9 1.1 历史背景...
您的数字平凡的剪贴簿在这里可以组织所有这些有趣的文章:newspaper:,锻炼视频:woman_in_lotus_position:,利基研究:person: holiday,假Eclipse谱:shallow_pan_of_food:……实际上是任何东西。 通过照片,GIF,...