Fix [ 2051718 ] Zoom for Locator not working properly
This commit is contained in:
parent
bd89c81bf7
commit
efc23da628
|
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* 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 *
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
|
@ -16,18 +16,44 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.grid.ed;
|
package org.compiere.grid.ed;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.event.*;
|
import java.awt.Color;
|
||||||
import java.beans.*;
|
import java.awt.Component;
|
||||||
import java.sql.*;
|
import java.awt.Cursor;
|
||||||
import java.util.logging.*;
|
import java.awt.Dimension;
|
||||||
import javax.swing.*;
|
import java.awt.Insets;
|
||||||
|
import java.awt.event.ActionEvent;
|
||||||
|
import java.awt.event.ActionListener;
|
||||||
|
import java.awt.event.MouseEvent;
|
||||||
|
import java.beans.PropertyChangeEvent;
|
||||||
|
import java.beans.PropertyVetoException;
|
||||||
|
import java.sql.PreparedStatement;
|
||||||
|
import java.sql.ResultSet;
|
||||||
|
import java.sql.SQLException;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JPopupMenu;
|
||||||
|
import javax.swing.JTextField;
|
||||||
|
import javax.swing.LookAndFeel;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
|
||||||
import org.adempiere.plaf.AdempierePLAF;
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.apps.*;
|
import org.compiere.apps.AEnv;
|
||||||
import org.compiere.model.*;
|
import org.compiere.apps.AWindow;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.model.MLocator;
|
||||||
import org.compiere.util.*;
|
import org.compiere.model.MLocatorLookup;
|
||||||
|
import org.compiere.model.MQuery;
|
||||||
|
import org.compiere.model.MRole;
|
||||||
|
import org.compiere.model.MTable;
|
||||||
|
import org.compiere.model.MWarehouse;
|
||||||
|
import org.compiere.swing.CButton;
|
||||||
|
import org.compiere.swing.CMenuItem;
|
||||||
|
import org.compiere.util.CLogger;
|
||||||
|
import org.compiere.util.DB;
|
||||||
|
import org.compiere.util.Env;
|
||||||
|
import org.compiere.util.Msg;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Warehouse Locator Control
|
* Warehouse Locator Control
|
||||||
|
|
@ -229,11 +255,11 @@ public class VLocator extends JComponent
|
||||||
*/
|
*/
|
||||||
private void setValue (Object value, boolean fire)
|
private void setValue (Object value, boolean fire)
|
||||||
{
|
{
|
||||||
if (m_mLocator == null)
|
if (m_mLocator == null)
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value != null)
|
if (value != null)
|
||||||
{
|
{
|
||||||
m_mLocator.setOnly_Warehouse_ID (getOnly_Warehouse_ID ());
|
m_mLocator.setOnly_Warehouse_ID (getOnly_Warehouse_ID ());
|
||||||
|
|
@ -449,12 +475,19 @@ public class VLocator extends JComponent
|
||||||
*/
|
*/
|
||||||
private void actionZoom()
|
private void actionZoom()
|
||||||
{
|
{
|
||||||
int AD_Window_ID = 139; // hardcoded
|
int AD_Window_ID = MTable.get(Env.getCtx(), MLocator.Table_ID).getAD_Window_ID();
|
||||||
|
if (AD_Window_ID <= 0)
|
||||||
|
AD_Window_ID = 139; // hardcoded window Warehouse & Locators
|
||||||
log.info("");
|
log.info("");
|
||||||
//
|
//
|
||||||
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||||
AWindow frame = new AWindow();
|
AWindow frame = new AWindow();
|
||||||
if (!frame.initWindow(AD_Window_ID, null))
|
|
||||||
|
MQuery zoomQuery = new MQuery();
|
||||||
|
zoomQuery.addRestriction(MLocator.COLUMNNAME_M_Locator_ID, MQuery.EQUAL, getValue());
|
||||||
|
zoomQuery.setRecordCount(1); // guess
|
||||||
|
|
||||||
|
if (!frame.initWindow(AD_Window_ID, zoomQuery))
|
||||||
return;
|
return;
|
||||||
AEnv.addToWindowManager(frame);
|
AEnv.addToWindowManager(frame);
|
||||||
AEnv.showCenterScreen(frame);
|
AEnv.showCenterScreen(frame);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue