IDEMPIERE-455 Discover and fix FindBugs problems / Eclipse warning -> deprecated (Thanks to Richard Morales)

This commit is contained in:
Carlos Ruiz 2012-12-15 19:33:37 -05:00
parent 9362bcaed2
commit b1275ae52b
37 changed files with 73 additions and 63 deletions

View File

@ -14,7 +14,6 @@
package event.test; package event.test;
import org.adempiere.base.event.AbstractEventHandler; import org.adempiere.base.event.AbstractEventHandler;
import org.adempiere.base.event.IEventManager;
import org.adempiere.base.event.IEventTopics; import org.adempiere.base.event.IEventTopics;
import org.adempiere.base.event.LoginEventData; import org.adempiere.base.event.LoginEventData;
import org.compiere.model.I_C_BP_Group; import org.compiere.model.I_C_BP_Group;

View File

@ -238,7 +238,7 @@ public class CostUpdate extends SvrProcess
*/ */
private boolean createNew (MProduct product, MAcctSchema as) private boolean createNew (MProduct product, MAcctSchema as)
{ {
MCost cost = MCost.get(product, 0, as, 0, m_ce.getM_CostElement_ID()); MCost cost = MCost.get(product, 0, as, 0, m_ce.getM_CostElement_ID(), get_TrxName());
if (cost.is_new()) if (cost.is_new())
return cost.save(); return cost.save();
return false; return false;
@ -362,7 +362,7 @@ public class CostUpdate extends SvrProcess
MCostElement ce = getCostElement(TO_AverageInvoice); MCostElement ce = getCostElement(TO_AverageInvoice);
if (ce == null) if (ce == null)
throw new AdempiereSystemError("CostElement not found: " + TO_AverageInvoice); throw new AdempiereSystemError("CostElement not found: " + TO_AverageInvoice);
MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID()); MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID(), get_TrxName());
if (xCost != null) if (xCost != null)
retValue = xCost.getCurrentCostPrice(); retValue = xCost.getCurrentCostPrice();
} }
@ -372,7 +372,7 @@ public class CostUpdate extends SvrProcess
MCostElement ce = getCostElement(TO_AverageInvoice); MCostElement ce = getCostElement(TO_AverageInvoice);
if (ce == null) if (ce == null)
throw new AdempiereSystemError("CostElement not found: " + TO_AverageInvoice); throw new AdempiereSystemError("CostElement not found: " + TO_AverageInvoice);
MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID()); MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID(), get_TrxName());
if (xCost != null) if (xCost != null)
retValue = xCost.getHistoryAverage(); retValue = xCost.getHistoryAverage();
} }
@ -383,7 +383,7 @@ public class CostUpdate extends SvrProcess
MCostElement ce = getCostElement(TO_AveragePO); MCostElement ce = getCostElement(TO_AveragePO);
if (ce == null) if (ce == null)
throw new AdempiereSystemError("CostElement not found: " + TO_AveragePO); throw new AdempiereSystemError("CostElement not found: " + TO_AveragePO);
MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID()); MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID(), get_TrxName());
if (xCost != null) if (xCost != null)
retValue = xCost.getCurrentCostPrice(); retValue = xCost.getCurrentCostPrice();
} }
@ -393,7 +393,7 @@ public class CostUpdate extends SvrProcess
MCostElement ce = getCostElement(TO_AveragePO); MCostElement ce = getCostElement(TO_AveragePO);
if (ce == null) if (ce == null)
throw new AdempiereSystemError("CostElement not found: " + TO_AveragePO); throw new AdempiereSystemError("CostElement not found: " + TO_AveragePO);
MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID()); MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID(), get_TrxName());
if (xCost != null) if (xCost != null)
retValue = xCost.getHistoryAverage(); retValue = xCost.getHistoryAverage();
} }
@ -404,7 +404,7 @@ public class CostUpdate extends SvrProcess
MCostElement ce = getCostElement(TO_FiFo); MCostElement ce = getCostElement(TO_FiFo);
if (ce == null) if (ce == null)
throw new AdempiereSystemError("CostElement not found: " + TO_FiFo); throw new AdempiereSystemError("CostElement not found: " + TO_FiFo);
MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID()); MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID(), get_TrxName());
if (xCost != null) if (xCost != null)
retValue = xCost.getCurrentCostPrice(); retValue = xCost.getCurrentCostPrice();
} }
@ -419,7 +419,7 @@ public class CostUpdate extends SvrProcess
MCostElement ce = getCostElement(TO_LastInvoicePrice); MCostElement ce = getCostElement(TO_LastInvoicePrice);
if (ce != null) if (ce != null)
{ {
MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID()); MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID(), get_TrxName());
if (xCost != null) if (xCost != null)
retValue = xCost.getCurrentCostPrice(); retValue = xCost.getCurrentCostPrice();
} }
@ -438,7 +438,7 @@ public class CostUpdate extends SvrProcess
MCostElement ce = getCostElement(TO_LastPOPrice); MCostElement ce = getCostElement(TO_LastPOPrice);
if (ce != null) if (ce != null)
{ {
MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID()); MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID(), get_TrxName());
if (xCost != null) if (xCost != null)
retValue = xCost.getCurrentCostPrice(); retValue = xCost.getCurrentCostPrice();
} }
@ -457,7 +457,7 @@ public class CostUpdate extends SvrProcess
MCostElement ce = getCostElement(TO_LiFo); MCostElement ce = getCostElement(TO_LiFo);
if (ce == null) if (ce == null)
throw new AdempiereSystemError("CostElement not found: " + TO_LiFo); throw new AdempiereSystemError("CostElement not found: " + TO_LiFo);
MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID()); MCost xCost = MCost.get(getCtx(), cost.getAD_Client_ID(), cost.getAD_Org_ID(), cost.getM_Product_ID(), cost.getM_CostType_ID(), cost.getC_AcctSchema_ID(), ce.getM_CostElement_ID(), cost.getM_AttributeSetInstance_ID(), get_TrxName());
if (xCost != null) if (xCost != null)
retValue = xCost.getCurrentCostPrice(); retValue = xCost.getCurrentCostPrice();
} }

View File

@ -27,6 +27,8 @@ import java.util.Map;
import java.util.Properties; import java.util.Properties;
import java.util.Set; import java.util.Set;
import org.adempiere.exceptions.AdempiereException;
/** /**
* @author hengsin * @author hengsin
* *
@ -73,7 +75,11 @@ public class ServerContextPropertiesWrapper extends Properties {
*/ */
@Override @Override
public void save(OutputStream out, String comments) { public void save(OutputStream out, String comments) {
ServerContext.getCurrentInstance().save(out, comments); try {
ServerContext.getCurrentInstance().store(out, comments);
} catch (IOException e) {
throw new AdempiereException(e);
}
} }
/* (non-Javadoc) /* (non-Javadoc)

View File

@ -101,7 +101,7 @@ public class Doc_AssetAddition extends Doc
else if (MAssetAddition.A_SOURCETYPE_Manual.equals(assetAdd.getA_SourceType()) else if (MAssetAddition.A_SOURCETYPE_Manual.equals(assetAdd.getA_SourceType())
&& getC_Charge_ID() > 0) // backward compatibility: only if charge defined; if not fallback to product account && getC_Charge_ID() > 0) // backward compatibility: only if charge defined; if not fallback to product account
{ {
pAssetAcct = MCharge.getAccount(getC_Charge_ID(), as, null); pAssetAcct = MCharge.getAccount(getC_Charge_ID(), as);
return pAssetAcct; return pAssetAcct;
} }
else if (MAssetAddition.A_SOURCETYPE_Invoice.equals(assetAdd.getA_SourceType()) else if (MAssetAddition.A_SOURCETYPE_Invoice.equals(assetAdd.getA_SourceType())

View File

@ -455,7 +455,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
if (m_inventoryFrom == null) if (m_inventoryFrom == null)
{ {
MWarehouse wh = MWarehouse.get(getCtx(), loc.getM_Warehouse_ID()); MWarehouse wh = MWarehouse.get(getCtx(), loc.getM_Warehouse_ID());
m_inventoryFrom = new MInventory (wh); m_inventoryFrom = new MInventory (wh, get_TrxName());
m_inventoryFrom.setDescription(Msg.translate(getCtx(), "M_MovementConfirm_ID") + " " + getDocumentNo()); m_inventoryFrom.setDescription(Msg.translate(getCtx(), "M_MovementConfirm_ID") + " " + getDocumentNo());
if (!m_inventoryFrom.save(get_TrxName())) if (!m_inventoryFrom.save(get_TrxName()))
{ {
@ -497,7 +497,7 @@ public class MMovementConfirm extends X_M_MovementConfirm implements DocAction
if (m_inventoryTo == null) if (m_inventoryTo == null)
{ {
MWarehouse wh = MWarehouse.get(getCtx(), loc.getM_Warehouse_ID()); MWarehouse wh = MWarehouse.get(getCtx(), loc.getM_Warehouse_ID());
m_inventoryTo = new MInventory (wh); m_inventoryTo = new MInventory (wh, get_TrxName());
m_inventoryTo.setDescription(Msg.translate(getCtx(), "M_MovementConfirm_ID") + " " + getDocumentNo()); m_inventoryTo.setDescription(Msg.translate(getCtx(), "M_MovementConfirm_ID") + " " + getDocumentNo());
if (!m_inventoryTo.save(get_TrxName())) if (!m_inventoryTo.save(get_TrxName()))
{ {

View File

@ -20,7 +20,6 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level; import java.util.logging.Level;

View File

@ -560,7 +560,7 @@ public class MTimeExpense extends X_S_TimeExpense implements DocAction
return m_AD_User_ID; return m_AD_User_ID;
if (getC_BPartner_ID() != 0) if (getC_BPartner_ID() != 0)
{ {
MUser[] users = MUser.getOfBPartner(getCtx(), getC_BPartner_ID()); MUser[] users = MUser.getOfBPartner(getCtx(), getC_BPartner_ID(), get_TrxName());
if (users.length > 0) if (users.length > 0)
{ {
m_AD_User_ID = users[0].getAD_User_ID(); m_AD_User_ID = users[0].getAD_User_ID();

View File

@ -1880,6 +1880,7 @@ public final class DB
* @param trxName optional Transaction Name * @param trxName optional Transaction Name
* @return next no * @return next no
*/ */
@SuppressWarnings("deprecation")
public static int getNextID (int AD_Client_ID, String TableName, String trxName) public static int getNextID (int AD_Client_ID, String TableName, String trxName)
{ {
boolean SYSTEM_NATIVE_SEQUENCE = MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false); boolean SYSTEM_NATIVE_SEQUENCE = MSysConfig.getBooleanValue(MSysConfig.SYSTEM_NATIVE_SEQUENCE,false);

View File

@ -20,6 +20,7 @@ import java.math.BigDecimal;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
import java.sql.ResultSet; import java.sql.ResultSet;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.util.Calendar;
import java.util.logging.Level; import java.util.logging.Level;
import org.compiere.model.MAcctSchemaElement; import org.compiere.model.MAcctSchemaElement;
@ -79,10 +80,12 @@ public class CashFlow extends SvrProcess {
*/ */
protected String doIt() throws Exception { protected String doIt() throws Exception {
p_dateFrom = new Timestamp(System.currentTimeMillis()); Calendar dateFrom = Calendar.getInstance();
p_dateFrom.setHours(0); dateFrom.setTimeInMillis(System.currentTimeMillis());
p_dateFrom.setMinutes(0); dateFrom.set(Calendar.HOUR_OF_DAY, 0);
p_dateFrom.setSeconds(0); dateFrom.set(Calendar.MINUTE, 0);
dateFrom.set(Calendar.SECOND, 0);
p_dateFrom = new Timestamp(dateFrom.getTimeInMillis());
p_dateFrom.setNanos(0); p_dateFrom.setNanos(0);
log.info("Calculating initial balance"); log.info("Calculating initial balance");

View File

@ -1,7 +1,6 @@
package org.adempiere.plugin.list; package org.adempiere.plugin.list;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.Vector; import java.util.Vector;
@ -13,7 +12,6 @@ import javax.swing.table.DefaultTableModel;
import org.compiere.apps.form.FormFrame; import org.compiere.apps.form.FormFrame;
import org.compiere.apps.form.FormPanel; import org.compiere.apps.form.FormPanel;
import org.compiere.apps.form.VFileImport;
import org.compiere.minigrid.MiniTable; import org.compiere.minigrid.MiniTable;
import org.compiere.swing.CPanel; import org.compiere.swing.CPanel;
import org.compiere.util.CLogger; import org.compiere.util.CLogger;

View File

@ -48,7 +48,7 @@ public class DocumentSearch extends AbstractDocumentSearch {
static CLogger log = CLogger.getCLogger(DocumentSearch.class); static CLogger log = CLogger.getCLogger(DocumentSearch.class);
@Override @Override
protected boolean openWindow(int windowId, MQuery query) { protected boolean openWindow(int windowId, MQuery query) {
final AWindow frame = new AWindow(); final AWindow frame = new AWindow(null);
AEnv.addToWindowManager(frame); AEnv.addToWindowManager(frame);
if (frame.initWindow(windowId, query)) { if (frame.initWindow(windowId, query)) {
frame.pack(); frame.pack();

View File

@ -668,7 +668,7 @@ public final class AEnv
} }
log.config(TableName + " - Record_ID=" + Record_ID + " (IsSOTrx=" + isSOTrx + ")"); log.config(TableName + " - Record_ID=" + Record_ID + " (IsSOTrx=" + isSOTrx + ")");
AWindow frame = new AWindow(); AWindow frame = new AWindow(null);
if (!frame.initWindow(AD_Window_ID, MQuery.getEqualQuery(TableName + "_ID", Record_ID))) if (!frame.initWindow(AD_Window_ID, MQuery.getEqualQuery(TableName + "_ID", Record_ID)))
return; return;
addToWindowManager(frame); addToWindowManager(frame);
@ -726,7 +726,7 @@ public final class AEnv
} }
log.config(query + " (IsSOTrx=" + isSOTrx + ")"); log.config(query + " (IsSOTrx=" + isSOTrx + ")");
AWindow frame = new AWindow(); AWindow frame = new AWindow(null);
if (!frame.initWindow(AD_Window_ID, query)) if (!frame.initWindow(AD_Window_ID, query))
return; return;
addToWindowManager(frame); addToWindowManager(frame);
@ -840,7 +840,7 @@ public final class AEnv
query.addRestriction("Record_ID", MQuery.EQUAL, Record_ID); query.addRestriction("Record_ID", MQuery.EQUAL, Record_ID);
} }
// //
AWindow frame = new AWindow(); AWindow frame = new AWindow(null);
if (!frame.initWindow(s_workflow_Window_ID, query)) if (!frame.initWindow(s_workflow_Window_ID, query))
return; return;
addToWindowManager(frame); addToWindowManager(frame);

View File

@ -118,7 +118,7 @@ public class AZoomAcross
logger.info("AD_Window_ID=" + AD_Window_ID logger.info("AD_Window_ID=" + AD_Window_ID
+ " - " + query); + " - " + query);
AWindow frame = new AWindow(); AWindow frame = new AWindow(null);
if (!frame.initWindow(AD_Window_ID, query)) if (!frame.initWindow(AD_Window_ID, query))
return; return;
AEnv.addToWindowManager(frame); AEnv.addToWindowManager(frame);

View File

@ -19,7 +19,6 @@ package org.compiere.apps;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Cursor; import java.awt.Cursor;
import java.awt.Dialog; import java.awt.Dialog;
import java.awt.FlowLayout;
import java.awt.Frame; import java.awt.Frame;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;

View File

@ -540,7 +540,7 @@ public class VAttributeGrid extends CPanel
{ {
Adempiere.startup(true); Adempiere.startup(true);
Env.setContext(Env.getCtx(), "#AD_Client_ID", 11); Env.setContext(Env.getCtx(), "#AD_Client_ID", 11);
FormFrame ff = new FormFrame(); FormFrame ff = new FormFrame(null);
ff.openForm(1111, "org.compiere.apps.form.VAttributeGrid", "Attribute Table"); ff.openForm(1111, "org.compiere.apps.form.VAttributeGrid", "Attribute Table");
ff.pack(); ff.pack();
AEnv.showCenterScreen(ff); AEnv.showCenterScreen(ff);

View File

@ -407,7 +407,7 @@ public class VPaySelect extends PaySelect implements FormPanel, ActionListener,
// Start PayPrint // Start PayPrint
int AD_Form_ID = FORM_PAYMENT_PRINT_EXPORT; // Payment Print/Export int AD_Form_ID = FORM_PAYMENT_PRINT_EXPORT; // Payment Print/Export
FormFrame ff = new FormFrame(); FormFrame ff = new FormFrame(null);
ff.openForm (AD_Form_ID); ff.openForm (AD_Form_ID);
// Set Parameter // Set Parameter
if (m_ps != null) if (m_ps != null)

View File

@ -286,7 +286,7 @@ public class VTrxMaterial extends TrxMaterial
// Zoom // Zoom
panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); panel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
AWindow frame = new AWindow(); AWindow frame = new AWindow(panel.getGraphicsConfiguration());
if (!frame.initWindow(AD_Window_ID, query)) if (!frame.initWindow(AD_Window_ID, query))
{ {
panel.setCursor(Cursor.getDefaultCursor()); panel.setCursor(Cursor.getDefaultCursor());

View File

@ -815,7 +815,7 @@ public abstract class Info extends CDialog
protected void zoom (int AD_Window_ID, MQuery zoomQuery) protected void zoom (int AD_Window_ID, MQuery zoomQuery)
{ {
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
final AWindow frame = new AWindow(); final AWindow frame = new AWindow(null);
if (!frame.initWindow(AD_Window_ID, zoomQuery)) if (!frame.initWindow(AD_Window_ID, zoomQuery))
return; return;
AEnv.addToWindowManager(frame); AEnv.addToWindowManager(frame);

View File

@ -674,7 +674,7 @@ public class WFActivity extends CPanel
// //
log.info("Zoom to AD_Window_ID=" + AD_Window_ID log.info("Zoom to AD_Window_ID=" + AD_Window_ID
+ " - " + query + " (IsSOTrx=" + IsSOTrx + ")"); + " - " + query + " (IsSOTrx=" + IsSOTrx + ")");
AWindow frame = new AWindow(); AWindow frame = new AWindow(null);
if (!frame.initWindow(AD_Window_ID, query)) if (!frame.initWindow(AD_Window_ID, query))
return; return;
AEnv.addToWindowManager(frame); AEnv.addToWindowManager(frame);
@ -684,7 +684,7 @@ public class WFActivity extends CPanel
else if (MWFNode.ACTION_UserForm.equals(node.getAction())) else if (MWFNode.ACTION_UserForm.equals(node.getAction()))
{ {
int AD_Form_ID = node.getAD_Form_ID(); int AD_Form_ID = node.getAD_Form_ID();
FormFrame ff = new FormFrame(); FormFrame ff = new FormFrame(null);
ff.openForm(AD_Form_ID); ff.openForm(AD_Form_ID);
ff.pack(); ff.pack();
AEnv.addToWindowManager(ff); AEnv.addToWindowManager(ff);

View File

@ -490,7 +490,7 @@ public class WFPanel extends CPanel
MQuery query = null; MQuery query = null;
if (m_wf != null) if (m_wf != null)
query = MQuery.getEqualQuery("AD_Workflow_ID", m_wf.getAD_Workflow_ID()); query = MQuery.getEqualQuery("AD_Workflow_ID", m_wf.getAD_Workflow_ID());
AWindow frame = new AWindow(); AWindow frame = new AWindow(null);
if (!frame.initWindow (m_WF_Window_ID, query)) if (!frame.initWindow (m_WF_Window_ID, query))
return; return;
AEnv.addToWindowManager(frame); AEnv.addToWindowManager(frame);

View File

@ -526,7 +526,7 @@ public class VLocator extends JComponent
log.info(""); log.info("");
// //
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
AWindow frame = new AWindow(); AWindow frame = new AWindow(null);
MQuery zoomQuery = new MQuery(); MQuery zoomQuery = new MQuery();
zoomQuery.addRestriction(MLocator.COLUMNNAME_M_Locator_ID, MQuery.EQUAL, getValue()); zoomQuery.addRestriction(MLocator.COLUMNNAME_M_Locator_ID, MQuery.EQUAL, getValue());

View File

@ -1412,7 +1412,7 @@ public class VLookup extends JComponent
// //
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// //
AWindow frame = new AWindow(); AWindow frame = new AWindow(null);
if (!frame.initWindow(AD_Window_ID, zoomQuery)) if (!frame.initWindow(AD_Window_ID, zoomQuery))
{ {
setCursor(Cursor.getDefaultCursor()); setCursor(Cursor.getDefaultCursor());

View File

@ -685,7 +685,7 @@ public class VPAttributeDialog extends CDialog
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
// //
int AD_Window_ID = WINDOW_LOT; // Lot int AD_Window_ID = WINDOW_LOT; // Lot
AWindow frame = new AWindow(); AWindow frame = new AWindow(null);
if (frame.initWindow(AD_Window_ID, zoomQuery)) if (frame.initWindow(AD_Window_ID, zoomQuery))
{ {
this.setVisible(false); this.setVisible(false);

View File

@ -29,8 +29,8 @@ import org.compiere.apps.AMenu;
public class SwingViewerProvider implements ReportViewerProvider { public class SwingViewerProvider implements ReportViewerProvider {
public void openViewer(ReportEngine re) { public void openViewer(ReportEngine re) {
Viewer viewer = new Viewer(re);
JFrame top = AEnv.getWindow(0); JFrame top = AEnv.getWindow(0);
Viewer viewer = new Viewer(top.getGraphicsConfiguration(), re);
if (top instanceof AMenu) if (top instanceof AMenu)
((AMenu)top).getWindowManager().add(viewer); ((AMenu)top).getWindowManager().add(viewer);
} }

View File

@ -1339,7 +1339,7 @@ public class Viewer extends CFrame
// MPrintFormat f = new MPrintFormat(Env.getCtx(), 101); // MPrintFormat f = new MPrintFormat(Env.getCtx(), 101);
// ReportEngine re = new ReportEngine(f, null); // ReportEngine re = new ReportEngine(f, null);
new Viewer(re); new Viewer(null, re);
} // main } // main
@Override @Override

View File

@ -115,7 +115,7 @@ public class WAttributeGrid extends ADForm implements EventListener<Event>
gridView.setWidth("100%"); gridView.setWidth("100%");
gridView.setHeight("100%"); gridView.setHeight("100%");
gridView.setFixedLayout(true); gridView.setSizedByContent(false);
Rows rows = new Rows(); Rows rows = new Rows();
gridSelection.appendChild(rows); gridSelection.appendChild(rows);

View File

@ -357,7 +357,7 @@ public class WTreeBOM extends TreeBOM implements IFormController, EventListener<
SimpleTreeModel model = new SimpleTreeModel(parent); SimpleTreeModel model = new SimpleTreeModel(parent);
m_tree.setPageSize(-1); m_tree.setPageSize(-1);
m_tree.setTreeitemRenderer(model); m_tree.setItemRenderer(model);
m_tree.setModel(model); m_tree.setModel(model);
} }
else else
@ -386,7 +386,7 @@ public class WTreeBOM extends TreeBOM implements IFormController, EventListener<
SimpleTreeModel model = new SimpleTreeModel(parent); SimpleTreeModel model = new SimpleTreeModel(parent);
m_tree.setPageSize(-1); m_tree.setPageSize(-1);
m_tree.setTreeitemRenderer(model); m_tree.setItemRenderer(model);
m_tree.setModel(model); m_tree.setModel(model);
} }

View File

@ -122,10 +122,10 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
*/ */
private void jbInit () throws Exception private void jbInit () throws Exception
{ {
bAddAll.setSrc("images/FastBack24.png"); bAddAll.setImage("images/FastBack24.png");
bAdd.setSrc("images/StepBack24.png"); bAdd.setImage("images/StepBack24.png");
bDelete.setSrc("images/StepForward24.png"); bDelete.setImage("images/StepForward24.png");
bDeleteAll.setSrc("images/FastForward24.png"); bDeleteAll.setImage("images/FastForward24.png");
form.setWidth("99%"); form.setWidth("99%");
form.setHeight("100%"); form.setHeight("100%");
@ -183,7 +183,7 @@ public class WTreeMaintenance extends TreeMaintenance implements IFormController
east.setSplittable(true); east.setSplittable(true);
east.setWidth("45%"); east.setWidth("45%");
centerList.setVflex(true); centerList.setVflex(true);
centerList.setFixedLayout(true); centerList.setSizedByContent(false);
centerList.addEventListener(Events.ON_SELECT, this); centerList.addEventListener(Events.ON_SELECT, this);
} // jbInit } // jbInit

View File

@ -415,7 +415,7 @@ public class WWFActivity extends ADForm implements EventListener<Event>
listbox.setModel(model); listbox.setModel(model);
listbox.setItemRenderer(renderer); listbox.setItemRenderer(renderer);
listbox.repaint(); listbox.repaint();
listbox.setFixedLayout(true); listbox.setSizedByContent(false);
return m_activities.length; return m_activities.length;
} // loadActivities } // loadActivities

View File

@ -13,6 +13,7 @@
package org.adempiere.webui.component; package org.adempiere.webui.component;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.event.EventListener;
@ -111,9 +112,13 @@ public class DatetimeBox extends Panel {
Date t = timeBox.getValue(); Date t = timeBox.getValue();
if (d != null && t != null) { if (d != null && t != null) {
d.setHours(t.getHours()); Calendar cd = Calendar.getInstance();
d.setMinutes(t.getMinutes()); cd.setTime(d);
d.setSeconds(t.getSeconds()); Calendar ct = Calendar.getInstance();
ct.setTime(t);
cd.set(cd.get(Calendar.YEAR), cd.get(Calendar.MONTH), cd.get(Calendar.DAY_OF_MONTH),
ct.get(Calendar.HOUR_OF_DAY), ct.get(Calendar.MINUTE), ct.get(Calendar.SECOND));
d = cd.getTime();
} }
return d; return d;

View File

@ -37,7 +37,7 @@ public class ListboxFactory {
WListbox dataTable = new WListbox(); WListbox dataTable = new WListbox();
dataTable.setWidth("100%"); dataTable.setWidth("100%");
dataTable.setHeight("100%"); dataTable.setHeight("100%");
dataTable.setFixedLayout(true); dataTable.setSizedByContent(false);
dataTable.setVflex(true); dataTable.setVflex(true);
return dataTable; return dataTable;

View File

@ -651,7 +651,7 @@ public abstract class InfoPanel extends Window implements EventListener<Event>,
} }
private void addDoubleClickListener() { private void addDoubleClickListener() {
Iterator<EventListener<? extends Event>> i = contentPanel.getListenerIterator(Events.ON_DOUBLE_CLICK); Iterator<EventListener<? extends Event>> i = contentPanel.getEventListeners(Events.ON_DOUBLE_CLICK).iterator();
while (i.hasNext()) { while (i.hasNext()) {
if (i.next() == this) if (i.next() == this)
return; return;

View File

@ -277,7 +277,7 @@ public class InfoSchedule extends Window implements EventListener<Event>
btnNew = new Button(); btnNew = new Button();
btnNew.setName("btnNew"); btnNew.setName("btnNew");
btnNew.setId("New"); btnNew.setId("New");
btnNew.setSrc("/images/New24.png"); btnNew.setImage("/images/New24.png");
confirmPanel.addComponentsLeft(btnNew); confirmPanel.addComponentsLeft(btnNew);
btnNew.addEventListener(Events.ON_CLICK, this); btnNew.addEventListener(Events.ON_CLICK, this);

View File

@ -30,9 +30,9 @@ import org.zkoss.zk.ui.event.EventListener;
import org.zkoss.zk.ui.event.Events; import org.zkoss.zk.ui.event.Events;
import org.zkoss.zul.Borderlayout; import org.zkoss.zul.Borderlayout;
import org.zkoss.zul.Center; import org.zkoss.zul.Center;
import org.zkoss.zul.North;
import org.zkoss.zul.Iframe; import org.zkoss.zul.Iframe;
import org.zkoss.zul.Listitem; import org.zkoss.zul.Listitem;
import org.zkoss.zul.North;
import org.zkoss.zul.Tab; import org.zkoss.zul.Tab;
import org.zkoss.zul.Toolbar; import org.zkoss.zul.Toolbar;

View File

@ -89,7 +89,7 @@ public class ADLookup {
try { try {
PreparedStatement pstmt = DB.prepareStatement( info.getSQL() ); PreparedStatement pstmt = DB.prepareStatement( info.getSQL(), null );
info.setParameters( pstmt, false ); info.setParameters( pstmt, false );
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
@ -317,7 +317,7 @@ public class ADLookup {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
try try
{ {
pstmt = DB.prepareStatement(query); pstmt = DB.prepareStatement(query, null);
pstmt.setInt(1, AD_Reference_ID); pstmt.setInt(1, AD_Reference_ID);
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
if (rs.next()) if (rs.next())
@ -385,7 +385,7 @@ public class ADLookup {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
try try
{ {
pstmt = DB.prepareStatement(query); pstmt = DB.prepareStatement(query, null);
pstmt.setString(1, m_keyColumnName); pstmt.setString(1, m_keyColumnName);
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())

View File

@ -869,7 +869,7 @@ public class Process {
+ " AND l.AD_Reference_ID=135 ORDER BY t.Name"; + " AND l.AD_Reference_ID=135 ORDER BY t.Name";
try try
{ {
PreparedStatement pstmt = DB.prepareStatement(sql); PreparedStatement pstmt = DB.prepareStatement(sql, null);
ResultSet rs = pstmt.executeQuery(); ResultSet rs = pstmt.executeQuery();
while (rs.next()) while (rs.next())
{ {

View File

@ -94,7 +94,7 @@ public class ReportInfo
{ {
try try
{ {
jasperReport = (JasperReport)JRLoader.loadObject(jasperFile.getAbsolutePath()); // Marco LOMBARDO: should refer to local. jasperReport = (JasperReport)JRLoader.loadObjectFromFile(jasperFile.getAbsolutePath()); // Marco LOMBARDO: should refer to local.
} }
catch (JRException e) catch (JRException e)
{ {
@ -156,7 +156,7 @@ public class ReportInfo
System.setProperty("jasper.reports.compile.class.path", compiere_home+"/lib/reporttools.jar;"+compiere_home+"/lib/Compiere.jar"); System.setProperty("jasper.reports.compile.class.path", compiere_home+"/lib/reporttools.jar;"+compiere_home+"/lib/Compiere.jar");
JasperCompileManager.compileReportToFile( reportFile.getAbsolutePath(), jasperFile.getAbsolutePath()); JasperCompileManager.compileReportToFile( reportFile.getAbsolutePath(), jasperFile.getAbsolutePath());
jasperFile.setLastModified( reportFile.lastModified()); jasperFile.setLastModified( reportFile.lastModified());
res = (JasperReport)JRLoader.loadObject(jasperFile.getAbsolutePath()); res = (JasperReport)JRLoader.loadObjectFromFile(jasperFile.getAbsolutePath());
} }
catch (JRException e) catch (JRException e)
{ {
@ -180,7 +180,7 @@ public class ReportInfo
ResultSet rs = null; ResultSet rs = null;
try try
{ {
pstmt = DB.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY); pstmt = DB.prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, null);
pstmt.setInt(1, AD_Process_ID); pstmt.setInt(1, AD_Process_ID);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
String path = null; String path = null;