Search in sources :

Example 1 with VLookup

use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.

the class VCreateFromRMAUI method initBPartner.

//  vetoableChange
/**************************************************************************
	 *  Load BPartner Field
	 *  @param forInvoice true if Invoices are to be created, false receipts
	 *  @throws Exception if Lookups cannot be initialized
	 */
protected void initBPartner(boolean forInvoice) throws Exception {
    //  load BPartner
    //  C_Invoice.C_BPartner_ID
    int AD_Column_ID = 3499;
    MLookup lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
    bPartnerField = new VLookup("C_BPartner_ID", true, false, true, lookup);
    //
    int C_BPartner_ID = getC_BPartner_ID();
    bPartnerField.setValue(new Integer(C_BPartner_ID));
}
Also used : MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup)

Example 2 with VLookup

use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.

the class VOrderDistribution method dynInit.

//	jbInit
/**
	 *	Dynamic Init.
	 *	- Create GridController & Panel
	 *	- AD_Column_ID from C_Order
	 */
public void dynInit() throws Exception {
    // Order Distribution
    MLookup orderL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, MColumn.getColumn_ID(MDDOrder.Table_Name, MDDOrder.COLUMNNAME_DD_Order_ID), DisplayType.Search);
    fOrder = new VLookup(MDDOrder.COLUMNNAME_DD_Order_ID, true, false, true, orderL);
    lOrder.setText(Msg.translate(Env.getCtx(), MDDOrder.COLUMNNAME_DD_Order_ID));
    fOrder.addVetoableChangeListener(this);
    lOrder.setVisible(false);
    fOrder.setVisible(false);
    MLookup llocator = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 53950, DisplayType.TableDir);
    fLocator = new VLookup(MLocator.COLUMNNAME_M_Locator_ID, true, false, true, llocator);
    lLocator.setText(Msg.translate(Env.getCtx(), "M_Locator_ID"));
    fLocator.addVetoableChangeListener(this);
    m_M_Locator_ID = fLocator.getValue();
    MLookup llocatorto = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 53949, DisplayType.TableDir);
    fLocatorTo = new VLookup("M_LocatorTo_ID", false, false, true, llocatorto);
    lLocatorTo.setText(Msg.translate(Env.getCtx(), "M_LocatorTo_ID"));
    fLocatorTo.addVetoableChangeListener(this);
    m_M_LocatorTo_ID = fLocatorTo.getValue();
    //	C_Order.C_BPartner_ID
    MLookup bpL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 2762, DisplayType.Search);
    fBPartner = new VLookup("C_BPartner_ID", false, false, true, bpL);
    lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
    fBPartner.addVetoableChangeListener(this);
    panel.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InventoryMoveGenerateSel"));
}
Also used : MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup)

Example 3 with VLookup

use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.

the class VMRPDetailed method statInit.

/**
	 * Static Setup - add fields to parameterPanel
	 * @throws Exception if Lookups cannot be initialized
	 */
private void statInit() throws Exception {
    // Resource Lookup
    // Base Language
    Language language = Language.getLoginLanguage();
    MLookup resourceL = MLookupFactory.get(getCtx(), p_WindowNo, MColumn.getColumn_ID(MResource.Table_Name, MResource.COLUMNNAME_S_Resource_ID), DisplayType.TableDir, language, MResource.COLUMNNAME_S_Resource_ID, 0, false, MResource.Table_Name + "." + MResource.COLUMNNAME_ManufacturingResourceType + "= '" + MResource.MANUFACTURINGRESOURCETYPE_Plant + "'");
    fResource_ID = new VLookup(MPPMRP.COLUMNNAME_S_Resource_ID, false, false, true, resourceL) {

        private static final long serialVersionUID = 1L;

        public void setValue(Object arg0) {
            super.setValue(arg0);
        }

        ;
    };
    lResource_ID.setLabelFor(fResource_ID);
    fResource_ID.setBackground(AdempierePLAF.getInfoBackground());
    // Planner Lookup
    fPlanner_ID = new VLookup(MPPMRP.COLUMNNAME_Planner_ID, false, false, true, MLookupFactory.get(getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPPProductPlanning.Table_Name, MPPMRP.COLUMNNAME_Planner_ID), DisplayType.Table)) {

        private static final long serialVersionUID = 1L;

        public void setValue(Object arg0) {
            super.setValue(arg0);
        }

        ;
    };
    lPlanner_ID.setLabelFor(fPlanner_ID);
    fPlanner_ID.setBackground(AdempierePLAF.getInfoBackground());
    // Wahrehouse Lookup
    fWarehouse_ID = new VLookup(MPPMRP.COLUMNNAME_M_Warehouse_ID, true, false, true, MLookupFactory.get(getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MWarehouse.Table_Name, MPPMRP.COLUMNNAME_M_Warehouse_ID), DisplayType.TableDir)) {

        private static final long serialVersionUID = 1L;

        public void setValue(Object arg0) {
            super.setValue(arg0);
        }

        ;
    };
    lWarehouse_ID.setLabelFor(fWarehouse_ID);
    fWarehouse_ID.setBackground(AdempierePLAF.getInfoBackground());
    fMaster.setSelected(false);
    fMaster.setReadWrite(false);
    fMRPReq.setSelected(false);
    fMRPReq.setReadWrite(false);
    fCreatePlan.setSelected(false);
    fCreatePlan.setReadWrite(false);
    lUOM.setText(Msg.translate(getCtx(), MUOM.COLUMNNAME_C_UOM_ID));
    fUOM.setBackground(AdempierePLAF.getInfoBackground());
    fUOM.setReadWrite(false);
    lType.setText(Msg.translate(getCtx(), MPPProductPlanning.COLUMNNAME_Order_Policy));
    fType.setBackground(AdempierePLAF.getInfoBackground());
    fType.setReadWrite(false);
    lOrderPeriod.setText(Msg.translate(getCtx(), MPPProductPlanning.COLUMNNAME_Order_Period));
    fOrderPeriod.setBackground(AdempierePLAF.getInfoBackground());
    fOrderPeriod.setReadWrite(false);
    lTimefence.setText(Msg.translate(getCtx(), MPPProductPlanning.COLUMNNAME_TimeFence));
    fTimefence.setBackground(AdempierePLAF.getInfoBackground());
    fTimefence.setReadWrite(false);
    lLeadtime.setText(Msg.translate(getCtx(), MPPProductPlanning.COLUMNNAME_DeliveryTime_Promised));
    fLeadtime.setBackground(AdempierePLAF.getInfoBackground());
    fLeadtime.setReadWrite(false);
    lMinOrd.setText(Msg.translate(getCtx(), MPPProductPlanning.COLUMNNAME_Order_Min));
    fMinOrd.setBackground(AdempierePLAF.getInfoBackground());
    fMinOrd.setReadWrite(false);
    lMaxOrd.setText(Msg.translate(getCtx(), MPPProductPlanning.COLUMNNAME_Order_Max));
    fMaxOrd.setBackground(AdempierePLAF.getInfoBackground());
    fMaxOrd.setReadWrite(false);
    lOrdMult.setText(Msg.translate(getCtx(), MPPProductPlanning.COLUMNNAME_Order_Pack));
    fOrdMult.setBackground(AdempierePLAF.getInfoBackground());
    fOrdMult.setReadWrite(false);
    lOrderQty.setText(Msg.translate(getCtx(), MPPProductPlanning.COLUMNNAME_Order_Qty));
    fOrderQty.setBackground(AdempierePLAF.getInfoBackground());
    fOrderQty.setReadWrite(false);
    lYield.setText(Msg.translate(getCtx(), MPPProductPlanning.COLUMNNAME_Yield));
    fYield.setBackground(AdempierePLAF.getInfoBackground());
    fYield.setReadWrite(false);
    lOnhand.setText(Msg.translate(getCtx(), MStorage.COLUMNNAME_QtyOnHand));
    fOnhand.setBackground(AdempierePLAF.getInfoBackground());
    fOnhand.setReadWrite(false);
    lSafetyStock.setText(Msg.translate(getCtx(), MPPProductPlanning.COLUMNNAME_SafetyStock));
    fSafetyStock.setBackground(AdempierePLAF.getInfoBackground());
    fSafetyStock.setReadWrite(false);
    lReserved.setText(Msg.translate(getCtx(), MStorage.COLUMNNAME_QtyReserved));
    fReserved.setBackground(AdempierePLAF.getInfoBackground());
    fReserved.setReadWrite(false);
    lAvailable.setText(Msg.translate(getCtx(), "QtyAvailable"));
    fAvailable.setBackground(AdempierePLAF.getInfoBackground());
    fAvailable.setReadWrite(false);
    lOrdered.setText(Msg.translate(getCtx(), MPPOrder.COLUMNNAME_QtyOrdered));
    fOrdered.setBackground(AdempierePLAF.getInfoBackground());
    fOrdered.setReadWrite(false);
    // Product Lookup
    fProduct_ID = new VLookup(MPPMRP.COLUMNNAME_M_Product_ID, true, false, true, MLookupFactory.get(getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MProduct.Table_Name, MPPMRP.COLUMNNAME_M_Product_ID), DisplayType.Search)) {

        private static final long serialVersionUID = 1L;

        public void setValue(Object arg0) {
            super.setValue(arg0);
            fAttrSetInstance_ID.setValue(new Integer(0));
        }

        ;
    };
    fAttrSetInstance_ID = new CButton() {

        private static final long serialVersionUID = 1L;

        private Object value;

        public Object getValue() {
            return value;
        }

        ;

        public void setText(String text) {
            if (text == null) {
                text = "---";
            }
            if (text.length() > 23) {
                text = text.substring(0, 20) + "...";
            }
            super.setText(text);
        }

        ;

        public void setValue(Object arg0) {
            value = arg0;
            int i = (arg0 instanceof Integer) ? ((Integer) arg0).intValue() : 0;
            if (i == 0) {
                setText(null);
            }
        }

        ;
    };
    fAttrSetInstance_ID.setValue(new Integer(0));
    fAttrSetInstance_ID.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            selectAttributeSetInstance();
        }
    });
    lProduct_ID.setLabelFor(fProduct_ID);
    fProduct_ID.setBackground(AdempierePLAF.getInfoBackground());
    //
    lDateFrom.setLabelFor(fDateFrom);
    fDateFrom.setBackground(AdempierePLAF.getInfoBackground());
    fDateFrom.setToolTipText(Msg.translate(getCtx(), MLot.COLUMNNAME_DateFrom));
    lDateTo.setLabelFor(fDateTo);
    fDateTo.setBackground(AdempierePLAF.getInfoBackground());
    fDateTo.setToolTipText(Msg.translate(getCtx(), MLot.COLUMNNAME_DateTo));
    fSupplyType = new VLookup(MPPMRP.COLUMNNAME_TypeMRP, false, false, true, MLookupFactory.get(getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPPMRP.Table_Name, MPPMRP.COLUMNNAME_TypeMRP), DisplayType.List));
    lSupplyType.setLabelFor(fSupplyType);
    fSupplyType.setBackground(AdempierePLAF.getInfoBackground());
    //
    parameterPanel.setLayout(new ALayout());
    // 1st Row
    parameterPanel.add(lProduct_ID, new ALayoutConstraint(0, 0));
    parameterPanel.add(fProduct_ID, new ALayoutConstraint(0, 1));
    parameterPanel.add(lUOM, new ALayoutConstraint(0, 2));
    parameterPanel.add(fUOM, new ALayoutConstraint(0, 3));
    parameterPanel.add(lType, new ALayoutConstraint(0, 4));
    parameterPanel.add(fType, new ALayoutConstraint(0, 5));
    // 2nd Row
    parameterPanel.add(lAttrSetInstance_ID, new ALayoutConstraint(1, 0));
    parameterPanel.add(fAttrSetInstance_ID, new ALayoutConstraint(1, 1));
    parameterPanel.add(lOnhand, new ALayoutConstraint(1, 2));
    parameterPanel.add(fOnhand, new ALayoutConstraint(1, 3));
    parameterPanel.add(lOrderPeriod, new ALayoutConstraint(1, 4));
    parameterPanel.add(fOrderPeriod, new ALayoutConstraint(1, 5));
    // 3rd Row
    parameterPanel.add(lPlanner_ID, new ALayoutConstraint(2, 0));
    parameterPanel.add(fPlanner_ID, new ALayoutConstraint(2, 1));
    parameterPanel.add(lSafetyStock, new ALayoutConstraint(2, 2));
    parameterPanel.add(fSafetyStock, new ALayoutConstraint(2, 3));
    parameterPanel.add(lMinOrd, new ALayoutConstraint(2, 4));
    parameterPanel.add(fMinOrd, new ALayoutConstraint(2, 5));
    // 4th Row
    parameterPanel.add(lWarehouse_ID, new ALayoutConstraint(3, 0));
    parameterPanel.add(fWarehouse_ID, new ALayoutConstraint(3, 1));
    parameterPanel.add(lReserved, new ALayoutConstraint(3, 2));
    parameterPanel.add(fReserved, new ALayoutConstraint(3, 3));
    parameterPanel.add(lMaxOrd, new ALayoutConstraint(3, 4));
    parameterPanel.add(fMaxOrd, new ALayoutConstraint(3, 5));
    // 5th Row
    parameterPanel.add(lResource_ID, new ALayoutConstraint(4, 0));
    parameterPanel.add(fResource_ID, new ALayoutConstraint(4, 1));
    parameterPanel.add(lAvailable, new ALayoutConstraint(4, 2));
    parameterPanel.add(fAvailable, new ALayoutConstraint(4, 3));
    parameterPanel.add(lOrdMult, new ALayoutConstraint(4, 4));
    parameterPanel.add(fOrdMult, new ALayoutConstraint(4, 5));
    // 6th Row
    parameterPanel.add(lDateFrom, new ALayoutConstraint(5, 0));
    parameterPanel.add(fDateFrom, new ALayoutConstraint(5, 1));
    parameterPanel.add(lOrdered, new ALayoutConstraint(5, 2));
    parameterPanel.add(fOrdered, new ALayoutConstraint(5, 3));
    parameterPanel.add(lOrderQty, new ALayoutConstraint(5, 4));
    parameterPanel.add(fOrderQty, new ALayoutConstraint(5, 5));
    // 7th Row
    parameterPanel.add(lDateTo, new ALayoutConstraint(6, 0));
    parameterPanel.add(fDateTo, new ALayoutConstraint(6, 1));
    parameterPanel.add(lTimefence, new ALayoutConstraint(6, 4));
    parameterPanel.add(fTimefence, new ALayoutConstraint(6, 5));
    // 8th Row
    parameterPanel.add(fMaster, new ALayoutConstraint(7, 1));
    parameterPanel.add(fCreatePlan, new ALayoutConstraint(7, 3));
    parameterPanel.add(lLeadtime, new ALayoutConstraint(7, 4));
    parameterPanel.add(fLeadtime, new ALayoutConstraint(7, 5));
    // 9th Row
    parameterPanel.add(fMRPReq, new ALayoutConstraint(8, 3));
    parameterPanel.add(lYield, new ALayoutConstraint(8, 4));
    parameterPanel.add(fYield, new ALayoutConstraint(8, 5));
}
Also used : Language(org.compiere.util.Language) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup) ALayoutConstraint(org.compiere.apps.ALayoutConstraint) CButton(org.compiere.swing.CButton) ALayout(org.compiere.apps.ALayout)

Example 4 with VLookup

use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.

the class CAbstractBOMTree method preInit.

private void preInit() {
    northPanel = new CPanel();
    southPanel = new CPanel();
    contentPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    nodeDescription = new JEditorPane("text/html", "");
    nodeDescription.setOpaque(false);
    nodeDescription.setEditable(false);
    String columnName = null;
    int columnId = -1;
    if (BOMWrapper.BOM_TYPE_PRODUCT.equals(type())) {
        columnName = MProduct.Table_Name + "_ID";
        columnId = MColumn.getColumn_ID(MProduct.Table_Name, columnName);
    } else if (BOMWrapper.BOM_TYPE_ORDER.equals(type())) {
        columnName = MPPOrder.Table_Name + "_ID";
        columnId = MColumn.getColumn_ID(MPPOrder.Table_Name, columnName);
    }
    MLookup lm = MLookupFactory.get(Env.getCtx(), getWindowNo(), 0, columnId, DisplayType.Search);
    lookup = new VLookup(columnName, false, false, true, lm) {

        public void setValue(Object obj) {
            super.setValue(obj);
            dispatchPropertyChange();
        }

        ;
    };
}
Also used : MLookup(org.compiere.model.MLookup) CPanel(org.compiere.swing.CPanel) JEditorPane(javax.swing.JEditorPane) VLookup(org.compiere.grid.ed.VLookup) JSplitPane(javax.swing.JSplitPane)

Example 5 with VLookup

use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.

the class VInOutGen method dynInit.

//	jbInit
/**
	 *	Fill Picks.
	 *		Column_ID from C_Order
	 *  @throws Exception if Lookups cannot be initialized
	 */
public void dynInit() throws Exception {
    //	C_OrderLine.M_Warehouse_ID
    MLookup orgL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 2223, DisplayType.TableDir);
    fWarehouse = new VLookup("M_Warehouse_ID", true, false, true, orgL);
    lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
    fWarehouse.addVetoableChangeListener(this);
    setM_Warehouse_ID(fWarehouse.getValue());
    //   Document Action Prepared/ Completed
    MLookup docActionL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 4324, /* M_InOut.DocStatus */
    DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135, /* _Document Action */
    false, "AD_Ref_List.Value IN ('CO','PR')");
    docAction = new VLookup("DocAction", true, false, true, docActionL);
    docAction.addVetoableChangeListener(this);
    //@Trifon - Pre-select "Prepare"
    docAction.setValue("PR");
    //		C_Order.C_BPartner_ID
    MLookup bpL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 2762, DisplayType.Search);
    fBPartner = new VLookup("C_BPartner_ID", false, false, true, bpL);
    lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
    fBPartner.addVetoableChangeListener(this);
    //Document Type Sales Order/Vendor RMA
    lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
    cmbDocType.addItem(new KeyNamePair(MOrder.Table_ID, Msg.translate(Env.getCtx(), "Order")));
    cmbDocType.addItem(new KeyNamePair(MRMA.Table_ID, Msg.translate(Env.getCtx(), "VendorRMA")));
    cmbDocType.addActionListener(this);
    //@@
    panel.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InOutGenerateSel"));
}
Also used : MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup) KeyNamePair(org.compiere.util.KeyNamePair)

Aggregations

VLookup (org.compiere.grid.ed.VLookup)48 MLookup (org.compiere.model.MLookup)27 ALayoutConstraint (org.compiere.apps.ALayoutConstraint)11 CPanel (org.compiere.swing.CPanel)9 Insets (java.awt.Insets)8 ALayout (org.compiere.apps.ALayout)8 Dimension (java.awt.Dimension)7 Properties (java.util.Properties)7 GridBagConstraints (java.awt.GridBagConstraints)6 VComboBox (org.compiere.grid.ed.VComboBox)6 KeyNamePair (org.compiere.util.KeyNamePair)6 CTextField (org.compiere.swing.CTextField)5 CLabel (org.compiere.swing.CLabel)4 Language (org.compiere.util.Language)4 Timestamp (java.sql.Timestamp)3 VCheckBox (org.compiere.grid.ed.VCheckBox)3 VLocator (org.compiere.grid.ed.VLocator)3 VPAttribute (org.compiere.grid.ed.VPAttribute)3 MLocatorLookup (org.compiere.model.MLocatorLookup)3 CButton (org.compiere.swing.CButton)3