October 17th, 2021

Bindows and IntelliJ IDEA

If you are already using Jetbrains popular Java IDE for your Bindows development you are in luck. If not, now is the time to take a good look at it. We have been working together with Jetbrains to add and improve Bindows-specific support in IntelliJ IDEA. Starting with the Selena Milestone 1 of IntelliJ we have most of the features that are needed for enjoyable development. In addition we have created our own plugin that can be automatically downloaded and installed from within the IDE. This plugin provides even more features to boost your productivity. Let’s start by going through some of the enhancements integrated to the IDE by Jetbrains.

• Inheritance
Since we use a special method called _biExtend to derive classes, editors usually don’t understand Bindows inheritance structure. This causes problems with code completion, showing none or every single function of Bindows. IntelliJ IDE understands how classes are derived and extended by looking at this method.

• Recognize public/private variables
In Bindows we use the underscore character in front of methods and variables to denote a private member. This is recognized by IntelliJ IDEA and reflected in code completion, etc.

• Support for addProperty
Bindows also includes a special function that can be used to create getter/setter methods - called addProperty. This function creates a private member variable as well as public getter/setters for it. IntelliJ IDEA sees this while parsing the code and adds those methods to code completion and navigation etc.

• Support for Bindows code documentation
IntelliJ can look at the API documentation for a function and figure out type-information as well as give you quick-lookup of the documentation text. It shows you the inparameters of a function, it knows the return type, etc.

• Type awareness
IntelliJ also has more traditional type awareness so when you type (for example):
var lbl = new BiLabel;
it then understands that lbl is of type BiLabel and this is reflected in the code completion, so it only shows you public methods available on BiLabel and its superclasses.

The Bindows plugin that we have developed has a built in web-server and can be used to quickly launch Bindows applications but also aid in debugging. Here are some of the main features:

• Launcher
Starts your browser of choice (Firefox or Internet Explorer) and runs your Bindows application without any need for creating html launchers, messing with paths etc.
It does not matter where things are. Let’s say you found some strange Bindows ADF sitting on your desktop. “What’s this?” Just open it in IntelliJ and launch.

• Logging
It can receive logging messages and data from a running Bindows application. These are then printed to a special Bindows Console inside IntelliJ IDEA. This is a useful alternative to the ‘dreaded’ alert messages.

• JavaScript evaluator
You can send JavaScript to a running Bindows application and have it evaluated at runtime. The results of the evaluation are written to the console in the IDE. This enables you to do some really neat debugging tricks that you probably could not do easily in compiled languages. You could for example rewrite methods while the program is still running. “Now that I have finally managed to somehow reproduce that bug, I wish I had put a debugger statement in that method.” No problem, just insert one. You could even use it as a calculator. Hurray! :)

• Code completion in Bindows XML/ADF
This will give you access to all tags and attributes as well as quick documentation lookup. We actually included the full documentation together with this feature. Just position your cursor on a tag or attribute and press Ctrl+Q.

The plugin is currently in beta and can be downloaded and installed from the plugin manager inside IntelliJ IDEA. Just look for “BindowsPlugin”. Detailed information is available in the readme.txt file included in the plugin jar file. You will of course need a copy of both Bindows and IntelliJ IDEA. There are trial versions on both our sites. We intend to further develop the plugin, so your bug reports and recommendations are always very welcome.

• Screencast
Enjoy a screencast describing Bindows development techniques using the new Bindows plugin for the IntelliJ IDEA development environment for the screencast.

Johan Lund - The Bindows Team

Leave a Response

Imhotep theme designed by Chris Lin. Proudly powered by Wordpress.
XHTML | CSS | RSS | Comments RSS