Delete QueryDB because is best the current Query class and solve the dependences
This commit is contained in:
parent
086db1b8da
commit
7736107df9
|
|
@ -1,173 +0,0 @@
|
||||||
/******************************************************************************
|
|
||||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
|
||||||
* under the terms version 2 of the GNU General Public License as published *
|
|
||||||
* by the Free Software Foundation. This program is distributed in the hope *
|
|
||||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
|
||||||
* See the GNU General Public License for more details. *
|
|
||||||
* You should have received a copy of the GNU General Public License along *
|
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
|
||||||
* For the text or an alternative of this public license, you may reach us *
|
|
||||||
* Copyright (C) 2003-2007 e-Evolution,SC. All Rights Reserved. *
|
|
||||||
* Contributor(s): Victor Perez www.e-evolution.com *
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
package org.eevolution.model;
|
|
||||||
|
|
||||||
import java.lang.reflect.Constructor;
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
|
||||||
import java.sql.PreparedStatement;
|
|
||||||
import java.sql.ResultSet;
|
|
||||||
import java.sql.SQLException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Properties;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import org.compiere.util.CLogger;
|
|
||||||
import org.compiere.util.DB;
|
|
||||||
import org.compiere.util.Env;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Victor Perez www.e-evolution.com
|
|
||||||
*/
|
|
||||||
public class QueryDB {
|
|
||||||
|
|
||||||
private String classname;
|
|
||||||
private static CLogger log = CLogger.getCLogger (QueryDB.class);
|
|
||||||
/** Creates a new instance of POQuery */
|
|
||||||
|
|
||||||
public QueryDB(String classname)
|
|
||||||
{
|
|
||||||
this.classname = classname;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static Object newInstance(String classname, int id, String trxName )
|
|
||||||
{
|
|
||||||
Object result = null;
|
|
||||||
Class<?> args;
|
|
||||||
int begin = classname.indexOf("X_") + 2 ;
|
|
||||||
String table = classname.substring(begin);
|
|
||||||
Class<?>[] intArgsClass = new Class[] {Properties.class , int.class, String.class};
|
|
||||||
//Integer height = new Integer(12);
|
|
||||||
Integer ID = new Integer(id);
|
|
||||||
Object[] intArgs = new Object[] {Env.getCtx(), ID,table};
|
|
||||||
Constructor<?> intArgsConstructor;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
|
|
||||||
args = Class.forName(classname);
|
|
||||||
intArgsConstructor =
|
|
||||||
args.getConstructor(intArgsClass);
|
|
||||||
result = createObject(intArgsConstructor, intArgs);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
catch (ClassNotFoundException e)
|
|
||||||
{
|
|
||||||
System.out.println(e);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
catch (NoSuchMethodException e)
|
|
||||||
{
|
|
||||||
System.out.println(e);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Object createObject(Constructor<?> constructor,
|
|
||||||
Object[] arguments) {
|
|
||||||
|
|
||||||
log.fine("Constructor: " + constructor.toString());
|
|
||||||
|
|
||||||
Object object = null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
object = constructor.newInstance(arguments);
|
|
||||||
//System.out.println ("Object: " + object.toString());
|
|
||||||
return object;
|
|
||||||
} catch (InstantiationException e) {
|
|
||||||
log.log(Level.SEVERE,"InstantiationException:" + e);
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
log.log(Level.SEVERE,"IllegalAccessException:" + e);
|
|
||||||
} catch (IllegalArgumentException e) {
|
|
||||||
log.log(Level.SEVERE,"IllegalArgumentExceptio:" + e);
|
|
||||||
} catch (InvocationTargetException e) {
|
|
||||||
log.log(Level.SEVERE,"InvocationTargetException:" + e);
|
|
||||||
}
|
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Object> execute(String filter) {
|
|
||||||
log.fine((new Integer(classname.indexOf("X_"))).toString());
|
|
||||||
|
|
||||||
int begin = classname.indexOf("X_") + 2 ;
|
|
||||||
String table = classname.substring(begin);
|
|
||||||
StringBuffer sql = new StringBuffer("SELECT ").append(table).append("_ID FROM " + table);
|
|
||||||
if (filter.equals(""))
|
|
||||||
System.out.println("not exist filter");
|
|
||||||
else
|
|
||||||
sql.append(" WHERE ").append(filter);
|
|
||||||
|
|
||||||
log.fine("Query =" + sql.toString());
|
|
||||||
|
|
||||||
List<Object> results = new ArrayList<Object>();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null);
|
|
||||||
ResultSet rs = pstmt.executeQuery();
|
|
||||||
while (rs.next())
|
|
||||||
{
|
|
||||||
int id = rs.getInt(1);
|
|
||||||
Object element = newInstance(classname , id, table);
|
|
||||||
results.add(element);
|
|
||||||
}
|
|
||||||
rs.close();
|
|
||||||
pstmt.close();
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
log.log(Level.SEVERE,"VCreateFrom.initIOS - Order\nSQL=" + sql.toString(), e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public List<Object> execute() {
|
|
||||||
|
|
||||||
int begin = classname.indexOf("X_") + 2 ;
|
|
||||||
String table = classname.substring(begin);
|
|
||||||
StringBuffer sql = new StringBuffer("SELECT ").append(table).append("_ID FROM " + table);
|
|
||||||
|
|
||||||
List<Object> results = new ArrayList<Object>();
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
PreparedStatement pstmt = DB.prepareStatement(sql.toString(), null);
|
|
||||||
ResultSet rs = pstmt.executeQuery();
|
|
||||||
while (rs.next())
|
|
||||||
{
|
|
||||||
int id = rs.getInt(1);
|
|
||||||
Object element = newInstance(classname , id, table);
|
|
||||||
results.add(element);
|
|
||||||
}
|
|
||||||
rs.close();
|
|
||||||
pstmt.close();
|
|
||||||
}
|
|
||||||
catch (SQLException e)
|
|
||||||
{
|
|
||||||
log.log(Level.SEVERE,"VCreateFrom.initIOS - Order\nSQL=" + sql.toString(), e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return results;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -33,7 +33,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
import java.util.List;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
|
|
@ -47,16 +47,17 @@ import javax.swing.tree.TreeModel;
|
||||||
import javax.swing.tree.TreeNode;
|
import javax.swing.tree.TreeNode;
|
||||||
import javax.swing.tree.TreePath;
|
import javax.swing.tree.TreePath;
|
||||||
|
|
||||||
import org.compiere.model.X_C_UOM;
|
import org.compiere.model.MProduct;
|
||||||
import org.compiere.model.X_M_Product;
|
import org.compiere.model.MUOM;
|
||||||
|
import org.compiere.model.Query;
|
||||||
import org.compiere.util.CLogger;
|
import org.compiere.util.CLogger;
|
||||||
import org.compiere.util.DB;
|
import org.compiere.util.DB;
|
||||||
import org.compiere.util.Env;
|
import org.compiere.util.Env;
|
||||||
import org.compiere.util.KeyNamePair;
|
import org.compiere.util.KeyNamePair;
|
||||||
import org.compiere.util.Msg;
|
import org.compiere.util.Msg;
|
||||||
import org.eevolution.model.QueryDB;
|
import org.eevolution.model.MPPProductBOM;
|
||||||
import org.eevolution.model.X_PP_Product_BOM;
|
import org.eevolution.model.MPPProductBOMLine;
|
||||||
import org.eevolution.model.X_PP_Product_BOMLine;
|
|
||||||
|
|
||||||
|
|
||||||
public class RadioButtonTreeCellRenderer implements CheckboxTreeCellRenderer {
|
public class RadioButtonTreeCellRenderer implements CheckboxTreeCellRenderer {
|
||||||
|
|
@ -113,40 +114,40 @@ public class RadioButtonTreeCellRenderer implements CheckboxTreeCellRenderer {
|
||||||
/**
|
/**
|
||||||
* Action: Fill Tree with all nodes
|
* Action: Fill Tree with all nodes
|
||||||
*/
|
*/
|
||||||
public DefaultMutableTreeNode action_loadBOM(X_M_Product Product, boolean setRoot)
|
public DefaultMutableTreeNode action_loadBOM(MProduct Product, boolean setRoot)
|
||||||
{
|
{
|
||||||
int M_Product_ID = Product.get_ID();
|
int M_Product_ID = Product.get_ID();
|
||||||
X_M_Product M_Product = new X_M_Product(Env.getCtx(), M_Product_ID,"M_Product");
|
MProduct M_Product = MProduct.get(Env.getCtx(), M_Product_ID);
|
||||||
X_C_UOM C_UOM = new X_C_UOM(Env.getCtx() , M_Product.getC_UOM_ID(), "C_UOM");
|
MUOM UOM = new MUOM(Env.getCtx() , M_Product.getC_UOM_ID(), null);
|
||||||
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new nodeUserObject(Msg.translate(Env.getCtx(), "M_Product_ID") + Msg.translate(Env.getCtx(), "Value") + ": " + M_Product.getValue() + " " + Msg.translate(Env.getCtx(), "Name") + ": " +M_Product.getName() + " " + Msg.translate(Env.getCtx(), "C_UOM_ID") + ": " + C_UOM.getName(), M_Product, null, null));
|
DefaultMutableTreeNode root = new DefaultMutableTreeNode(new nodeUserObject(Msg.translate(Env.getCtx(), "M_Product_ID") + Msg.translate(Env.getCtx(), "Value") + ": " + M_Product.getValue() + " " + Msg.translate(Env.getCtx(), "Name") + ": " +M_Product.getName() + " " + Msg.translate(Env.getCtx(), "C_UOM_ID") + ": " + UOM.getName(), M_Product, null, null));
|
||||||
if(setRoot) {
|
if(setRoot) {
|
||||||
this.root = root;
|
this.root = root;
|
||||||
}
|
}
|
||||||
dataBOM.clear();
|
dataBOM.clear();
|
||||||
if (false)
|
if (false)
|
||||||
{
|
{
|
||||||
QueryDB query = new QueryDB("org.eevolution.model.X_PP_Product_BOMLine");
|
String whereClause = "M_Product_ID=?";
|
||||||
String filter = "M_Product_ID=" + M_Product_ID;
|
List<MPPProductBOMLine> bomlines = new Query(Env.getCtx(),MPPProductBOMLine.Table_Name,whereClause, null)
|
||||||
java.util.List<Object> results = query.execute(filter);
|
.setParameters(new Object[]{M_Product_ID})
|
||||||
Iterator<Object> select = results.iterator();
|
.list();
|
||||||
while (select.hasNext())
|
for (MPPProductBOMLine bomline : bomlines)
|
||||||
{
|
{
|
||||||
X_PP_Product_BOMLine bomline = (X_PP_Product_BOMLine) select.next();
|
root.add(parent(bomline));
|
||||||
root.add(parent(bomline));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QueryDB query = new QueryDB("org.eevolution.model.X_PP_Product_BOM");
|
String whereClause = "M_Product_ID=?";
|
||||||
String filter = " IsActive='Y' AND M_Product_ID =" + M_Product_ID;
|
List<MPPProductBOM> boms = new Query(Env.getCtx(),MPPProductBOM.Table_Name,whereClause, null)
|
||||||
java.util.List<Object> results = query.execute(filter);
|
.setParameters(new Object[]{M_Product_ID})
|
||||||
Iterator<Object> select = results.iterator();
|
.setOnlyActiveRecords(true)
|
||||||
while (select.hasNext())
|
.list();
|
||||||
|
for (MPPProductBOM bom : boms)
|
||||||
{
|
{
|
||||||
X_PP_Product_BOM bom = (X_PP_Product_BOM) select.next();
|
|
||||||
DefaultMutableTreeNode child = parent(bom);
|
DefaultMutableTreeNode child = parent(bom);
|
||||||
root.add(child);
|
root.add(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
log.fine("root.getChildCount: " + root.getChildCount());
|
log.fine("root.getChildCount: " + root.getChildCount());
|
||||||
if(root.getChildCount() > 0) {
|
if(root.getChildCount() > 0) {
|
||||||
|
|
@ -160,15 +161,15 @@ public class RadioButtonTreeCellRenderer implements CheckboxTreeCellRenderer {
|
||||||
|
|
||||||
} // action_fillTree
|
} // action_fillTree
|
||||||
|
|
||||||
public DefaultMutableTreeNode parent(X_PP_Product_BOMLine bomline)
|
public DefaultMutableTreeNode parent(MPPProductBOMLine bomline)
|
||||||
{
|
{
|
||||||
log.fine("In parent with X_PP_Product_BOMLine");
|
log.fine("In parent with X_PP_Product_BOMLine");
|
||||||
|
|
||||||
X_M_Product M_Product = new X_M_Product(Env.getCtx(), bomline.getM_Product_ID(),"M_Product");
|
MProduct M_Product = MProduct.get(Env.getCtx(), bomline.getM_Product_ID());
|
||||||
X_C_UOM C_UOM = new X_C_UOM(Env.getCtx() , M_Product.getC_UOM_ID(),"C_UOM");
|
MUOM UOM = new MUOM(Env.getCtx() , M_Product.getC_UOM_ID(),null);
|
||||||
|
|
||||||
X_PP_Product_BOM bomproduct = new X_PP_Product_BOM(Env.getCtx(),bomline.getPP_Product_BOM_ID(),"PP_Product_BOM");
|
MPPProductBOM bomproduct = new MPPProductBOM(Env.getCtx(),bomline.getPP_Product_BOM_ID(),null);
|
||||||
DefaultMutableTreeNode parent = new DefaultMutableTreeNode(new nodeUserObject(Msg.translate(Env.getCtx(), "M_Product_ID") + Msg.translate(Env.getCtx(), "key") + ": " + M_Product.getValue() + " " + Msg.translate(Env.getCtx(), "Name") + ": " +M_Product.getName() + " " + Msg.translate(Env.getCtx(), "C_UOM_ID") + ": " + C_UOM.getName(), M_Product, bomproduct, bomline));
|
DefaultMutableTreeNode parent = new DefaultMutableTreeNode(new nodeUserObject(Msg.translate(Env.getCtx(), "M_Product_ID") + Msg.translate(Env.getCtx(), "key") + ": " + M_Product.getValue() + " " + Msg.translate(Env.getCtx(), "Name") + ": " +M_Product.getName() + " " + Msg.translate(Env.getCtx(), "C_UOM_ID") + ": " + UOM.getName(), M_Product, bomproduct, bomline));
|
||||||
|
|
||||||
|
|
||||||
Vector<Comparable<?>> line = new Vector<Comparable<?>>(17);
|
Vector<Comparable<?>> line = new Vector<Comparable<?>>(17);
|
||||||
|
|
@ -193,37 +194,36 @@ public class RadioButtonTreeCellRenderer implements CheckboxTreeCellRenderer {
|
||||||
line.add( (BigDecimal) bomline.getForecast()); // 16 Forecast
|
line.add( (BigDecimal) bomline.getForecast()); // 16 Forecast
|
||||||
dataBOM.add(line);
|
dataBOM.add(line);
|
||||||
|
|
||||||
QueryDB query = new QueryDB("org.eevolution.model.X_PP_Product_BOM");
|
String whereClause = "M_Product_ID=?";
|
||||||
String filter = "M_Product_ID = " + bomproduct.getM_Product_ID();
|
List<MPPProductBOM> boms = new Query(Env.getCtx(),MPPProductBOM.Table_Name,whereClause, null)
|
||||||
java.util.List<Object> results = query.execute(filter);
|
.setParameters(new Object[]{bomproduct.getM_Product_ID()})
|
||||||
Iterator<Object> select = results.iterator();
|
.setOnlyActiveRecords(true)
|
||||||
while (select.hasNext())
|
.list();
|
||||||
|
for (MPPProductBOM bom : boms)
|
||||||
{
|
{
|
||||||
X_PP_Product_BOM bom = (X_PP_Product_BOM) select.next();
|
MProduct component = MProduct.get(Env.getCtx(), bom.getM_Product_ID());
|
||||||
X_M_Product component = new X_M_Product(Env.getCtx(), bom.getM_Product_ID(),"M_Product");
|
|
||||||
return component(component, bom, bomline);
|
return component(component, bom, bomline);
|
||||||
}
|
}
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultMutableTreeNode parent(X_PP_Product_BOM bom)
|
public DefaultMutableTreeNode parent(MPPProductBOM bom)
|
||||||
{
|
{
|
||||||
|
|
||||||
log.fine("Parent:" + bom.getName());
|
log.fine("Parent:" + bom.getName());
|
||||||
X_M_Product product = new X_M_Product(Env.getCtx(), bom.getM_Product_ID(),"M_Product");
|
MProduct product = MProduct.get(Env.getCtx(), bom.getM_Product_ID());
|
||||||
|
|
||||||
//vparent.setValue(m_product_id);
|
//vparent.setValue(m_product_id);
|
||||||
String data = Msg.translate(Env.getCtx(), "PP_Product_BOM_ID") + " " + Msg.translate(Env.getCtx(), "Value") + ":"+ bom.getValue()+ " " + Msg.translate(Env.getCtx(), "Name") + ": " + bom.getName();
|
String data = Msg.translate(Env.getCtx(), "PP_Product_BOM_ID") + " " + Msg.translate(Env.getCtx(), "Value") + ":"+ bom.getValue()+ " " + Msg.translate(Env.getCtx(), "Name") + ": " + bom.getName();
|
||||||
DefaultMutableTreeNode parent = new DefaultMutableTreeNode(new nodeUserObject(data, product, bom, null));
|
DefaultMutableTreeNode parent = new DefaultMutableTreeNode(new nodeUserObject(data, product, bom, null));
|
||||||
|
|
||||||
QueryDB query = new QueryDB("org.eevolution.model.X_PP_Product_BOMLine");
|
String whereClause = "PP_Product_BOM_ID=?";
|
||||||
String filter = "PP_Product_BOM_ID=" + bom.getPP_Product_BOM_ID();
|
List<MPPProductBOMLine> bomlines = new Query(Env.getCtx(),MPPProductBOMLine.Table_Name,whereClause, null)
|
||||||
java.util.List<Object> results = query.execute(filter);
|
.setParameters(new Object[]{bom.getPP_Product_BOM_ID()})
|
||||||
Iterator<Object> select = results.iterator();
|
.list();
|
||||||
while (select.hasNext())
|
for (MPPProductBOMLine bomline : bomlines)
|
||||||
{
|
{
|
||||||
X_PP_Product_BOMLine bomline = (X_PP_Product_BOMLine) select.next();
|
MProduct component = MProduct.get(Env.getCtx(), bomline.getM_Product_ID());
|
||||||
X_M_Product component = new X_M_Product(Env.getCtx(), bomline.getM_Product_ID(),"M_Product");
|
|
||||||
//System.out.println("Componente :" + component.getValue() + "[" + component.getName() + "]");
|
//System.out.println("Componente :" + component.getValue() + "[" + component.getName() + "]");
|
||||||
//component(component);
|
//component(component);
|
||||||
Vector<Comparable<?>> line = new Vector<Comparable<?>>(17);
|
Vector<Comparable<?>> line = new Vector<Comparable<?>>(17);
|
||||||
|
|
@ -249,7 +249,6 @@ public class RadioButtonTreeCellRenderer implements CheckboxTreeCellRenderer {
|
||||||
//line.add(this.);
|
//line.add(this.);
|
||||||
dataBOM.add(line);
|
dataBOM.add(line);
|
||||||
parent.add(component(component, bom, bomline));
|
parent.add(component(component, bom, bomline));
|
||||||
|
|
||||||
}
|
}
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
@ -257,23 +256,20 @@ public class RadioButtonTreeCellRenderer implements CheckboxTreeCellRenderer {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public DefaultMutableTreeNode component(X_M_Product M_Product, X_PP_Product_BOM bomPassed, X_PP_Product_BOMLine bomlinePassed)
|
public DefaultMutableTreeNode component(MProduct M_Product, MPPProductBOM bomPassed, MPPProductBOMLine bomlinePassed)
|
||||||
{
|
{
|
||||||
|
|
||||||
//System.out.print("--------------------------------------Componet Product:" + M_Product.getName());
|
MUOM UOM = new MUOM(Env.getCtx() , M_Product.getC_UOM_ID(),null);
|
||||||
QueryDB query = new QueryDB("org.eevolution.model.X_PP_Product_BOM");
|
String whereClause = "Value=?";
|
||||||
String filter = "Value='" + M_Product.getValue() + "'";
|
List<MPPProductBOM> boms = new Query(Env.getCtx(),MPPProductBOM.Table_Name,whereClause, null)
|
||||||
X_C_UOM C_UOM = new X_C_UOM(Env.getCtx() , M_Product.getC_UOM_ID(),"C_UOM");
|
.setParameters(new Object[]{M_Product.getValue()})
|
||||||
java.util.List<Object> results = query.execute(filter);
|
.setOnlyActiveRecords(true)
|
||||||
Iterator<Object> select = results.iterator();
|
.list();
|
||||||
while (select.hasNext())
|
for (MPPProductBOM bom : boms)
|
||||||
{
|
{
|
||||||
X_PP_Product_BOM bom = (X_PP_Product_BOM) select.next();
|
|
||||||
//System.out.print("--------------------------------------Componet BOM:" + bom.getName());
|
|
||||||
return parent(bom);
|
return parent(bom);
|
||||||
}
|
}
|
||||||
|
return new DefaultMutableTreeNode(new nodeUserObject(Msg.translate(Env.getCtx(), "Value") + ": " + M_Product.getValue() + " " + Msg.translate(Env.getCtx(), "Name") + ": " +M_Product.getName() + " " + Msg.translate(Env.getCtx(), "C_UOM_ID") + ": " + UOM.getName(), M_Product, bomPassed, bomlinePassed));
|
||||||
return new DefaultMutableTreeNode(new nodeUserObject(Msg.translate(Env.getCtx(), "Value") + ": " + M_Product.getValue() + " " + Msg.translate(Env.getCtx(), "Name") + ": " +M_Product.getName() + " " + Msg.translate(Env.getCtx(), "C_UOM_ID") + ": " + C_UOM.getName(), M_Product, bomPassed, bomlinePassed));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOnHotspot(int x, int y) {
|
public boolean isOnHotspot(int x, int y) {
|
||||||
|
|
@ -418,7 +414,7 @@ public class RadioButtonTreeCellRenderer implements CheckboxTreeCellRenderer {
|
||||||
|
|
||||||
log.fine("m_nodeUserObjectParent.bom.pp_product_bom_id: " + m_nodeUserObjectParent.bom.get_ID());
|
log.fine("m_nodeUserObjectParent.bom.pp_product_bom_id: " + m_nodeUserObjectParent.bom.get_ID());
|
||||||
log.fine("m_nodeUserObject.M_Product.get_ID: " + m_nodeUserObject.M_Product.get_ID());
|
log.fine("m_nodeUserObject.M_Product.get_ID: " + m_nodeUserObject.M_Product.get_ID());
|
||||||
if(getComponentTypeUsingBOMParent(m_nodeUserObjectParent.bom.get_ID(), m_nodeUserObject.M_Product.get_ID()).equals(X_PP_Product_BOMLine.COMPONENTTYPE_Variant) || getComponentTypeUsingBOMParent(m_nodeUserObjectParent.bom.get_ID(), m_nodeUserObject.M_Product.get_ID()).equals(X_PP_Product_BOMLine.COMPONENTTYPE_Component)) {
|
if(getComponentTypeUsingBOMParent(m_nodeUserObjectParent.bom.get_ID(), m_nodeUserObject.M_Product.get_ID()).equals(MPPProductBOMLine.COMPONENTTYPE_Variant) || getComponentTypeUsingBOMParent(m_nodeUserObjectParent.bom.get_ID(), m_nodeUserObject.M_Product.get_ID()).equals(MPPProductBOMLine.COMPONENTTYPE_Component)) {
|
||||||
log.fine("Type is checkbox");
|
log.fine("Type is checkbox");
|
||||||
if(!m_nodeUserObject.isCheckbox) {
|
if(!m_nodeUserObject.isCheckbox) {
|
||||||
m_nodeUserObject.isCheckbox = true;
|
m_nodeUserObject.isCheckbox = true;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue