本文整理汇总了Java中org.compiere.util.KeyNamePair.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java KeyNamePair.EMPTY属性的具体用法?Java KeyNamePair.EMPTY怎么用?Java KeyNamePair.EMPTY使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.compiere.util.KeyNamePair
的用法示例。
在下文中一共展示了KeyNamePair.EMPTY属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: asClientKeyNamePair
public KeyNamePair asClientKeyNamePair()
{
if (this == ANY)
{
return KeyNamePair.EMPTY;
}
return new KeyNamePair(getAD_Client_ID(), getClientName());
}
示例2: asOrgKeyNamePair
public KeyNamePair asOrgKeyNamePair()
{
if (this == ANY)
{
return KeyNamePair.EMPTY;
}
return new KeyNamePair(getAD_Org_ID(), getOrgName());
}
示例3: getData
/**
* Return data as Array containing Value/KeyNamePair
*
* @param mandatory if not mandatory, an additional empty value is inserted
* @param onlyValidated only validated
* @param onlyActive only active
* @param temporary force load for temporary display
* @return list
*/
@Override
public List<Object> getData(boolean mandatory, boolean onlyValidated, boolean onlyActive, boolean temporary)
{
// create list
final ILookupData data = getData(onlyValidated, true); // loadParent=true
final List<Object> list = new ArrayList<Object>(data.getValues());
// Remove inactive values
if (onlyActive && data.hasInactiveValues())
{
for (final Iterator<Object> it = list.iterator(); it.hasNext();)
{
final Object o = it.next();
if (o != null)
{
String s = o.toString();
if (s.startsWith(INACTIVE_S) && s.endsWith(INACTIVE_E))
{
it.remove();
}
}
}
}
// Add Optional (empty) selection
if (!mandatory)
{
final NamePair emptyItem;
if (m_info.getKeyColumnFQ() != null && isNumbericKey())
{
emptyItem = KeyNamePair.EMPTY;
}
else
{
emptyItem = ValueNamePair.EMPTY;
}
list.add(0, emptyItem);
}
return list;
}