IntelliJ IDEA

IntelliJ IDEA: Use Breakpoints Debugging Lombok Constructor Annotations

Posted on by  
Hubert Klein Ikkink

As a consultant I am part of a lot of different Java projects. Some of these project use Lombok. When you use a Lombok annotation code gets generated when the code is compiled. This code is not visible in the IntelliJ IDEA editor which could be a problem when you want to debug your application and need to add a breakpoint for the generated code. Suppose you have a Java class with a simple constructor without using Lombok annotations. You can place a breakpoint in the constructor and when you debug the application in IntelliJ IDEA the execution stops at the breakpoint. Now you can check for example the values of parameters that are passed into the constructor call. But when you use a Lombok annotation like @RequiredArgsConstructor the code for the constructor is generated and not visible in your editor. If you want to check the values of parameters passed into the constructor you need to set a breakpoint at the line that has the @RequiredArgsConstructor statement. When you debug your application IntelliJ IDEA will stop execution when the constructor is invoked and you can check values of parameters.

Continue reading →

Change Font Size With Mouse In IntelliJ IDEA

Posted on by  
Hubert Klein Ikkink

We can change the font size in our editor using shortcut keys in IntelliJ IDEA. But we can also use our mouse wheel to do this. We must enable this option in the settings of IntelliJ IDEA. We select the Preferences and then General | Editor. Here we select the option Change font size (Zoom) with Command+Mouse Wheel:

Continue reading →

Easy Editing ResourceBundle Property Files in IntelliJ IDEA

Posted on by  
Hubert Klein Ikkink

We can add a resourcebundle property file to our application to support internationalization (i18n). The file contains key-value pairs where the value is a localized value per supported language or locale. In IntelliJ IDEA we can easily see which keys are not yet translated. We open a resourcebundle property file and click on the ResourceBundle tab at the bottom of the editor. We get a list of all available keys on the left and on the right a text area per supported language with the translated values. If a key is not translated for all supported languages it will be colored in red. We only have to select the keys in red and fill in the values on the right for the given languages.

Continue reading →

Coloring Different Data Sources in IntelliJ IDEA

Posted on by  
Hubert Klein Ikkink

The database plugin in IntelliJ IDEA is a useful tool to work with data in databases. As long as we got a JDBC driver to connect to the database we can configure a data source. And then we can run queries, inspect the contents of tables and change data with the database tool window. It is not uncommon to have multiple data sources, for example development and test environment databases, which will have the same tables. When we open the tables or run queries we don't have a visual feedback to see to which data source such a table belongs. To have a visual feedback we can colorize our data source. This means we assign a color to a data source and when we open a table from that data source the tab color in the editor window will have a different color than other tabs or the background color of the data source objects have a color.

To add a color to a data source we must open the database tool window and right click on a data source. We select the option Color Settings... from the popup window:

Continue reading →

shadow-left