Geertjan's Blog

  • December 15, 2014

Tiling of Editor Documents in NetBeans Platform Applications

Geertjan Wielenga
Product Manager

A very exciting development for NetBeans users (and developers of applications based on the NetBeans Platform) everywhere.

Take a look at the screenshot below.

Take a look at it again, in particular the buttons within the red rectangle:

Right now, as you can see, those buttons are disabled. Now, however, because more than one document is open, those buttons are enabled:

The buttons are for tiling the editor documents. Here you can see the effect of clicking "Tile Evenly", which is the third of the four buttons:

And this is "Tile Vertically":

There's also "Tile Horizontally" and "Tile Single" (which untiles the tiled documents).

If you'd like this in NetBeans IDE, download the plugin here (restart NetBeans after installing the plugin), while this is also a plugin that is relevant to any other application on the NetBeans Platform that has editor documents. These documents can either be actual text editors or TopComponents of some other kind, e.g., GUI components where the user should be able to enter data of some kind.


The source code of the above is here, so that you can integrate it into your own NetBeans Platform application, and where you can also read more about it, including the implementation code, of course:


Many thanks to Norman Fomferra and others from Brockmann Consult in Germany, who created and open sourced this solution as part of the ESA Sentinel Toolbox, a NetBeans Platform application that is being created for the European Space Agency:


Here's the ESA home of the Sentinal Toolboxes:


They've extended the tiling idioms already, so that they now have tileable internal desktops, i.e., workspaces, with floating TopComponents.

They'll be separating out this solution, so that this will be pluggable, and the sources available separately, too. Pretty cool having rocket scientists (OK, they'll deny they're that, but they work in the space industry and are computer scientists, which to me means you're a rocket scientist) working on NetBeans code, isn't it? :-)

Join the discussion

Comments ( 6 )
  • markiewb Monday, December 15, 2014

    Nice one

  • Thierry D. Monday, December 15, 2014

    This is great, but the license is GPL. I couldn't use it in my commercial project.

    Also, the "modes" folder seems to indicate that there is a 16 windows limit. Am I correct?

  • Norman Tuesday, December 16, 2014

    @Thierry D.: GPL won't hinder you grasping the simple idea behind the implementation, namely define a rectangular matrix of editor modes and let your editor windows dock into them. The limit of 16x16 is arbitrarily chosen. Having a fixed size matrix is a drawback of this simple solution. Other solutions might require extending the NetBeans window management system.

  • guest Tuesday, December 16, 2014

    Extending the NetBeans window management system would be the correct way to go.

    In my opinion, the current window management system has an unhealthy coupling between the state of windows and the serialization of these states to XML documents.

    Ideally, I'd need a first-class Java API to manipulate window states instead of editing XML documents.

  • Geertjan Tuesday, December 16, 2014

    There's actually massive benefits to the XML-based approach. Would be impossible to easily reconfigure the windown system externally if it was purely based on Java.

  • Toni Epple Tuesday, December 16, 2014

    I also prefer the declarative (XML) approach over a simple Java API. External reconfiguration is one benefit, persistence is another one. Extensibility and safe API evolutionis a third one. Modularity and Dependency reduction is a fourth one.

    @Norman: Seems NetBeans Day was a success ;-).

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.