Thursday, April 22, 2010

Family day tomorrow @ Bangalore

   Kim Moir pointed out in her post the other day that Eclipse community is like family. Rightly said! The Eclipse Indian "Family" is huddling-up tomorrow at Bangalore for Eclipse Day India. Its an exciting time for all of us out here in the sub-continent. Just as I am adding the finishing touches to my talk, I am also figuring out which talks to attend. I'll start off with the keynote. Thanks to the volcano (whose name I cannot pronounce),  Rajesh Thakkar will be delivering the keynote. "G-Eclipse made Cloud easy !",  "OSGi Tutorial", "Let us ship it!" is my list for the morning session. Post-lunch its going to be "Splash Screen++ by Jagadeesh" (I know, the schedule says Creating Splash Screen but i've seen this guy and u don't want to overlook this lightning talk). Then its Patterns time!! "Patterns in Eclipse by Madhu Samuel." Gulp down some tea and finish up the day with "RAP" and "Unconference." The schedule can be found here.

   The last part of the day will be particularly interesting - Unconference! This is like: walk-in, register, color up the unconference board with a topic, and talk. If your talk put up on the unconference board has good enough votes you will get to speak.

   See you tomorrow!

Wednesday, March 31, 2010

Eclipse Day India 2010

  EclipseCon 2010 is wrapped up. Thanks to the community I followed the happenings of EclipseCon on planeteclipse.org and twitter - almost like live updates. The Indian Eclipse community is gearing up for a gathering in similar proportions (in the community energy level of course.) Eclipse Day India 2010 is here - April 23rd. What I like most about it is the simplicity. Just 3 kinds of talks: Lightning, Short, and Long.


  Now that the tentative agenda is out and its difficult to not choose to attend one talk over another considering the submissions. I have made my list of "favorite talks to attend." The key note is interesting. It is called "The Eclipse Way" by Dani Megert. More details about the key note here. I want to start off with lightning talks. Especially "Top 10 mistakes in Eclipse Plug-in development" by Prakash G R and "Creating a splash screen" by Jagadeesh Panchakshari. Behold! The latter lightning talk is more than its name. Most of us (or atleast I) think of an Image when it comes to a 'splash screen' but Jagadeesh has some surprises in store for us. Moving on to Short talks. I want to check out "Contributing to Eclipse and Community" by Ayushman Jain, "RAP" by Ankur Sharma, "Top 3 SWT Exceptions" by Lakshmi. Finally, finish up with "Patterns in Eclipse" by Madhu Samuel , "OSGi Tutorial" by Prakash G R. Hope the talks are scheduled in such a way that I don't miss any of my favorites :)


  The final agenda will be published here - keep watching.

Saturday, July 18, 2009

EMF @ Eclipse India Summit '09

I had the oppurtunity to speak at the Eclipse India Summit 2009. It was a joint session with me and my friend and ex-colleague Annamalai ... so we thought we'll do something different with the session ... which was for 3 hours!!! Yes the audience had to bear with us for 3 hours. We, instead of dividing the presentation content amongst ourselves wanted to be different - both of us were on stage and delivering the presentation like a dialogue. It was like Malai represented the new user or developer who's new task is to learn and do something out of EMF and i played the supposed know-something-about-EMF guy who went around answering his questions.

The session started off soon after a great lunch ... in an hall with real cozy ambience. The MC actually had to ask the ppl to stand up and had them stretching to make them alert. Then the session started off ... i was kinda petrified initialy looking at all those people eagerly waiting to take something out from the session ... the show went on frequently switching from the slides to showing running examples. We started off to a packed audience ... and finished to a packed audience. In the end both me and Malai were exhausted from all the talking and standing, but it felt good. Content and video of the slides will be uploaded soon (i m waiting with my fingers crossed.)

Monday, May 4, 2009

Help assistant widget for RCP

Everyone who's used any MS office application would have come across this annoying yet sometimes useful Office assistant. He's there to "point" us in the right direction to do something. If we've got questions (as silly as how to wrap text) he may have the "answers".

I was wondering ... RCP has a very nice help system in the form of cheatsheets, balloon help, context based help, status bar messages, etc... which will prompt the user for action/attention as required. But the help system doesn't have something like a help assistant - similar to the ones in MS Office applications. Eclipse RCP as an application is used in a variety of domains (hell even Swiss Railway people use it!) we get users who aren't aware as much and aren't willing to experiment or search to find out. I'll share some inputs I got from users who don't know much the Eclipse UI way. There are a some of them who say "How do I know that i have to right-click on the wizard to get a context-menu full of options ?" We can provide a message in the wizard page ... but that may be hard to notice.

I feel RCP help assistant widget is a better HMI mechanism than the usual status bar messages. May be the widget can be a very low on graphics, animation and high on usefulness. This is just an idea ... I thought I'll share.

Monday, February 23, 2009

PgUp and PgDwn through Editors

Today started off pretty good. My favorite music-director (composer) A R Rahman won the Best Original Score Oscar for the movie Slumdog Millionaire ... and i got a "Welcome to the Planet" mail from Planeteclipse.org

This motivated me to write something on this day ... just to keep a note. Being true to my blog's "tweakeclipse" self ... I want to tell you about a nice to have and lesser known (as far as i know) navigation feature in Eclipse Editors. You can use Ctrl + PgUp and Ctrl + PgDwn to move across the open editors! This is one more shortcut amongst many as listed in this blog entry by Nirav Thaker. One of my guru's says that this shortcut is inspired from MS Excel.

Hope this helps!

Monday, February 16, 2009

Create Maps in EMF - the other way

EMF wiki on Eclipsepedia has a post which shows you one method of creating maps in EMF.
I feel that the suggested method in wiki will not exactly allow you to access a map as it should be.
like say - myMap.put("key", value); Instead you'll have to do:

myMap.eSet(keyFeature,
"key");
myMap.eSet(valueFeature, valueObj);

After some trails here's the second method summarized in terms of steps.
To create a map using Reflective Ecore Editor:
  • create an EAttribute and set a name (let's say _map) to it.
  • set _map's EType as EMap [java.util.Map]
  • create an ETypedParameter for key and set EType accordingly
  • crate another ETypedParameter for value and set EType accordingly.

here is a snap shot of how a map looks in the Ecore Editor.

what happens behind the scenes of the editor ?
well, these lines of code are executed.


EAttribute _map = EcoreFactory.eINSTANCE.createEAttribute();
_map.setName("_map");
EGenericType _mapType = EcoreFactory.
eINSTANCE.createEGenericType();
_mapType.setEClassifier(EcorePackage.
eINSTANCE.getEMap());
// set key
EGenericType key = EcoreFactory.
eINSTANCE.createEGenericType();
key.setEClassifier(EcorePackage.
eINSTANCE.getEString());
// set key
EGenericType value = EcoreFactory.
eINSTANCE.createEGenericType();
value.setEClassifier(EcorePackage.
eINSTANCE.getEObject());
// add them
_mapType.getETypeArguments().add(key);
_mapType.getETypeArguments().add(value);
_map.setEGenericType(_mapType);


You have to use it like this:

Map _map = (Map) instance
.eGet(_mapFeature); // this is now java.util.Map
// don't forget to set the changes on _map back to instance!

Happy mapping!

Tuesday, February 10, 2009

Add branding to the XML files you generate from your EMF model

What if you want to suggest that an XML file is generated using your product?
If you look at some of these commercial tools they add a comment which proudly says "used XXX v a.b.c to generate this file." Just out of curiosity I wanted to do the same using EMF resource save api.

Guess what! It is possible to do such a thing with EMF resource api. There's this interface called ResourceHandler inside org.eclipse.emf.ecore.xmi.XMLResource.java which can be implemented as required. I have provided an example for your benifit.

public class MyResourceHandler implements ResourceHandler {

/*
* you have the file handle of the XML!
*/
public void postSave(XMLResource resource, OutputStream outputStream,
Map options) {
// append your comment here.
byte[] trailcomment = "some comment";
// enclose it in XML comment tags.
try {
outputStream.write(trailComment);
}
catch (IOException e) {

// may be log something here.
}
// do NOT close the stream here. EMF resource save will eventually do it for you.
}
}

You can find the link to the EMF newsgroup thread here.