Java Scrapbook for NetBeans IDE

In a couple of NetBeans discussions and issues, users are asking for a Java scrapbook feature:

http://forums.netbeans.org/ptopic51181.html

https://netbeans.org/bugzilla/show_bug.cgi?id=191488

I took Jesse Glick's Scrapbook feature, mentioned at the end of the issue above, included Java code templates, coloring, and other features, and have made it available as a plugin in the Plugin Portal:

http://plugins.netbeans.org/plugin/50195/?show=true

After you install it in NetBeans IDE 7.3.1 or above, create a new Java project (Java SE, or EE, or whatever, so long as the project has a Java classpath). The feature lets you keep track of sample code snippets, which are stored in a scrapbook file in the 'private' folder of your NetBeans project and when you run them, after right-clicking in the editor, they are executed against the project's classpath.  

So, you first need to create a Java project, since the classpath from the project is used when you run the snippet:

Then the editor opens and you can use quite a few of the Java editing features, but not code completion, to write some snippets:

By default, i.e., if  you select nothing in the editor, when you right-click and choose "Run Snippet" everything in the editor is run. However, if you have something selected, e.g., the whole of line 7 above, then only that line will be run. In other words, you can run blocks of code.

Similar plugins, though they don't let you run code:

http://plugins.netbeans.org/plugin/5811/tabbed-scratchpad

http://plugins.netbeans.org/plugin/5349/scratch-pad

Interested to know how useful this feature is considered to be! Ultimately, maybe something to include in NetBeans IDE? 

Comments:

Love this feature and have been missing it since the days of the great VisualAge for Java.

Posted by not just any guest on August 20, 2013 at 11:52 AM PDT #

Hi,

nice plugin. But how to fix this in the Output-Window of the Scrapbook:

warning: Supported source version 'RELEASE_6' from annotation processor 'org.netbeans.modules.openide.modules.PatchedPublicProcessor' less than -source '1.7'
warning: Supported source version 'RELEASE_6' from annotation processor 'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than -source '1.7'
warning: Supported source version 'RELEASE_6' from annotation processor 'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source '1.7'
warning: Supported source version 'RELEASE_6' from annotation processor 'org.netbeans.modules.openide.util.NbBundleProcessor' less than -source '1.7'

Thanks

Posted by guest on August 21, 2013 at 07:09 AM PDT #

I have been waiting for this for quite some time now :)
I would love it to have it available in the standard IDE

Thanks

Posted by guest on August 23, 2013 at 06:28 AM PDT #

How about including this for php and html ?

Posted by bill on August 26, 2013 at 09:03 AM PDT #

Hi, Looks pretty cool plugin but I'm getting following warning and unable to use it.

warning: Supported source version 'RELEASE_6' from annotation processor 'org.netbeans.modules.openide.modules.PatchedPublicProcessor' less than -source '1.7'
warning: Supported source version 'RELEASE_6' from annotation processor 'org.netbeans.modules.openide.util.ServiceProviderProcessor' less than -source '1.7'
warning: Supported source version 'RELEASE_6' from annotation processor 'org.netbeans.modules.openide.util.NamedServiceProcessor' less than -source '1.7'
warning: Supported source version 'RELEASE_6' from annotation processor 'org.netbeans.modules.openide.util.NbBundleProcessor' less than -source '1.7'

Posted by guest on November 18, 2013 at 05:27 AM PST #

Ah yes, the supported source version idiocy. Maybe you can get my https://bugs.openjdk.java.net/browse/JDK-7184902 reopened. :-)

Posted by Jesse Glick on November 22, 2013 at 07:21 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today