Friday Apr 01, 2016

Trip Report: NetBeans Day Germany 2016

NetBeans Day Germany was held yesterday, Thursday, 31 March 2016. There was a big turnout, the event was "sold" (i.e., free) out, with about 100 attending. Here's a view from the first session, a packed out room. The whole event happened at Oracle Germany in Munchen, an excellent location, great facilities, including a great lunch.

In the first session, I went through the history of NetBeans, talked about its unique features, did some demos, and showed the NetBeans roadmap:

Then Adam Bien did an excellent keynote on microservices and Java EE:

Adam showed a bunch of cool things. He did quite a bit of work with Docker in NetBeans IDE, where he showed the creation of new Docker images:

He also showed that he gets the most out of NetBeans! Take a look at the long list of servers he's registered in NetBeans for his daily development needs:

Next up was... Jaroslav Tulach, the founder and original lead architect of NetBeans IDE, who started his keynote with the words, "Yes, NetBeans is my fault!" :-)

Here's his current look and feel:

Jaroslav currently works at Oracle Labs, on Graal/Truffle, which is the "fastest (J)VM on the planet", all the details are on his slide below:

He also showed how to debug from Java to Ruby to JavaScript, via the enhanced debugger created by Oracle Labs in NetBeans IDE:


After a nice lunch break, the room was split in two. In the first track, Toni Epple showed how to use DukeScript to create games comparable to Candy Crush:

In the other track, Johannes Weigend did a great session on Apache Spark and NetBeans IDE, very well attended:

In another session, Oracle JET was the focus, which I introduced in some detail, including several small demos, over the space of 1 1/2 hours:

...while Thomas Kruse, during the same session, included a segment on porting Java Swing applications to Oracle JET:

There were other sessions too, on Angular and TypeScript, together with NetBeans, for example, by Karsten Sitterberg:

Other sessions included a focus on RESTful web services and documentation, by Sebastian Daschner and a session on Oracle's ideas around microservices, by Peter Doschkinow. The event ended with a raffle, followed by a great dinner (in the pic below, everyone is impatiently waiting for the 1st beer)...

...which rounded off a really great day, maybe the best NetBeans Day ever held. Upcoming NetBeans Days include India (April), England (May), and Brazil (June). Many others are being planned too!

Wednesday Mar 30, 2016

100 NetBeans t-shirts for NetBeans Day Munich!

Sponsored by Blue4IT in the Netherlands, here are 100 NetBeans t-shirts, ready for NetBeans Day in Germany tomorrow:

The above is more of the 2nd edition of the NetBeans Community T-Shirt. The 3rd edition is being planned, we'll have to squeeze things up a bit to fit the next set of sponsors into the puzzle! 

See the full program for tomorrow's NetBeans Day, which includes Jaroslav Tulach, Adam Bien, Toni Epple, and several more speakers, with a great line up of interesting talks. Yet another chance to mingle and network with other NetBeans community members.

https://www.eventbrite.com/e/netbeans-day-germany-tickets-22323978621

Monday Mar 28, 2016

Leipzig/Prague NetBeans Roadtrip

Last week I spent some time in Leipzig, Germany, with developers at ProjektMotor, a really cool software development organization that is focused on creating tools for PhotoShop/HTML conversion, on top of the NetBeans IDE. The tool is called ctrl-space, while beneath it is a templating platform that can be used to extend NetBeans Platform applications via JavaScript.

The week included a small meetup in an Irish pub in Leipzig with two other local NetBeans enthusiasts, Benno Markiewicz (a NetBeans Dream Team member) and Chris Lenz (who is redesigning the NetBeans website), together with Jens Vorberg and Nico Krebs from ProjektMotor:

Then we started a road trip to Prague, for Nico to demonstrate his project to the NetBeans development team. The trip took about 3 hours and included a meal at a Thai restaurant and a farmer strike in the center of Leipzig:

When we arrived in Prague, Nico presented the ProjektMotor project, together with some questions he was struggling with, to Petr Pisl, the NetBeans engineer who leads the JavaScript tooling work for NetBeans:

Next, Nico presented the ProjektMotor project to the NetBeans engineers, in particular his work relating to the templating engine enabling NetBeans IDE to be extended via JavaScript. Below you see Nico doing his presentation to a group of NetBeans engineers that includes NetBeans founder Jaroslav Tulach, as well as several project leads, such as Antonin Nebuzelsky and Martin Balin, together with several other engineers, e.g., Jan Lahoda, Petr Hejl, Tomas Mysik, and Ralph Ruijs:


And Jaroslav Tulach introduced Nico, Benno, and Chris to DukeScript and Graals/Truffle, two of the projects he's been working on:

It was also a great time for Jirka Kovalsky, the NetBeans community manager who runs the NetCAT program, for enthusiastic NetBeans community members who help out on testing new NetBeans releases, because he and Benno and Chris met for the first time, after several years of 'knowing' each other via e-mail and so on:

And, of course, the day ended with... beer in a Czech pub!

We'll be doing more NetBeans roadtrips like this. I have a dream... of a bus of developers en route to Prague from places all over Europe and maybe the world!

Saturday Mar 26, 2016

Skeleton Node Hierarchy with Login on GitHub

The series continues with a login scenario:

https://github.com/GeertjanWielenga/SkeletonNodeHierarchyWithLogin

Here's what you get, initially the same as last time, though this time no child nodes are available. Right-clicking on the node brings up the popup menu below:

When clicking on the popup menu, the dialog below is shown:

And, finally, if, and only if "foo/bar" is the "user/password", a new first level node is created in the hierarchy, together with all the children of the first level node. Here you can see that two first level nodes have been created.

How it works is that Preferences are created in the login dialog, while a PreferenceChangeListener is set on the Leve1ChildFactory.

Friday Mar 25, 2016

Skeleton Node Hierarchy for Databases on GitHub

Continuing the series, here's a starting point for node hierarchies that need to be plugged into the Databases node in the Services window:

https://github.com/GeertjanWielenga/SkeletonNodeHierarchyForDatabases

It looks as follows:

Here's the most important part of the source structure:

Thursday Mar 24, 2016

Skeleton Node Hierarchy with Progress Handling on GitHub

The same as yesterday, a skeleton node hierarchy, though this time different progress handling solutions are included:

https://github.com/GeertjanWielenga/SkeletonNodeHierarchyWithProgress

In Level1ChildFactory, keys are created like this, which causes the application to grey out and the application becomes modal during the processing:

@Override
protected boolean createKeys(final List list) {
    BaseProgressUtils.showProgressDialogAndRun(new Runnable() {
        @Override
        public void run() { during
            try {
                Thread.sleep(10000);
                list.add("one");
            } catch (InterruptedException ex) {
                Exceptions.printStackTrace(ex);
            }
        }
    }, "Processing Level 1...");
    return true;
}

In Level2ChildFactory, a different approach is provided, which kicks off the progress bar:

@Override
protected boolean createKeys(List list) {
    String msg = "Processing Level 2...";
    ProgressHandle handle = ProgressHandleFactory.createSystemHandle(msg);
    handle.start();
    try {
        Thread.sleep(10000);
        list.add("two");
    } catch (InterruptedException ex) {
        Exceptions.printStackTrace(ex);
    }
    handle.finish();
    return true;
}

In Level3ChildFactory, the default behavior, when "true" is passed into the ChildFactory call, is that the cursor turns into a spinning busy icon, while no progress bar of any kind is shown:

@Override
protected boolean createKeys(List list) {
    try {
        Thread.sleep(10000);
        list.add("three");
    } catch (InterruptedException ex) {
        Exceptions.printStackTrace(ex);
    }
    return true;
}

Wednesday Mar 23, 2016

Skeleton Node Hierarchy on GitHub

Sometimes handy to have a node hierarchy all set up and ready for you to incorporate your own content.

Well, here it is:

https://github.com/GeertjanWielenga/SkeletonNodeHierarchy

In the Services window, it produces this simple result:


The structure is as follows:


Tuesday Mar 22, 2016

ProjektMotor Blueprint Infrastructure for Extending NetBeans in JavaScript

A key problem for JavaScript developers using NetBeans IDE is that they need to know Java if they want to extend it.

For example, let's say you want to extend NetBeans IDE to provide code completion for Oracle JET components, such as a gauge. Hard enough to do that if you're a Java developer. Now imagine you're a JavaScript developer, getting to this point, i.e., implementing various NetBeans APIs, is impossible without knowing Java:

Moreover, since you don't simply want essentially a code template, but a dialog-driven set of GUI components, such as the below, life becomes even harder for the poor JavaScript developer trying to extend NetBeans IDE:

Having read the above and looked at the images, you're now ready to appreciate what ProjektMotor in Leipzig, Germany is working on: a project called "Control-Space". The project provides a blueprint infrastructure, enabling a JavaScript developer to define the code completion, as well as the GUI component that you see above, in JavaScript, as shown below:

The above is a Control-Space Blueprint, defining code completion in an HTML file for loading an HTML file named "gauge.html", which will be pasted into the HTML file at the cursor, after the dialog is completed. Support has been added as well for generating the corresponding JavaScript side. Essentially the above is a JavaScript DSL on top of the corresponding NetBeans APIs, which are all of course in Java.

Similarly, in addition to code completion extensions defined in JavaScript, you can use JavaScript to define new Nodes in a Blueprint Explorer window which, when clicked, can do anything you like, e.g., open windows or editors, generate boilerplate HTML, all by means of JavaScript:

Another example... Blueprints for removing menus from the main menubar in NetBeans IDE, again handy for JavaScript developers to tweak on the fly their development environment:


The third type of Blueprint is a Blueprint for testing Blueprints, again expressed in JavaScript. 

Next, imagine Blueprints for defining hints and error markings in the JavaScript editor, expressed in JavaScript. And imagine being able to define Eclipse workspaces in NetBeans via JavaScript. I.e., anything you can do when extending NetBeans via Java you can do, in principle, assuming the applicable abstractions have been created, in JavaScript. 

Now imagine a Blueprint marketplace, where JavaScript developers can share/sell their Blueprints. Many possibilities flowing from there, I think, and basically NetBeans IDE becomes whatever your Blueprints define it to be. 

Interesting, isn't it? :-) 

Friday Mar 18, 2016

March, April, May: NetBeans Days Germany, India, UK

The following three months, you can join in with a NetBeans Day in the following places:

At the same time, NetBeans Days are being planned in at least the following locations:

  • Sao Paolo, Brazil
  • Paris, France
  • Cologne, Germany
  • Johannesburg, South Africa
  • Stockholm, Sweden.
Interested in getting involved or in setting up a NetBeans Day somewhere yourself? Simply set it up and start promoting it! Or leave a message here or feel free to contact me directly at geertjan dot wielenga at oracle dot com.

Thursday Mar 17, 2016

Part 6 of Couchbase & NetBeans Webinar

Here's the source code of the plugin for Couchbase in NetBeans:

https://github.com/arun-gupta/couchbase-netbeans-plugin

And here's the latest webinar in the series with Arun and Eben from Couchbase:

Wednesday Mar 16, 2016

ContextAwareAction for Non-Indexed Couchbase Buckets

Let's take a look at how to implement an Action that will be visualized as a JMenuItem popup, which should only be displayed if a Couchbase bucket has not yet been indexed, so that it can be invoked to index the Couchbase bucket. Here you can see a non-indexed Couchbase bucket, with the "Set Primary Index" popup available:

Here, on the other hand, the JMenuItem popup is not available, since the bucket has already been indexed, hence it doesn't need to be indexed and the Action does not need to be, nor can it be, invoked:

Here's the code of the Action, hooked into the Node by overriding its "getActions(boolean)" method:

package org.netbeans.modules.couchbase.bucket;

import com.couchbase.client.java.Bucket;
import com.couchbase.client.java.query.N1qlQuery;
import com.couchbase.client.java.query.N1qlQueryResult;
import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import org.openide.awt.ActionID;
import org.openide.awt.ActionRegistration;
import org.openide.awt.DynamicMenuContent;
import org.openide.util.ContextAwareAction;
import org.openide.util.Lookup;
import org.openide.util.NbBundle.Messages;
import org.openide.util.Utilities;

@ActionID(
        category = "Bucket",
        id = "org.netbeans.modules.couchbase.bucket.CreatePrimaryIndexAction"
)
@ActionRegistration(
        lazy = false,
        asynchronous = true,
        displayName = "#CTL_CreatePrimaryIndexAction"
)
@Messages("CTL_CreatePrimaryIndexAction=Set Primary Index")
public final class CreatePrimaryIndexAction 
        extends AbstractAction 
        implements ContextAwareAction {

    private final Bucket bucket;

    public CreatePrimaryIndexAction() {
        this(Utilities.actionsGlobalContext());
    }

    public CreatePrimaryIndexAction(Lookup context) {
        super(Bundle.CTL_CreatePrimaryIndexAction());
        this.bucket = context.lookup(Bucket.class);
        N1qlQueryResult query = 
                bucket.query(
                        N1qlQuery.simple(
                                String.format("select * from system:indexes where keyspace_id = '" + 
                                        bucket.name() + "'", 
                                        bucket.name())));
        int size = query.allRows().size();
        if (size > 0) {
            setEnabled(false);
        } else {
            setEnabled(true);
        }
        putValue(DynamicMenuContent.HIDE_WHEN_DISABLED, true);
    }

    @Override
    public void actionPerformed(ActionEvent ev) {
        String bucketName = bucket.name();
        bucket.query(
                N1qlQuery.simple(
                        String.format("create primary index on `" + 
                                bucketName + "`", 
                                bucketName)));
        RefreshBucketListTrigger.trigger();
        System.out.println("New primary index on: " + bucketName);
    }

    @Override
    public Action createContextAwareInstance(Lookup context) {
        return new CreatePrimaryIndexAction(context);
    }

}

Tuesday Mar 15, 2016

Work Better with Cassandra 3 in NetBeans IDE

Quite a few people are involved now in different ways in the tooling support for Cassandra in NetBeans IDE.

A new release of the NetCassandraBeans plugin is now available, its main feature is that now Cassandra 3, as well as Cassandra 2 which was supported in the first release, is now supported:

http://plugins.netbeans.org/plugin/59444

Here's how the Cassandra node now looks (assuming you have Darcula installed), within the Databases node, while all the icons have been updated:

Want to help with this plugin? What's needed more than anything is for issues to be filed, either bugs or enhancement requests:

https://github.com/GeertjanWielenga/NetCassandraBeans/issues

Monday Mar 14, 2016

RunStopSimulator: Complete Infrastructure for Simulator Software (Part 2)

In part 1, some years ago, the start/stop infrastructure was controlled from toolbar buttons. Let's now change that so that, instead, we use popup menu items to start/stop something, in this case a server:

The steps to providing the above start/stop infrastructure is as follows:

  1. Create Startable and Stoppable capabilities.
  2. Create NodeActions that are sensitive to the above capabilities.
  3. Hook the NodeActions into the "getActions" of the Node where they should be invoked.
  4. Add a CentralLookup to your module.
  5. Implement Startable and Stoppable in the Node and add/remove from the CentralLookup as needed.

All the code outlined above is here:

https://github.com/GeertjanWielenga/NetCassandraBeans

For example, here's the StartCassandraAction:

import org.openide.awt.ActionID;
import org.openide.awt.ActionRegistration;
import org.openide.nodes.Node;
import org.openide.util.HelpCtx;
import org.openide.util.NbBundle.Messages;
import org.openide.util.actions.NodeAction;

@ActionID(
        category = "CassandraServer",
        id = "org.sim.start.StartCassandraAction")
@ActionRegistration(
        lazy = false,
        displayName = "#CTL_StartCassandraAction")
@Messages("CTL_StartCassandraAction=Start Server")
public final class StartCassandraAction extends NodeAction {

    @Override
    protected void performAction(Node[] nodes) {
        CentralLookup.getDefault().lookup(Startable.class).start();
    }

    @Override
    protected boolean enable(Node[] nodes) {
        return CentralLookup.getDefault().lookup(Startable.class) != null;
    }

    @Override
    public String getName() {
        return Bundle.CTL_StartCassandraAction();
    }

    @Override
    public HelpCtx getHelpCtx() {
        return HelpCtx.DEFAULT_HELP;
    }

}

The solution is elegant and idiomatic.

Saturday Mar 12, 2016

Lightweight & Fast NetBeans IDE

NetBeans IDE, how it looks for me is below, with Darcula look and feel, integrated JavaFX browser, Docker, and multiple carets (in the HTML file). The only plugin I've installed is Darcula, from the Plugin Manager under the Tools menu, all the rest is natively in NetBeans IDE. I've also removed the toolbar buttons to maximize screen real estate.

I'm using the "HTML5/JavaScript" download bundle of NetBeans IDE, which is small and fast, and includes the JRE.

Several of the features come from the latest development build, especially the multiple caret support. Get it here:

http://bits.netbeans.org/download/trunk/nightly/latest/

Friday Mar 11, 2016

Kubernetes, Node.js, Docker, NetBeans IDE

I worked through this Kubernetes document today and it worked well:

https://codelabs.developers.google.com/codelabs/hello-kubernetes/index.html

Here below (click to enlarge the image) you see my Node.js project in NetBeans IDE, showing the Docker file and Node.js file, together with Docker visualization in the Services window. From the Docker file, the Docker image can be built, after which it can be run, all from within NetBeans IDE. (Well, you need a development build for the next release of NetBeans IDE, available from the NetBeans Downloads page.)

Handily, NetBeans IDE has a built-in terminal, which I used a lot in this scenario:

At the end of the instructions, I had the Kubernetes Graphical dashboard up and running, showing me my Kubernetes-related data:

Finally, since I'm on Windows, I found this tip and this tip helpful for troubleshooting.

Thursday Mar 10, 2016

Couchbase Bucket Index Status in NetBeans IDE 8.1

Just did the 5th part of the Couchbase/NetBeans hacking session with Arun and Eben from Couchbase. We worked on visualizing whether a bucket is indexed or not, as shown below via small icons on the bucket nodes and a corresponding tooltip:

Here's how it looks with the Darcula look and feel which continues to be my favorite way to work with NetBeans IDE:


Here's the Couchbase announcements re the publication of this part of the series. Features being added are increasingly technical now!

Wednesday Mar 09, 2016

NetBeans Community at JavaLand 2016

NetBeans Dream Team members were well represented at JavaLand yesterday and today. Thomas Kruse and Kirk Pepperdine are not in the pic below, though they were at the conference, while in the pic you see Michael Mueller, me, Toni Epple, and Ivar Grimstad!

It was a great time and Toni suggested maybe next year there should be a NetBeans Community booth at JavaLand (and maybe other conferences too).

Tuesday Mar 08, 2016

Cassandra & Couchbase in NetBeans IDE

In NetBeans IDE 8.1, in a change especially useful with the Darcula plugin installed, the Cassandra and Couchbase plugins now have icons that look pretty good and that match/correspond with each other, while both are now found correctly within the Databases node:

If you want to get involved in the development of support for Cassandra and Couchbase in NetBeans IDE, here are the GitHub repos and please also feel free to add new issues for missing features:

https://github.com/arun-gupta/couchbase-netbeans-plugin

https://github.com/GeertjanWielenga/NetCassandraBeans

Sunday Mar 06, 2016

Couchbase Status in NetBeans IDE 8.1

With Arun Gupta, I've been working on creating a NetBeans plugin for Couchbase. Arun's made webinars of each session we've done, the most recent one especially interesting if you want to learn about the Nodes API in the NetBeans Platform:

One thing we needed to do was move the Couchbase node within the Databases node, which is now done, as shown below: 

All the source code is here:

https://github.com/arun-gupta/couchbase-netbeans-plugin

Give the NBM a try, get it here (though the Couchbase node will not be in the Databases node, i.e., not in the binary yet):

https://github.com/arun-gupta/couchbase-netbeans-plugin/releases

Saturday Mar 05, 2016

Five Steps to a Very Awesome Microservices Platform

From zero to a Very Awesome Microservices Platform is not much work.

  1. Get Docker. For me, on Windows 7, I used Docker Toolbox, using these excellent steps. I then had a lot of problems, relating to the Virtual Box installed by Docker Tools. Read this for related information about this problem. I then uninstalled Virtual Box, downloaded the latest version of Virtual Box, and installed it together with the "-msiparams NETWORKTYPE=NDIS5" argument. Next, after installation succeeded, I checked in "Network Connections" to make sure the "VirtualBox Bridged Networking Driver" had been selected.

  2. To make sure everything worked, I clicked on the "Docker Quickstart Terminal" on my desktop and ran this at its prompt:
    docker run hello-world
    The above worked and I got a message in the terminal.

  3. Then, get some Docker visualization tools, i.e., use NetBeans IDE 8.2, currently available as a development build, and then you'll be able to work with Docker Hub and related tools, as shown here:

  4. Now let's install VAMP. First, get the IP. In the "Docker Quickstart Terminal" on your desktop, run this:
    docker-machine ip

    Now you have an IP number, which you need in the next step.

  5. Read this page on the VAMP site. Then, in the Docker Quickstart Terminal, run this command (or the one applicable to your environment, as specified on the VAMP page), all on one line:
    docker run --net=host 
    -v /var/run/docker.sock:/var/run/docker.sock 
    -v $(which docker):/bin/docker 
    -v "/sys/fs/cgroup:/sys/fs/cgroup" 
    -e "DOCKER_HOST_IP=`put-docker-ip-here`" 
    magneticio/vamp-docker:0.8.3-marathon
    

    The process takes a while. After it completes, you should now see this, automatically, in NetBeans IDE. In the screenshot below, I have selected the new nodes that have been added, to highlight them, i.e., you can now see your running VAMP container:


And now you're ready to use VAMP. Go to the URLs specified here in the VAMP documentation:

You also have Marathan set up, at the same time:

In next parts, we'll start using VAMP, now that we have it, together with its related tools, set up and ready to use.

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

Categories
Archives
« May 2016
SunMonTueWedThuFriSat
1
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    
       
Today