From ac741f0218c5aba927f9cd7132c2f67309a84be2 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 13 Feb 2008 09:17:24 +0000 Subject: [PATCH] [ 1892335 ] Define custom info class at ad_column or ad_field --- base/src/org/compiere/model/GridFieldVO.java | 6 ++++++ base/src/org/compiere/model/Lookup.java | 9 +++++++++ base/src/org/compiere/model/MLookup.java | 7 +++++++ base/src/org/compiere/model/MLookupInfo.java | 2 ++ 4 files changed, 24 insertions(+) diff --git a/base/src/org/compiere/model/GridFieldVO.java b/base/src/org/compiere/model/GridFieldVO.java index 02389e20fd..fc53cc109d 100644 --- a/base/src/org/compiere/model/GridFieldVO.java +++ b/base/src/org/compiere/model/GridFieldVO.java @@ -53,6 +53,8 @@ public class GridFieldVO implements Serializable return sql; } // getSQL + private String InfoFactoryClass = null; + /** * Create Field Value Object * @param ctx context @@ -163,6 +165,9 @@ public class GridFieldVO implements Serializable // Collapse Default State else if (columnName.equalsIgnoreCase("IsCollapsedByDefault")) vo.IsCollapsedByDefault = "Y".equals(rs.getString(i)); + //Info Factory class + else if (columnName.equalsIgnoreCase("InfoFactoryClass")) + vo.InfoFactoryClass = rs.getString(i); } if (vo.Header == null) vo.Header = vo.ColumnName; @@ -539,6 +544,7 @@ public class GridFieldVO implements Serializable lookupInfo = MLookupFactory.getLookupInfo (ctx, WindowNo, AD_Column_ID, displayType, Env.getLanguage(ctx), ColumnName, AD_Reference_Value_ID, IsParent, ValidationCode); + lookupInfo.InfoFactoryClass = this.InfoFactoryClass; } catch (Exception e) // Cannot create Lookup { diff --git a/base/src/org/compiere/model/Lookup.java b/base/src/org/compiere/model/Lookup.java index fbabebc4db..c0fbf583e1 100644 --- a/base/src/org/compiere/model/Lookup.java +++ b/base/src/org/compiere/model/Lookup.java @@ -491,5 +491,14 @@ public abstract class Lookup extends AbstractListModel { return m_loaded; } + + /** + * Get custom info factory class + * @return info factory class name + */ + public String getInfoFactoryClass() + { + return ""; + } } // Lookup diff --git a/base/src/org/compiere/model/MLookup.java b/base/src/org/compiere/model/MLookup.java index 3c52f710c5..c338bdfc1d 100644 --- a/base/src/org/compiere/model/MLookup.java +++ b/base/src/org/compiere/model/MLookup.java @@ -631,6 +631,13 @@ public final class MLookup extends Lookup implements Serializable return false; } + @Override + public String getInfoFactoryClass() { + return m_info.InfoFactoryClass != null ? m_info.InfoFactoryClass : ""; + } + + + /************************************************************************** * MLookup Loader */ diff --git a/base/src/org/compiere/model/MLookupInfo.java b/base/src/org/compiere/model/MLookupInfo.java index 291d25606d..b246cc5537 100644 --- a/base/src/org/compiere/model/MLookupInfo.java +++ b/base/src/org/compiere/model/MLookupInfo.java @@ -183,6 +183,8 @@ public class MLookupInfo implements Serializable, Cloneable public String parsedValidationCode = ""; + public String InfoFactoryClass = null; + /** * String representation * @return info