本文整理汇总了Java中com.odoo.core.orm.fields.types.OSelection类的典型用法代码示例。如果您正苦于以下问题:Java OSelection类的具体用法?Java OSelection怎么用?Java OSelection使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OSelection类属于com.odoo.core.orm.fields.types包,在下文中一共展示了OSelection类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPos
import com.odoo.core.orm.fields.types.OSelection; //导入依赖的package包/类
private int getPos() {
if (mResourceArray != -1 && mValue != null) {
return Integer.parseInt(mValue.toString());
} else if (mCol.getType().isAssignableFrom(OSelection.class)) {
if (items.size() <= 0) {
createItems();
}
for (ODataRow item : items) {
int index = items.indexOf(item);
if (item.getString("key").equals(mValue.toString())) {
return index;
}
}
} else {
ODataRow rec = getValueForM2O();
if (rec != null) {
return rec.getInt(OColumn.ROW_ID);
}
}
return -1;
}
示例2: getLabel
import com.odoo.core.orm.fields.types.OSelection; //导入依赖的package包/类
public String getLabel(String column, String key) {
OColumn col = getColumn(column);
if (col.getType().isAssignableFrom(OSelection.class)) {
return col.getSelectionMap().get(key);
}
return "false";
}
示例3: onItemSelected
import com.odoo.core.orm.fields.types.OSelection; //导入依赖的package包/类
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position,
long id) {
if (mResourceArray != -1) {
mValue = position;
} else if (mCol.getType().isAssignableFrom(OSelection.class)) {
ODataRow row = mAdapter.getItem(position);
mValue = row.getString("key");
} else {
mValue = items.get(position).get(OColumn.ROW_ID);
}
setValue(mValue);
}
示例4: getType
import com.odoo.core.orm.fields.types.OSelection; //导入依赖的package包/类
private <T> FieldType getType(Class<T> type_class) {
try {
// Varchar
if (type_class.isAssignableFrom(OVarchar.class)
|| type_class.isAssignableFrom(OInteger.class)
|| type_class.isAssignableFrom(OFloat.class)) {
return FieldType.Text;
}
// boolean
if (type_class.isAssignableFrom(OBoolean.class)) {
return FieldType.Boolean;
}
// Blob
if (type_class.isAssignableFrom(OBlob.class)) {
return FieldType.Blob;
}
// DateTime
if (type_class.isAssignableFrom(ODateTime.class)
|| type_class.isAssignableFrom(OTimestamp.class)) {
return FieldType.DateTime;
}
// Date
if (type_class.isAssignableFrom(ODate.class)) {
return FieldType.Date;
}
// Text
if (type_class.isAssignableFrom(OText.class)) {
return FieldType.Text;
}
// FIXME: WebView type
if (type_class.isAssignableFrom(OHtml.class)) {
return FieldType.Text;
}
if (type_class.isAssignableFrom(OSelection.class)) {
return FieldType.Selection;
}
// ManyToOne
if (mColumn.getRelationType() != null
&& mColumn.getRelationType() == OColumn.RelationType.ManyToOne) {
return FieldType.ManyToOne;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}