Friday, May 22, 2009

GWT disable text selection in an HTMLTable

While modifying FlexTable to handle cell selection It took me a while to figure out how to disable the native text selection behavior of the browsers on 'SHIFT+Click' events. Turns out this native javascript function does the job pretty well. I tried playing with event.preventDefault() and event.stopPropagation() but that didn't work.

private native static void disableTextSelectInternal(Element e, boolean disable)/*-{
if (disable) {
e.ondrag = function () { return false; };
e.onselectstart = function () { return false; };
e.style.MozUserSelect="none"
} else {
e.ondrag = null;
e.onselectstart = null;
e.style.MozUserSelect="text"
}
}-*/;

@Override
public void onKeyDown(KeyDownEvent event) {
if (event.isShiftKeyDown()) {
disableTextSelectInternal(table.getElement(), true);
}
...

Thursday, May 7, 2009

How to disable GZIP compression in Firefox

Not sure this is the only/best way but I used the following steps to disable gzip compression in Firefox 3.0:

  1. Type about:config in the URL bar (Accept the disclaimer)
  2. Type encoding in the filter field underneath the URL bar
  3. Doubleclick the line network.http.accept-encoding
  4. Enter the following value instead of the default: gzip;q=0,deflate;q=0
Note: See comment from Anonymous below for a possible better way of doing this. Thanks Anonymous!

Delete Flash9f.ocx - Access is denied

After installing Windows 7 on an XP partition I couldn't completely get rid of the Windows.old folder. The culprits were a few ocx and dll files left with strange permissions by Adobe Flash and Acrobat. All attempts to take ownership and delete failed.

I was finally able to delete these files easily thanks to Unlocker.

Sunday, May 3, 2009

GWT+Eclipse: NoSuchMethodError

If you get this error message while compiling a GWT module in Eclipse, go to the project Build Path and change the Order/Export tab to have the GWT-SDK module at the top.

java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.genericType()
Lorg/eclipse/jdt/internal/compiler/lookup/ReferenceBinding;
at com.google.gwt.dev.jdt.TypeRefVisitor.maybeDispatch(TypeRefVisitor.java:178)
at com.google.gwt.dev.jdt.TypeRefVisitor.endVisit(TypeRefVisitor.java:101)

Software List May '09

Here is the list of programs or utilities that I currently use to get things done. Many of them are open source and freewares, the ones that are not are marked with an asterisk.

The every day stuff:
  • OS: Windows 7 RC1 *
  • Office 2007 *
  • Firefox 3 / Chrome
  • Pidgin
  • gVim
  • SecureCRT *
  • 7zip
  • FileZilla
  • Greenshot (screen capture)
  • VLC
  • TrueCrypt
  • AutoHotkey
More specialized:
  • Wireshark (network capture)
  • WebScarab (http capture)
  • SquirrelSQL (sql client)
  • Eclipse (java coding)
  • Tomcat / Hibernate / Spring / GWT
  • PostgreSQL
  • TightVNC
  • VMWare *
  • GIMP
  • TPFanControl (keeps lap cool)
  • ClipX