- 浏览: 47961 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
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 749使用eclipse的过程中,有部分中文注释,在java ... -
JFreeChart 学习(2)-struts2+maven3
2015-06-20 11:53 1137该资源均来自网络,稍作了整理,以便查询 开发环境: ecli ... -
strusts2.0+servlet
2015-06-19 21:26 0在struts2.0中加入servlet -
JFreeChart 学习(1)-获取图片
2015-06-19 21:35 774jfreechart版本: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 4196现象: 向eclipse里面导入已存在工程时,报如下错误: ... -
eclipse3.6 在 tomcat6上部署web应用
2011-08-18 14:43 0本文做为一个简单练习总结,探索一个简单web工程从创建到部署的 ... -
eclipse添加findbugs plugin
2011-08-06 08:09 1069eclipse添加findbug plugin Eclips ... -
eclipse添加打开文件夹资源快捷方式
2011-08-05 08:59 1715eclipse添加打开文件夹资源快捷方式 在eclipse ... -
支持IE及FIRFOX 添加连接到收藏夹的简易操作
2011-07-21 09:55 1189支持IE及FIRFOX 添加连接到收藏夹的简易操作 ... -
使用jquery及javascript实现文本滚动效果
2011-07-15 17:22 1509使用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 2338velocity中使用jquery: 代码: <!D ... -
把中文版netbeans改成英文版
2011-05-18 17:36 1111netbeans6.5 找到安装目录的文件etc/ne ... -
Ajax学习笔记(一)
2010-08-05 01:21 857功能 1、使用ajax实现分页功能 一、概念 二、使用到的技 ... -
jquery学习笔记(一)
2010-07-12 15:46 0实现功能: 通过ajax、json从后台查询数 ...
相关推荐
Eclipse还提供了用于执行Java程序、进行调试以及创建Java Scrapbook Page(Java实时运算簿页面)的功能,后者是一个即时执行和测试Java代码的环境。 为了提高开发效率,Eclipse提供了代码重构、自定义代码格式、...
在Eclipse中开发Apache Derby应用程序涉及到一系列步骤和工具的使用。Apache Derby是一款开源的关系型数据库管理系统,它轻量级、嵌入式,适用于Java应用程序。Eclipse作为流行的Java集成开发环境,提供了丰富的工具...
* Java 片段页面(Java Scrapbook Page):表示一个 Java 片段页面(*.jpage 文件),它是一个特殊的 Java 文件,用于快速测试和验证 Java 代码。 * Java 片段页面(evaluation in progress):表示一个 Java 片段...
随着时间的发展,Eclipse 已经成为业界最流行的 IDE 之一。 **1.2 开放源码软件** 作为一款开放源码软件,Eclipse 的源代码对所有人开放,开发者可以自由地下载、使用、修改和分发 Eclipse 软件。这种开放性使得 ...
- **Java Scrapbook Page(*.jpage 文件)**:用于快速测试Java表达式的页面,正在执行评估时会有特定图标。 - **JAR Description File**:描述JAR文件的元数据信息。 2. **Build Path**: - **Java Working Set...
此外,还展示了如何执行Java程序,并使用Java实时运算簿页面(Java Scrapbook Page)来测试代码片段。Eclipse还允许开发者自定义开发环境,如设置代码格式、创建代码生成模板和Javadoc批注等。 构建JAR档案部分详细...
- **Java 实时计算页面 (Java Scrapbook Page):** 测试代码片段。 #### 3.5 定制开发环境 - **代码格式:** 定义代码的风格规范。 - **代码生成模板:** 自定义代码生成模板。 - **Javadoc 注释:** 生成文档注释...
Eclipse允许用户创建所谓的“Java Scrapbook Page”(*.jpage file),这是一个用于实验和记录代码片段的地方,可以即时评估和执行代码。当评估正在进行时,会有相应的图标提示用户。 对于构建路径(buildpath)和Java...
3. **创建SQL Scrapbook**:在Eclipse的工作区中,右击选择`New` -> `Other`,在弹出的对话框中,展开`SQL Development Tools`,然后选择`SQL Scrapbook`,点击`Next`,接着选择你的数据库类型(例如MySQL、Oracle等...
### Eclipse——整合开发工具(基础篇) #### 一、Eclipse简介 **1.1 历史背景** Eclipse最初由IBM开发,并于2001年作为开源项目发布。随着时间的发展,它逐渐成为了一个由Eclipse基金会管理的社区项目,支持多种...
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设定岔断点 ...
Scrapbook程序是Eclipse集成开发环境中的Java开发工具包(JDT)提供的一个非常实用的Scrapbook编辑器程序,使得可以在构建一个完整的Java程序之前,执行代码片段或计算选定的表达式的值。Scrapbook编辑器可以实现:...
- 随后,Eclipse逐渐成为最受欢迎的Java IDE之一,并扩展到了更多领域。 **开放源码软件:** - Eclipse作为一个开源项目,任何人都可以下载、使用、修改和分发其代码。 - 它采用了Eclipse Public License (EPL),这...
3. **使用Eclipse Scrapbook**:探索Eclipse中Scrapbook的功能,提高代码复用性。 4. **JUnit测试(第1部分)**:介绍如何使用JUnit框架进行单元测试。 5. **JUnit测试(续)**:深入探讨JUnit测试技巧。 6. **使用...
由于其灵活性和强大的功能,Eclipse成为了许多程序员喜爱的开发工具之一。 文档中提到的Eclipse Platform指的是Eclipse的核心架构,它由多个插件构成,允许对IDE的功能进行扩展和定制。Eclipse工作台(workbench)...