本文整理汇总了Java中com.odoo.core.orm.fields.OColumn.ColumnDomain方法的典型用法代码示例。如果您正苦于以下问题:Java OColumn.ColumnDomain方法的具体用法?Java OColumn.ColumnDomain怎么用?Java OColumn.ColumnDomain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.odoo.core.orm.fields.OColumn
的用法示例。
在下文中一共展示了OColumn.ColumnDomain方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doInBackground
import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
@Override
protected List<ODataRow> doInBackground(String... params) {
try {
ServerDataHelper helper = mRelModel.getServerDataHelper();
ODomain domain = new ODomain();
domain.add(mRelModel.getDefaultNameColumn(), "ilike", params[0]);
if (mCol != null) {
for (String key : mCol.getDomains().keySet()) {
OColumn.ColumnDomain dom = mCol.getDomains().get(key);
domain.add(dom.getColumn(), dom.getOperator(),
dom.getValue());
}
}
OdooFields fields = new OdooFields(mRelModel.getColumns());
return helper.searchRecords(fields, domain, 10);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
示例2: getRecordItems
import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
public static List<ODataRow> getRecordItems(OModel model, OColumn column) {
List<ODataRow> items = new ArrayList<ODataRow>();
OModel rel_model = model.createInstance(column.getType());
StringBuffer whr = new StringBuffer();
List<Object> args_list = new ArrayList<Object>();
// Skipping onchange domain filter
if (!column.hasDomainFilterColumn()) {
for (String key : column.getDomains().keySet()) {
OColumn.ColumnDomain domain = column.getDomains().get(key);
if (domain.getConditionalOperator() != null) {
whr.append(domain.getConditionalOperator());
} else {
whr.append(" ");
whr.append(domain.getColumn());
whr.append(" ");
whr.append(domain.getOperator());
whr.append(" ? ");
args_list.add(domain.getValue().toString());
}
}
}
String where = null;
String[] args = null;
if (args_list.size() > 0) {
where = whr.toString();
args = args_list.toArray(new String[args_list.size()]);
}
List<ODataRow> rows = new ArrayList<>();
rows = rel_model.select(new String[]{rel_model.getDefaultNameColumn()}, where,
args, rel_model.getDefaultNameColumn());
ODataRow row = new ODataRow();
row.put(OColumn.ROW_ID, -1);
row.put(rel_model.getDefaultNameColumn(), "No " + column.getLabel() + " selected");
items.add(row);
items.addAll(rows);
return items;
}
示例3: setOnDomainFilterCallBack
import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
private void setOnDomainFilterCallBack(final OColumn column, OField field) {
LinkedHashMap<String, OColumn.ColumnDomain> filterDomain = column
.getFilterDomains();
for (String key : filterDomain.keySet()) {
OColumn.ColumnDomain domain = filterDomain.get(key);
if (domain.getColumn() != null) {
OField fld = mFormFieldControls.get(domain.getColumn());
if (fld != null) {
setFilterDomainCallback(domain, fld, field, column);
}
}
}
}
示例4: setFilterDomainCallback
import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
private void setFilterDomainCallback(OColumn.ColumnDomain domain,
final OField field, final OField oField, final OColumn column) {
field.setOnFilterDomainCallBack(domain, new IOnDomainFilterCallbacks() {
@Override
public void onFieldValueChanged(OColumn.ColumnDomain dm) {
column.addDomain(dm.getColumn(), dm.getOperator(),
dm.getValue());
column.setHasDomainFilterColumn(false);
oField.setColumn(column);
oField.resetData();
}
});
}
示例5: setOnFilterDomainCallBack
import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
/**
* Domain Filters
*
* @param domain
* @param callback
*/
public void setOnFilterDomainCallBack(OColumn.ColumnDomain domain,
IOnDomainFilterCallbacks callback) {
mColumnDomain = domain;
mOnDomainFilterCallbacks = callback;
}
示例6: onFieldValueChanged
import com.odoo.core.orm.fields.OColumn; //导入方法依赖的package包/类
public void onFieldValueChanged(OColumn.ColumnDomain domain);