Embedded browser inside Eclipse – how? what? why?


Eclipse is strong IDE and preferred choice for coding many languages. I have been using it for Java, JEE, PHP and recently started C, C++ using Eclipse. The strong plugin ecosystem has always proved of great help to get many things done at faster rate and in convenient way. Besides using Eclipse as IDE, I have also ventured into developing Plugins/Features/Product and you may notice few of my articles describing same. Few years back, I came across tools like Maqetta and online screen editors and off recently my encounter with Wix and Weebly made me think as how these technologies can be made available inside Eclipse. It was obvious that using SWT browser control, its quite easy to plug the tools described above. But to me, that’s mere hack and not delivering true Eclipse Plugin experience (experience similar to what Flash Builder provides with native component panels and clean editor area to design screens).

This lead to venturing into an undiscovered area of my technical experience but due to some reasons, I left the exploration mid way. Till that time, I had got fair understanding of SWT Browser and Browser Functions. Also I did cross ventured into embedded chromium but didn’t explore it any further and got occupied with my daily routines. Few weeks back, while playing with Wix, the long time sleeping dragon just woke up and hinted me to dig again as what options are available to deliver true experience of HTML editor inside Eclipse.

Continue reading

Eclipse product export with features


Sometime back, I started doing a formal release of one of the Eclipse RCP product, I was working on. While doing the release, I came across lot of problems. My product has very simple structure and it consists of

  1. Plug-in (Core functionality for RCP)
  2. A Feature (Contains above plug-in)
  3. Another feature (To list all the eclipse dependencies)
  4. Product definition plug-in (Contains branding and workbench details)
  5. Product definition (Created inside above plug-in)

That seems pretty simple huh!!! But while exporting above structure, I came across lot of things that one may find useful. Let evaluate everything from the beginning.
Continue reading

M2Eclipse, Maven, Eclipse and Managing Java Project with dependencies


Using Version Control System (henceforth VCS) has now become an essential part of the development life-cycle. One cannot visualize life when it comes to managing project/product releases without having well established VCS. As per my experience (and since got chance to work with only VSS and SVN, I feel SVN is the better choice – simple, easy and most important free!!!).
Continue reading

Still confused what to use – Flex Or Silverlight Or AJAX – Check Eclipse RAP


These days I am playing lot with Eclipse and its features. Be it building plugins, reading tuts & experimenting or exploring new features, every time I visit one or the other site, I find so many useful & hidden features of Eclipse. The more I try to dig into Eclipse, the bigger and deeper it gets and I wonder if there is an end.
Had some time this weekend and thought of exploring Eclipse and luckily I came across an interesting feature of Eclipse – Rich AJAX Platform (RAP). Some may find that this feature is not new and it mostly resembles to what GWT already offers. I leave that discussion for may be yet another topic. 🙂 Lets just quickly check what Eclipse RAP has stored in it.
Continue reading

Android Development – Eclipse Sneak Preview


Got some time to play with Eclipse and this time the experiment was with Android. Having heard a lot about this google’s OS and the way it is capturing mobile market, I was bit curious to find out the development tools and understand how quickly one can get into the development. Finally after spending few hours with installation and getting first application running with Android simulator, I found somethings that I would like to share with you. Just to make it clear, this article is no attempt to compare Android Eclipse plugin with other plugins.
To be frank, there was no clear intension of playing with Android, but I just stumbled upon Android full app part I article and thought of giving it a try.
Continue reading

Extending Flex Builder 3 – Building eclipse plugin


As mentioned in earlier post, I have been playing with FLEX builder and understand its extensibility APIs. After spending almost day crawling through various search engines and websites I couldn’t find a single site giving me details about how to work with MXML design editor APIs, I thought of giving up. But fortunately I could able to figure out how things actually work in FLEX Builder, and then I thought of publishing some of the details through the blog.

The next few paragraphs will talk about various APIs and options available in FLEX builder which can be used by anyone to build their own plugin in Flex Builder. While the title of the post says that “Building eclipse plugin”, it surely doesn’t describe basic steps required to build eclipse plugin. To learn basics of building eclipse plugin, you should visit other sites like java2s and yeah offcourse eclipse itself has plethora of information on building plugin.

The aim of this article is to give details about the editor used to design Flex layouts. You must have used plugins which can generate AS code, ident XML code etc in Flex builder but there are very few plugins which actually work on design editor.
Before writing any plugin code you need to make sure that you have the required environment set for plugin development. Though Eclipse comes with built in feature of plugin development, Flex builder doesn’t have built-in support for Java and plugin development project. So to get started with plugin development you need to first install plugin development and Java development feature into Flex builder. Keep it in mind that we need to build plugin inside Flex Builder, the simple reason behind this is to test your plugin code we will require sample workspace of Flex builder and that can be easily started through Flex builder. The installation of Java and Plugin development feature is only required if Flex Builder is installed as Standalone version. If you have installed Flex Builder in Eclipse you can skip this installation.

The next step is to add required Extensions and Jar files in plugin project. Make sure that you have added extensions listed in following image.

Flex builder extensions

Apart from adding above extensions you will need 3 additional Jar files which contain useful APIs. The filenames are derived.jar, mxml.jar and mxmlmodel.jar. You need to search these files in Flex plugins. Now create a default “view” using Plugin wizard available in Eclipse.
The wizard should create all the files required to build plugin.

Lets directly jump into java code and see how you can get the reference of MXML editor itself

MXMLEditor a = (MXMLEditor)getSite().getPage().getActiveEditor();

Above statement will give you the reference of current MXML editor. You need to be bit careful while using this statement as user may not always work with MXML editor (There is action script editor or user may switch from one MXML file to another or may even switch from design view to source code). So you need to logically place this code to get reference of MXML editor.
(Hint: Try to find out details about IPartListener.)

The editor object is pretty much useful to listen to the events raised in editor. An editor instance has a method called getMXMLModel which represents an MXML instance for the editor. You can use the IMXMLModel instance returned by getMXMLModel method to manipulate MXML code. The reference also provides a convenient method to listen to the user selection in design view.
Just place below code after getting IMXMLModel reference

mm.getSelectionProvider().addSelectionChangedListener(new SelectionChangeListener())

Note that the SelectionChangeListener is custom class implementing an interface ISelectionChangedListener. A method “selectionChanged” will be invoked on the above instance whenever user select control in MXML design editor. The method has one argument of “SelectionChangedEvent” which can be used to get the reference of the component selected. I leave the part of getting reference of control using instance of “SelectionChangedEvent” to you.
For demonstration, I have created a sample plugin which displays component selected in “Sample View”, check below images.
Flex Builder - Button selected

Flex Builder - checkbox selected

The story doesnt end here, I would be revealing more details about API – watch this space.

Flex Builder 3 – Plug-in Development


One of the best feature (yes there are many more) of Eclipse is extensibility. While it has been a most preferred IDE, not just for the development in Java, but for other languages like PHP, XML, HTML etc. building plugin for eclipse is pretty easy. The readymade wizards and built-in plugin templates makes life easier of developers. There are many other IDE built on top of eclipse and one amongst them – Flex Builder (or should I call it Flash Builder – version 4 has launched in market) is fantastic example of showing what eclipse is capable of.
Continue reading

Eclipse – Translation Plugin


Translation Plugin

To tell you frankly, this is dumb plugin which doesnt have any intelligence and purely dependent upon third party services to complete its job. I developed this plugin jus for project need and freeing some developer’s brain cells from remembering translation site name. 🙂 Translation plugin acts as an agent between online translation service such as Google and Babelfish.

Translation View

Translation View

Continue reading