title: GWT - How to sort celltable column?
body: <p>I'm reading about how to add column sort functions to a cell table but I'm not understanding the code provided by google. Following is my celltable, How would I add make the nameColumn sort-able?</p>
  
     
  
  <pre class="lang-java prettyprint-override"><code>public class CellTableExample implements EntryPoint {
  
      private static class Contact {
          private String address; 
          private String name;
  
          public Contact(String name, String address) {
              super();
              this.address = address; 
              this.name = name; 
          } 
      }
  
      // The list of data to display.
        private static List&lt;Contact&gt; CONTACTS = Arrays.asList(
          new Contact("John", "123 Fourth Road asdf asdf asdfasdf"),
          new Contact("Mary", "222 Lancer Lane")
  
        );
  
      @Override
      public void onModuleLoad() {
          CellTable&lt;Contact&gt; table = new CellTable&lt;Contact&gt;(); 
  
          //address column
          TextColumn&lt;Contact&gt; addressColumn = new TextColumn&lt;Contact&gt;(){
              @Override
              public String getValue(Contact contact) {
                  return contact.address;
              }
          };
  
          //name column
          TextColumn&lt;Contact&gt; nameColumn = new TextColumn&lt;Contact&gt;(){
              @Override
              public String getValue(Contact contact) {
                  return contact.name;
              }
          };
  
          // Add the columns.
          table.addColumn(nameColumn, "Name");
          table.addColumn(addressColumn, "Address");
  
          table.setRowCount(CONTACTS.size(), true);
          table.setRowData(0, CONTACTS);
  
          RootPanel.get().add(table); 
      }
  
  }
  </code></pre>