01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08:
09: package com.gwtext.client.data;
10:
11: import com.google.gwt.core.client.JavaScriptObject;
12: import com.gwtext.client.core.JsObject;
13: import com.gwtext.client.util.JavaScriptObjectHelper;
14:
15: //todo investigate addition on defaultValue, although it works only with XmlReader
16:
17: //http://extjs.com/forum/showthread.php?t=4537&page=2
18: /**
19: * Base abstract FieldDef class.
20: */
21: public abstract class FieldDef extends JsObject {
22:
23: static native void setConverter(JavaScriptObject config,
24: Converter converter)/*-{
25: config['convert'] = function(s) {
26: return converter.@com.gwtext.client.data.Converter::format(Ljava/lang/String;)(s);
27: }
28: }-*/;
29:
30: /**
31: * Return the field name.
32: *
33: * @return the field name
34: */
35: public String getName() {
36: return JavaScriptObjectHelper.getAttribute(getJsObj(), "name");
37: }
38:
39: //not adding setSortType to API as combination of data type and renderer accomplishes
40: //sort type behavior
41: //http://extjs.com/forum/showthread.php?t=1853
42: }
|