Pages

Tuesday, March 24, 2015

IntelliJ IDEA 14.1 - Distraction Free Mode

IntelliJ IDEA 14.1 was released just recently with a good set of new features and improvements. Among other things, one really interesting feature that appeals to me is the new "distraction free mode".

Essentially, entering the distraction free mode means that you'd hide away everything but the editor.

The seasoned IntelliJ IDEA user would now ask, how is it different from "presentation mode" that is already available, or the full screen mode?

This is a very good question! Let's try to answer that! :)

Presentation mode

Presentation mode is designed essentially for delivering presentations. Some of my friends have adopted the presentation mode for actual coding. But to be honest, it only works fine if you have a reasonably large screen and you're not switching between windows while coding. This is how the whole screen looks like when IntelliJ IDEA is in presentation mode:

The default font size in presentation mode is much larger and can be configured in Settings -> Appearance & Behavior -> Appearance. Locate the setting at the bottom of the view:


Full screen mode

Entering the full screen means exactly that. IDE window will span the full screen area. On Mac OS X it also means that it will take the application window to another desktop, which I actually dislike very much, but it's rather a personal preference. In this mode, nothing is changed in the IDE window - all the toolbars, views, etc are preserved.

Notice all the control elements and widgets at the screenshot above?

Distraction free mode

"Distraction free mode" is actually just a fancy name that the marketers came up with :) In fact, it just means that by entering this mode you only keep the editor. This might sound like you're actually entering the presentation mode, it's an incorrect conclusion. In distraction free mode the IDE window doesn't expand to full screen and the fonts are preserved in the original configuration. Basically, we could call this mode as "Hide all toolbars" and it would probably confuse some users less.

At the screenshot above, you can see - it's only the editor that occupies the IDE window. No toolbars, no status bar, no additional views, nothing! So this is exactly what I wanted and I'm really pleased with the new feature! In addition, the text is center-aligned!

What's also cool is that in this mode I can still navigate the same way as I'm used to it in the normal mode. Navigate to the project tree:

... or call out the navigation bar:

Just have to learn the shortcuts ;)

P.S. The new distraction free mode is really cool. However, it is not quite new. In fact, all this was possible long before version 14.1. Even in earlier versions of IntelliJ IDEA you can achieve the same, just not with one mouse click or shortcut press. In the earlier Intellij IDEA versions, in the View menu, you could just hide the toobar, tool buttons, status bar and navigation bar and here you go - you have a "distraction free mode"! :) So the new feature isn't really new. It is rather just a convenience that was added on top of the existing features.

Tuesday, March 10, 2015

Packaging Java applications for Mac OS, javapackager

Stumbled upon an issue with installing muCommander on Mac. The native installer did not work, saying that the launcher is corrupted, but the portable version worked just fine via the command line:
java -jar mucommander.jar

Launching a GUI app from the command line is not convenient at all. One option is to assemble the *.app package using Launch4j. However, I didn't have enough patience to do apply the tool. So I tried looking for an alternative solution.
So I found this guide: Packaging a Java App for Distribution on a Mac. And the instructions worked just fine! Here's what I did:
1. Downloaded the appbundler utility from https://java.net/downloads/appbundler/
2. Create a build.xml file. For instance:
3. Run "bundle" task: ant bundle
Profit! :)
This is all cool and works, but the process is a bit clumsy. One has to download some strange utility and use a legacy build tool to assemble the final artifact. We should do better! So I found another documentation page: Java Platform, Standard Edition Deployment Guide: Self-Contained Application Packaging. Apparently, there's a javapackager utility included in JDK distribution that you can use to create native packages.
By running the following command in the same folder where mucommander.jar is located, it created the desired artefacts:
$JAVA_HOME/bin/javapackager -deploy -native -outdir .  -outfile mu.app \
-srcfiles mucommander.jar -appclass com.mucommander.Launcher -name "muCommander" \
-title "muCommander"
Voila!
muCommander-0_9_0 anton$ ls -l bundles/
total 269904
-rw-r--r--@ 1 anton  staff  75110066 Mar 10 23:53 muCommander-1.0.dmg
-rw-r--r--  1 anton  staff  63076596 Mar 10 23:53 muCommander-1.0.pkg
drwxr-xr-x  3 anton  staff       102 Mar 10 23:53 muCommander.app
The only missing bit there is a proper icon, which I was too lazy to bother about :)

Misconceptions about microservices

Every now and then I hear people asking questions like "How can I implement a microservice using Play framework?", or "How can I build a microservice using Spring Boot?". Every time I read this it sparks the "facepalming" reaction in me.

Repeat after me: microservice is not defined by a framework!

It doesn't matter what technology or a framework is used to implement a microservice. It is rather the domain or the functionality in isolation that defines it. Martin Fowler has written a nice article for defining the microservice and while he mentions the technology bit there, it's not about technology at all!

Captan Obvious says: if you use Play or Spring Boot to implement a microservice, it doesn't mean that those frameworks can't be used to build silos. Which also means that a microservice is a "mini-silo" :)

Monday, March 9, 2015

XRebel 2.0 Beta is available

XRebel 2.0 Beta is available for download! The new version includes profiling capabilities and it is now possible to get an overview of performance breakdown in a single HTTP request. The cool part is that XRebel shows only the minimal relevant information by filtering out a lot of irrelevant stuff. I have tested the new version with a lot of different enterprise-grade applications, including Atlassian Jira, Magnolia CMS, Liferay Portal, eXo Platform... and it works just great!

The greatest feedback so far was that the tool provided the ability to monitor JPA queries and the subsequent JDBC invocations in one go. With the new version, XRebel is turning into a real profiler, yet simple and powerful.

Disqus for Code Impossible