Bindows™ IntelliJ Plugin
This page is updated for Bindows IntelliJ Plugin version 1.0 beta 6.
IntelliJ IDEA by JetBrains is an intelligent Java IDE. The Bindows plugin for IntelliJ IDEA significantly enhance and expedite the development process. This editor has in itself an impressive array of features tailored specifically for Bindows programmers.
Features
The main features of the plugin:
- Multi Platform
- Windows
- Mac OS X
- Linux
- Launch in any browser
A new blue button with the Bindows logo is located on IntelliJ IDEA's main toolbar. This button opens a drop down menu with a list of available browsers. This enables you to launch the active Bindows ADF/XML in the selected browser. You can also use the keyboard shortcut Alt+B (Ctrl+B on Mac) followed by a digit. Each browser on the drop down list is numbered and you can add as many browsers as you want in the settings dialog for the plugin. You can launch xml files located anywhere on your hard drive. Your Bindows distributions can be located anywhere on your hard drive - you do not need to worry about paths, creating html, or modifying code. By default on a Windows system you get Internet Explorer and Firefox without having to set these up by yourself. On Mac and Linux you get Firefox. - Code Completion
IntelliJ IDEA has excellent built in support for Bindows JavaScript code completion. This feature adds to that: code completion in Bindows ADF/XML files. Classes and attributes are available, as well as quick access to the API documentation. Just place your cursor on a tag or attribute and press Ctrl+Q. To activate this feature; include this xmlns attribute in your Application tag:
xmlns="http://www.bindows.net/Schema/3.0/" - InfiView 1.5 support
The plugin automatically installs and configures schemas and a live template for use with InfiView 1.5. The live template, called "niv" (short for "New InfiView"), creates a fully working InfiView application skeleton.
To enable code completion and documentation of tags in InfiView xml files you simply add the following two attributes to your application tag in your ADF (this is done for you by the live template if you use that).xmlns="http://www.infiview.net/BindowsSchema/1.5/" xmlns:iv="http://www.infiview.net/Schema/1.5/"
Please note that in order to launch InfiView applications with the plugin you cannot use ordinary Bindows distributions. You should use the Bindows distribution that comes as part of the InfiView package. - Open Last Good File
When you launch the active xml file (active means it is in the active editor or a file selected in the project view), the plugin remembers this file as the last used xml file. Later on you might be working inside a JavaScript file and press the shortcut to relaunch your application. The javascript file is now the active file and it can't be launched but the plugin then automatically launches the last used xml file instead. This saves you the trouble of having to activate the xml file every time you want to relaunch. - Console View
The console displays text such as logging and diagnostic information that you can print from your Bindows application during runtime. See the debugging section on how to print text to it. The display of logged messages can be paused at any time and later resumed without loosing any messages. There is also a clear button so you can clear all the contents of the console window. - Color coded logging levels
It is also possible to print logging messages using three different levels or colors. New live templates have been added to expedite this.
Code Color Live template(s) Meaning BiLog.out(""); Black blog, blog2 Normal/user message (default) BiLog.out("", BiLog.ERROR); Red blogErr Error message BiLog.out("", BiLog.SYSTEM); Green blogSyst System message - Javascript Evaluation Window
You can type or drag JavaScript code into this window and send it to your Bindows application where it will be executed during runtime. The result of your actions will be echoed to the console view. To send the code press the send button or press Ctrl+Enter. To clear the window from code press the Clear button or press Ctrl+Delete. This opens up a lot of possibilities such as rewriting methods during runtime, checking the values of objects etc. - Multiple Bindows Distributions
The plugin needs to know the location of at least one Bindows directory. You can add multiple locations in the plugin settings window. The one that is highlighted is the one that will be used for launching the application. So for example; if you want to make sure that your application works flawlessly in both Bindows 3.0 and Bindows 1.50 you could quickly switch between the two distributions without having to change any code or paths anywhere. In addition to this you can rename your distributions with a friendly name to easier distinguish between them. - Remote Bindows Distributions
Your Bindows distribution does not need to be located on your hard drive. It can be hosted anywhere and all you need to do is specify the url and port. The plugin enable you to do this witout any "cross domain" security issues from the browser.
To create a remote distro; just click "Add Bindows Dir" in the settings dialog for the plugin. Then select "Remote Bindows Distribution" in the dialog that follows. - Browser Exit Detection
Detects when the browser instance is closed and prints a message about it in the console window. You need to have debug mode activated for the detection to work. - Live Templates Included
Several useful live templates are now included with the plug-in. Both for use in xml markup and for use in JavaScript. Templates for building skeleton applications and classes as well as dispose methods, event handlers with enumerated event types etc. are included. There is also a live template that you can use to print logging information that automatically detects contextual information such as line number, current class and method and includes them in the output. To see which live templates are included look under "Live Templates" in the IntelliJ IDEA settings. To access live templates from your code press Ctrl+J on Windows and Linux and Command+J on Mac. - Auto include of Logging Library
Starting with beta 2 of the plug-in you no longer have to manually include the file BiLog.js. This file will be included automatically by the plugin when debug mode is active. This works in the following way: When the browser GETs BiEventTarget.js from the server, BiLog.js is silently attached at the end of the file. However, when the obfuscated version of Bindows is used BiEventTarget is baked into Application.js and needs to be attached to this file instead. Therefore you should choose if you are using obfuscated or non-obfuscated code in the plug-in settings. - Facet support
The Bindows plugin support IntelliJ IDEA's notion of facets. Facets are similar to "perspectives" in Eclipse. They allow you to enable and disable support for certain technologies on a module level. The facet can be added when you first create a new project or added later to an already existing project. It is important that you enable the Bindows facet for at least one of the modules in your project or you will have none of the Bindows buttons and tool windows available.
See the below for detailed instructions on how to do this.
- Integrated BiPad
The BiPad tool allows real time previewing of Bindows xml.
It extracts the code between the Application->Window tags and renders it in an embedded mozilla based browser window as you type. When active bindows distribution/version is switched, BiPad is relaunched to use the new distro. - Integrated GridPanel2 Designer
The GridPanel2Designer is a tool window that allows you to visually design Bindows interfaces and forms. The designer makes use of the new highly efficient BiGridPanel2 layout component, introduced in Bindows 3.0. The code that the designer generates appears in a special tab window in the designer. You can copy this code and paste it into your editor and integrate it into your projects. - Integrated JsDoc Generation (alpha version)
Go into the Bindows settings for your module (the facet) and you find options for generating documentation for your Bindows JavaScript files.
Select an output path, add .js files and hit the run button. Styled xml files will be placed in the output directory. You can open these files in your web browser to look at a nicely formatted documentation for your Bindows classes.
Take a look at the Bindows source code for hints on how to write documentation that the generator understands.
This feature is still in an alpha state. The settings you make will not be stored. You also get no error messages or hints about bad documentation. We will resolve these issues in the beta 7 of the plugin. Read the attached document and learn how to document your code so that it works with our JsDoc generator - now built into IntelliJ IDEA. Document your code in JsDoc (pdf)
Release Notes
Detailed release notes for each new version of the plugin can be found at JetBrains plugin repository CLICK here.
Get IntelliJ Idea FREE for 6 months, then 20% off the regular price!
- As a Bindows customer you can get IntelliJ Idea FREE for 6 months (including subscription for updates). After the six months you can purchase it and get a 20% discount off the regular price!
- If you are a Bindows customer, email sales@bindows.net for your IntelliJ Idea IDE and Bindows plugin (please specify your development platform: Windows, Mac OS X, Linux) and we will email you the coupon code.
Plugin Installation & Setup
- Install from IntelliJ IDEA's built in plugin manager.
- Go into the setup screen in IntelliJ (Ctrl+Alt+S), then click the blue Bindows icon to enter the settings window for the plugin.
- Add a reference to a Bindows distribution directory.
- Make sure the server port used by the plugin is not used by some other process on your system.
The default port used by the plugin is 18088 which is usually free. - If you select a port that is currently in use you will receive a message declaring that so you should choose another.
- If you have installed your browsers to non-default locations you need to tell the plugin where they are. Other than that it should work out of the box.
Optionally, if you want to see what is inside the plugin or maybe take a look at the logging library BiLog.js, the plugin Jar file is located at C:\Documents and Settings\homedir\.IntelliJIdea70\config\plugins on Windows.
MUST READ: Enable the Plugin
When you first install the plugin you will not see any tool windows or icons related to Bindows - this is as normal and as intended.
You must enable the "Bindows facet" for at least one of your modules in your IntelliJ IDEA project. Here are the steps how to do this:
- Go to File->Settings->Project Settings->Modules
- Click on one of your modules to select it (you may only have one)
- Click the little plus sign and select Bindows from the drop down list that appears
A Bindows icon appears under the module. If you click on it you can make module dependant settings for your Bindows project.
You also have the option to enable the Bindows facet directly when you create a new project in IntelliJ IDEA. Just click the Bindows checkbox at the end of the project creation wizard.
Debugging
Setting up debugging
The plugin has a built in webserver that communicates with the
browser via
XmlHttpRequests. It's easy to setup.
1. Activate "Debug mode" in the settings window for the plugin.
2. Make sure the option obfuscated/non-obfuscated code matches what you are using.
The default option is to use obfuscated code which should be ok if you are using a clean Bindows. (non-obfuscated code is only available in retail versions of Bindows)
Logging to Console Window
This feature allows you to print information from your running application straight to the Bindows console window inside IntelliJ IDEA. Anywhere from your code you can call this method:
BiLog.out("Hello World");
There are several live templates that you can use to add this line of code without having to type it. Press Ctrl+J and start typing "blog".
Dynamic Code Evaluation
This feature allows you to send any JavaScript code to your running Bindows application and have it evaluated during runtime. To enable this feature you must tell your Bindows application to listen for commands from IntelliJ IDEA. Just call this method early in your program:
BiLog.receiveCommands(true);
By default the Bindows application checks to see if there are any new commands to be executed every two seconds. You can change this interval. Have a look inside BiLog.js, located inside the plug-in jar file, for more options. IntelliJ IDEA will buffer up commands and in a queue. They will be removed from the queue only when someone has received them. If you send a whole JavaScript function over to the browser, this will be detected and you get "function evaluated" back as a result.
Considerations
You must use IntelliJ IDEA version 7.0 or later for the plugin to work.
This is a beta version. Please contact us at support@bindows.net to suggest features and report problems.
Known Issues in Beta 6
- If there is an error in the JavaScript you're sending, such as a typo, you will get a generic error message saying "XMLHttp problems, Could not send message". In the future we will extend this with slightly more elaborate messages.
- Mac OS X: Bindows popup menus do not work in the embedded browser component of IDEA. This causes GridPanel2Designer to be unusable on Mac OS X and also normal menus to not work. Another thing to note is that the ok button on alert boxes also does not work. This is a JetBrains bug and we are waiting for a fix.
- GridPanel2Designer is currently using our online Bindows distribution. Changing your active Bindows distro does not reflect in the designer. The reason for this is that you need at least Bindows 3.0 to use the BiGridPanel2 layout manager. This has the side effect that you will not be able to use the designer if you do not have an internet connection.
Screencast
Major changes has been made since the screencast was made. The most notable ones are the addition of live templates and also the fact that BiLog.js no longer has to be included manually. It is automatically included in your application when debug mode is active. The latest schema is now also used. Another improvement is that you can change the port number that the plugins internal web server is using. The port number must match in your Bindows application but this is all taken care of dynamically by the plugin when you launch an application. Our new facet support requires you to add the facet to one of your modules as well
We leave the screencast here for those who wish to watch it anyway. It still holds some useful explanations of debugging workflow etc. A new version of the screencast will be created and uploaded here for the final release of the plugin.
This screencast describes Bindows development techniques using the new Bindows plugin for the IntelliJ IDEA development environment.