My Second Book Published

My second book “Java EE Development with Eclipse – Second Edition” has been published. One of the reasons I did not post much on the blog was this book. I had been working on the book for the past few months and I am very glad that it has been published now.

Java EE Development with Eclipse - Second Edition - Cover

JEE-Book-Cover-2

One of the challenges writing this book was the diverse topics that it covered – Servlets, JSP, JSF, JDO, EJB, JSM, SOAP, REST, Spring, Unit Testing, Debugging and trouble shooting performance and memory issues in Java applications. Separate books could be written, and books have been written, on some of these topics.

This book explains how to develop applications using these technology in Eclipse IDE. The focus is not just on how to use different technologies in JEE, but also on setting up development environment, testing, debugging and deploying applications developed using these technologies.

The book is available on the publisher’s site at bit.ly/1GryrTd.

-Ram Kulkarni

ColdFusion Thunder – It's all new IDE

Though ColdFusion Thunder is the next version of ColdFusion Builder (the last version was 2.0.1), it is like a new IDE because it’s a major re-write. Past versions of ColdFusion Builder were built on top of Aptana. I had noted some of the challenges in implementing ColdFusion Builder a couple of years back, when CFB 2.0.1 was released.

ColdFusion Builder (till version 2.0.1) used a very old version of Aptana. Aptana later re-wrote and improved their IDE and released it as Aptana Studio 3.  The integration points in Aptana Studio were changed to such an extent that integrating CFB in it would have meant re-writing it. So we decided not to base ColdFusion Thunder on Aptana and implemented many features that Aptana had contributed earlier – most notably editors for HTML, JavaScript, CSS and XML. This also meant CFML editor had to be re-written because it was based on Aptana APIs to integrate HTML, CSS and JS editors in it.

The task was huge and we, in the ColdFusion team, had been working very hard during the past two years to – first build all (or most) the features of CFB 2.0.1 in Thunder, and then to add some more features. If you have used ColdFusion Builder in the past, then you will see great performance improvements in all the editors in Thunder. Specifically you should see difference when editing large files. The memory footprint is also improved.

Here are some of the new/improved features in Thunder –  Continue reading “ColdFusion Thunder – It's all new IDE”

Code Samples for my book for Eclipse 4.3 (Kepler)

Eclipse 4.3 (Kepler) was released in June this year. There have been some changes to plugin dependencies in E4 RCP applications from version 4.2 to 4.3. I had created sample projects for my book using Eclipse 4.2. If you import those projects in Kepler, then applications would not work.

I have recreated sample projects for Kepler and have submitted them to PACKT. Hopefully they should be available for download soon.

However if you follow through code examples in the book by creating your own E4 RCP projects in Keper, then things should work fine. Eclipse RCP APIs haven’t changed, as far as code samples in the book are concerned. However some of the links mentioned in the book are different for Kepler. They are  –

Application project wizard for E4 has changed a bit in Kepler. Now you have an option to create sample content (menus and views) in the wizard. Earlier you did not have this option and the wizard used to created sample content. This option is turned off by default. If you do not select this, then no menu options would be created. In which case skeleton sample application would look different from what is explained in the book.
If you select the above option, then along with menus and toolbar button, a view is also created.

To try out examples in the book, I would recommend that you select the option to create sample content and then delete the ‘Sample Part’ from Application.e4xmi (it is in Application->Windows->Trimmed Window->Controls->Perspective Stack->Perspective->Controls->PartSashContainer->Part Stack). You can also delete Java source file for this part (SamplePart.java in codesnippetapp.parts package). This will make the skeleton project same as explained in the book.

-Ram Kulkarni

My first ever book,Instant Eclipse 4 RCP Development How-to, is published

I am happy to announce that my book titled Instant Eclipse 4 RCP Development How-to has been published by PACKT Publishing. It is a mini-book that describes specific tasks and solutions to build RCP applications using Eclipse 4.

Eclipse 4 has introduced new frameworks, APIs and tools to develop Rich Client Platform (RCP) Applications.  In this book I have taken a sample application and explained how to implement it from start to finish using Eclipse 4 SDK. The book is divided into a number of  focused tasks. Each task builds the sample application incrementally .

Here is the list of tasks covered in the book –

  • Setting up a development environment 
  • Creating a skeleton E4 application
  • Adding menu and toolbar items 
  • Adding views
  • Injecting your own objects using DI
  • Creating a pop-up menu 
  • Creating custom events and handlers 
  • Adding a keyboard shortcut 
  • Creating custom objects using DI 
  • Creating views dynamically 
  • Styling an application using CSS 
  • Customizing and exporting the application

I was contacted to write this book towards the end of last year. Initially it got delayed a bit because I was busy with other things. It was finally published yesterday.

The book is also available on Amazon.

-Ram Kulkarni

 

In-place Editing in Eclipse TreeViewer

In an Eclipse RCP application I was working on recently, I had to implement a TreeViewer with in-place editing feature. It was not easy to find all the information required to implement this, so I thought I would explain it here.

First let’s take a simple example, where hierarchical data is displayed in  a tree.
tree_viewer1

When any item in the tree is double clicked, I want to edit the value in-place.

Here is the code to create this tree, without editing support. I will first create a data model using a Map. To simplify the example, I am assuming only one level of hierarchy.

Continue reading “In-place Editing in Eclipse TreeViewer”

Implementing Eclipse Editor Plugin

I had presented a tutorial on implementing Eclipse Editor plugin a couple of years ago. Recently when I started implementing a new Eclipse editor, I was looking for that presentation, but couldn’t find it easily. I like to use my blog as reference for myself, so I thought I would post my Eclipse editor tutorial here.

For the tutorial, I created a new language called VGL (Vector Graphics Language) and built Eclipse editor plugin for it. The language is not important, and just serves the purpose for explaining how to create an editor. The tutorial starts with defining the language and then incrementally builds features of a typical Eclipse editor. I created separate projects for each step in the tutorial. There are nine Eclipse projects. Download and import project in Eclipse for each step if you want to see how it is built incrementally. The last project contains all the editor features covered in this tutorial.

Continue reading “Implementing Eclipse Editor Plugin”

Maintaining expanded/collapsed state in Eclipse TreeViewer

JFace TreeViewer is a very useful UI control for displaying hierarchical data. It is used extensively in Eclipse, for example in Project/Package/Navigator view, Outline view, Debug Variables view etc. Eclipse .org hosts a nice article on TreeViewer – How to use the JFace Tree Viewer.

To specify data and its hierarchy in the TreeViewer, you implement ITreeContentProvider interface. This interface has methods like getElements, getChildren which you need to override to provide content and structure to the TreeViewer. You would typically return array of your model objects from getElements or getChildren methods. And since it is a tree view, you can expand or collapse the nodes. The model classes for an example in the above article could be Category (book, game etc.), Book and Game. Category can have Books or Games. You might load this information from a database and pass it to the content provider object. To refresh information in the TreeViewer, you would call one of the variants of refresh() function.

Continue reading “Maintaining expanded/collapsed state in Eclipse TreeViewer”

"Access restriction" error in Eclipse plugins

I spent quite a lot of time today trying to debug “Access restriction” error in one of my Eclipse plugins. In the last four years of Eclipse plugin development, I don’t recall ever facing this issue, but today suddenly some of the imports in one of the classes in my Eclipse plugin were flagged off as errors –

Access restriction: The type ISelection is not accessible due to restriction on required library <eclipse-path>\eclipse\plugins\org.eclipse.jface_3.6.1.M20100825-0800.jar

I had seen warnings about ‘restricted access’ for some of the imports earlier, but those were for classes that Eclipse discouraged to use e,g, for internal Eclipse classes. But today I was seeing errors.

The error does not tell much about what could have gone wrong. ISelection is exported from jface plugin and it is a public interface. And I had used this class without any error in other plugins.

Continue reading “"Access restriction" error in Eclipse plugins”

Eclipse SWT GridLayout – Making the widget fill horizontally

I have been stuck with the problem of making UI widgets fill horizontally in a grid layout a few times. The solution is simple, but when I have to create UI using Eclipse SWT after a long gap, I tend to forget how I had made this work earlier, so I decided to blog about this.

I had to create a simple UI with one label and associated text box. I coded it like this –

GridLayout layout = new GridLayout(2, false);
tabContainer.setLayout(layout); //this is the parent composite

Label label1 = new Label(tabContainer, SWT.NONE);
label1.setText("Some Label:");
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = false;
label1.setLayoutData(gd);

Text txtBox1 = new Text(tabContainer, SWT.BORDER);
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
txtBox1.setLayoutData(gd);

Continue reading “Eclipse SWT GridLayout – Making the widget fill horizontally”

Developing Database Applications with WebAppRunner

WebAppRunner is the Eclipse RCP application I created to run web applications as standalone desktop applications. I had explained earlier how this application could be used by creating a demo FileList application. In this post I am going to show how WebAppRunner can be used to create Database applications.

I have created a demo application, SQLiteApp.

Continue reading “Developing Database Applications with WebAppRunner”