svn changeset:2337/svn branch:trunktags/6.7.0.beta1
@@ -1,18 +1,43 @@ | |||
package com.itmill.toolkit.terminal.gwt.client; | |||
import com.google.gwt.user.client.Element; | |||
public class Util { | |||
/** | |||
* Helper method for debugging purposes. | |||
* | |||
* Stops execution on firefox browsers on a breakpoint. | |||
* | |||
* | |||
*/ | |||
public static native void browserDebugger() /*-{ | |||
if(window.console) | |||
debugger; | |||
}-*/; | |||
/** | |||
* Detects if current browser is IE6. Use to isola | |||
* | |||
* @return true if IE6 | |||
*/ | |||
public static native boolean isIE6() /*-{ | |||
var browser=$wnd.navigator.appName; | |||
var version=parseFloat($wnd.navigator.appVersion); | |||
if (browser=="Microsoft Internet Explorer" && (version < 7) ) { | |||
return true; | |||
} | |||
return false; | |||
}-*/; | |||
/** | |||
* Nulls oncontextmenu function on given element. We need to manually clear | |||
* context menu events due bad browsers memory leaks, since we GWT don't | |||
* support them. | |||
* | |||
* @param el | |||
*/ | |||
public native static void removeContextMenuEvent(Element el) /*-{ | |||
el.oncontextmenu = null; | |||
}-*/; | |||
} |
@@ -15,6 +15,7 @@ import com.google.gwt.user.client.ui.TreeListener; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
import com.itmill.toolkit.terminal.gwt.client.Util; | |||
/** | |||
* TODO dump GWT's Tree implementation and use Toolkit 4 style | |||
@@ -170,6 +171,11 @@ public class ITree extends Tree implements Paintable { | |||
attachContextMenuEvent(getElement()); | |||
} | |||
public void remove() { | |||
Util.removeContextMenuEvent(getElement()); | |||
super.remove(); | |||
} | |||
public void setSelected(boolean selected) { | |||
if(!selected && !ITree.this.multiselect) { | |||
this.setISelected(false); |