Archive

Archive for the ‘GWT’ Category

Implementing postMessage technology in GWT

April 8th, 2013 No comments

It was long time since I wrote last blog post here. I’ll do this more often now.

Today’s post will be about postMessage and how to use postMessage and GWT. In two words, postMessage is a html5 technology that allow you to exchange messages between iframe and parent and even between tabs (IE has some limitations on messages between tabs). If you want to know more about postMessage here is the few articles about:

The last one is extremely good in explanation what is postMessage and how to implement it. I used it when adopting this technology to use in GWT.

Read more…

Categories: GWT Tags: , , ,

Sort hash map keys in revert order in GWT

December 8th, 2011 No comments

This short post will be about sorting. In GWT, unfortunately, there are no descending iterator. Eclipse allow you to add it, but on compile time it just crashed. Solution is simple but not obvious, so I decided to post about this.

Task: Sort hash map with some keys in descending order. For simplicity we will take an integer keys.

Solution:

Let’s assume we have a hashMapForSort – as hash map that we need to sort. Following code below will return all your keys in descending order

List<Integer> tmp = new ArrayList<Integer>(hashMapForSort.keySet());
 
Collections.sort(tmp, new Comparator<Integer>() {
 
    @Override
    public int compare(Integer arg0, Integer arg1) {
        return -arg0.compareTo(arg1); // a little trick to have numbers in descending order
    }
 
});
 
Iterator<Integer> iter = tmp.iterator(); // create an iterator by sorted collection
while (iter.hasNext()) {
    Log.warn(iter.next() + "");
}

Actually, you can sort any objects in this way, just defining a comparator you need.

Categories: GWT Tags: ,

Why Google Web Toolkit (GWT)?

October 1st, 2011 No comments

In this article I’m going to describe my point of view on such great technology as GWT and try to explain when and why you must choose it. Because GWT adding a lot of complexity while developing applications you need to know exactly why you add this complexity to your development process and where you will receive benefits from it.  Read more…

Categories: GWT Tags: , , , ,

Patching Google Web Toolkit for compiling chrome permutation

July 17th, 2011 3 comments

Google Web Toolkit is awesome tool for creating Rich Internet Applications (RIA). It has a lot of different features to simplify work of developer and create a really reliable and fast internet application. One of the features that widely used in gwt is Deferred binding. In few words, this feature doing next thing: it provide a possibility to create browser related code and avoid any runtime checks for what is current browser. By default permutations is created for this browsers: opera, ie6, ie8, ie9 (from gwt2.3), webkits (chrome, safari), firefox. Because of very fast chrome growth sometimes renders for chrome and webkit are different. From my experience I have following problems for chrome: while parsing JSON chrome don’t save the order of keys from server (it puts keys starts with numbers on the first place), sometimes some paddings different from safari (especially when you use a lot of wrapper divs)

Read more…

Categories: GWT Tags: , , , ,