Search in sources :

Example 6 with VLookup

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

the class VPaySelect method jbInit.

/**
	 *  Static Init
	 *  @throws Exception
	 */
private void jbInit() throws Exception {
    CompiereColor.setBackground(panel);
    //
    mainPanel.setLayout(mainLayout);
    parameterPanel.setLayout(parameterLayout);
    //
    labelBankAccount.setText(Msg.translate(Env.getCtx(), "C_BankAccount_ID"));
    fieldBankAccount.addActionListener(this);
    //
    labelBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
    fieldBPartner = new VLookup("C_BPartner_ID", false, false, true, MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, MColumn.getColumn_ID(MBPartner.Table_Name, MBPartner.COLUMNNAME_C_BPartner_ID), DisplayType.Search));
    fieldBPartner.addActionListener(this);
    //
    bRefresh.addActionListener(this);
    //
    labelDtype.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
    fieldDtype.addActionListener(this);
    //
    labelPayDate.setText(Msg.translate(Env.getCtx(), "PayDate"));
    fieldPayDate.addActionListener(this);
    //
    labelPaymentRule.setText(Msg.translate(Env.getCtx(), "PaymentRule"));
    fieldPaymentRule.addActionListener(this);
    //
    labelBankBalance.setText(Msg.translate(Env.getCtx(), "CurrentBalance"));
    labelBalance.setText("0");
    //
    onlyDue.setText(Msg.getMsg(Env.getCtx(), "OnlyDue"));
    onlyDue.addActionListener(this);
    //
    dataStatus.setText(" ");
    //
    checkAutoQuery.setText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
    checkAutoQuery.setToolTipText(Msg.getMsg(Env.getCtx(), "AutoRefresh"));
    checkAutoQuery.setName("AutoQuery");
    checkAutoQuery.setSelected(MSysConfig.getValue(SYSCONFIG_INFO_AUTO_QUERY, "Y", Env.getAD_Client_ID(Env.getCtx())).equals("Y"));
    checkAutoQuery.addActionListener(this);
    //
    bGenerate.addActionListener(this);
    bCancel.addActionListener(this);
    //
    miniTable.addPropertyChangeListener(this);
    //
    mainPanel.add(parameterPanel, BorderLayout.NORTH);
    mainPanel.setPreferredSize(new Dimension(SCREEN_WIDTH, SCREEN_HEIGHT));
    parameterPanel.add(labelBankAccount, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(fieldBankAccount, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(labelBankBalance, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(labelCurrency, new GridBagConstraints(4, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0));
    parameterPanel.add(labelBalance, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(labelBPartner, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(fieldBPartner, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(labelDtype, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(fieldDtype, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(labelPaymentRule, new GridBagConstraints(2, 2, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(fieldPaymentRule, new GridBagConstraints(3, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(checkAutoQuery, new GridBagConstraints(4, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(labelPayDate, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(fieldPayDate, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(onlyDue, new GridBagConstraints(3, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    parameterPanel.add(bRefresh, new GridBagConstraints(4, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
    mainPanel.add(dataStatus, BorderLayout.SOUTH);
    mainPanel.add(dataPane, BorderLayout.CENTER);
    dataPane.getViewport().add(miniTable, null);
    //
    commandPanel.setLayout(commandLayout);
    commandLayout.setAlignment(FlowLayout.RIGHT);
    commandLayout.setHgap(10);
    commandPanel.add(bCancel, null);
    commandPanel.add(bGenerate, null);
    m_frame.getContentPane().add(commandPanel, BorderLayout.SOUTH);
    m_frame.getContentPane().add(mainPanel, BorderLayout.CENTER);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) VLookup(org.compiere.grid.ed.VLookup) Dimension(java.awt.Dimension)

Example 7 with VLookup

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

the class VPaySelect method actionPerformed.

//	dispose
/**************************************************************************
	 *  ActionListener
	 *  @param e event
	 */
public void actionPerformed(ActionEvent e) {
    boolean triggerRefresh = false;
    if (!m_loadedOK)
        return;
    Object source = e.getSource();
    String cmd = e.getActionCommand();
    //  Trigger an update if any criteria change
    if (source instanceof VComboBox && ((VComboBox) source).getParent() instanceof VLookup) {
        source = ((VComboBox) source).getParent();
        VLookup vl = ((VLookup) source);
        //  events that don't have changes from the last action.
        if (cmd.equals("comboBoxChanged")) {
            if (!vl.hasChanged())
                return;
            else
                triggerRefresh = true;
        } else if (cmd.equals("comboBoxEdited")) {
            if (!vl.hasChanged()) {
                vl.requestFocus();
                return;
            }
            triggerRefresh = true;
        }
    } else if (source instanceof CTextField) {
        CTextField tf = ((CTextField) source);
        if (tf.getParent() instanceof VLookup) {
            // instead.
            return;
        } else if (//  The change may have come from another field
        tf.hasChanged()) {
            triggerRefresh = true;
        }
    } else if (e.getSource() instanceof VCheckBox) {
        //  Check box changes generally always cause a refresh
        //  Capture changes that don't 
        triggerRefresh = true;
        VCheckBox cb = (VCheckBox) e.getSource();
        if (cb.getName().equals("AutoQuery")) {
            //  Only trigger a refresh if the check box is selected
            if (!cb.isSelected()) {
                return;
            }
        }
    } else if (cmd.equals("comboBoxChanged")) {
        VComboBox vcb = (VComboBox) source;
        if (!vcb.hasChanged()) {
            return;
        } else {
            triggerRefresh = true;
        }
    } else if (cmd.equals("comboBoxEdited")) {
        VComboBox vcb = (VComboBox) source;
        if (!vcb.hasChanged()) {
            vcb.requestFocus();
            return;
        }
        triggerRefresh = true;
    }
    if (triggerRefresh && e.getSource() == fieldBankAccount) {
        loadBankInfo();
    }
    //  Generate PaySelection
    if (e.getSource() == bGenerate) {
        generatePaySelect();
        dispose();
    } else if (e.getSource() == bCancel)
        dispose();
    // Refresh if the autoquery feature is selected or the refresh button is clicked.
    if (e.getSource() == bRefresh || (checkAutoQuery.isSelected() && triggerRefresh)) {
        setFieldOldValues();
        loadTableInfo();
    }
}
Also used : CTextField(org.compiere.swing.CTextField) VLookup(org.compiere.grid.ed.VLookup) VComboBox(org.compiere.grid.ed.VComboBox) VCheckBox(org.compiere.grid.ed.VCheckBox)

Example 8 with VLookup

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

the class VCreateFromShipmentUI 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));
    //  initial loading
    initBPOrderDetails(C_BPartner_ID, forInvoice);
}
Also used : MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup)

Example 9 with VLookup

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

the class InfoProduct method statInit.

/**
	 *	Static Setup - add fields to parameterPanel
	 */
private void statInit() {
    labelValue.setText(Msg.getMsg(Env.getCtx(), "Value"));
    fieldValue.setBackground(AdempierePLAF.getInfoBackground());
    fieldValue.addActionListener(this);
    labelName.setText(Msg.getMsg(Env.getCtx(), "Name"));
    fieldName.setBackground(AdempierePLAF.getInfoBackground());
    fieldName.addActionListener(this);
    labelUPC.setText(Msg.translate(Env.getCtx(), "UPC"));
    fieldUPC.setBackground(AdempierePLAF.getInfoBackground());
    fieldUPC.addActionListener(this);
    labelSKU.setText(Msg.translate(Env.getCtx(), "SKU"));
    fieldSKU.setBackground(AdempierePLAF.getInfoBackground());
    fieldSKU.addActionListener(this);
    labelWarehouse.setText(Msg.getMsg(Env.getCtx(), "Warehouse"));
    fWarehouse_ID = new VLookup("M_Warehouse_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MWarehouse.Table_Name, MWarehouse.COLUMNNAME_M_Warehouse_ID), DisplayType.TableDir));
    fWarehouse_ID.setBackground(AdempierePLAF.getInfoBackground());
    fWarehouse_ID.addActionListener(this);
    checkOnlyStock.setText(Msg.getMsg(Env.getCtx(), "OnlyStock"));
    checkOnlyStock.setName("OnlyStock");
    checkOnlyStock.setToolTipText(Msg.getMsg(Env.getCtx(), "OnlyStockTip"));
    // Info may open when searching for non-stock as well.
    checkOnlyStock.setSelected(false);
    checkOnlyStock.addActionListener(this);
    checkShowDetail.setText(Msg.getMsg(Env.getCtx(), "ShowDetail"));
    checkShowDetail.setName("ShowDetail");
    checkShowDetail.setToolTipText(Msg.getMsg(Env.getCtx(), "ShowAttributeDetails"));
    checkShowDetail.setSelected(false);
    checkShowDetail.setEnabled(false);
    checkShowDetail.addActionListener(this);
    checkAND.setText(Msg.getMsg(Env.getCtx(), "SearchAND"));
    checkAND.setName("SearchAND");
    checkAND.setToolTipText(Msg.getMsg(Env.getCtx(), "SearchANDInfo"));
    checkAND.setSelected(true);
    checkAND.addActionListener(this);
    labelPriceList.setText(Msg.getMsg(Env.getCtx(), "PriceListVersion"));
    fPriceList_ID = new VLookup("M_PriceList_Version_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPriceListVersion.Table_Name, MPriceListVersion.COLUMNNAME_M_PriceList_Version_ID), DisplayType.TableDir));
    fPriceList_ID.setBackground(AdempierePLAF.getInfoBackground());
    fPriceList_ID.addActionListener(this);
    labelProductCategory.setText(Msg.translate(Env.getCtx(), "M_Product_Category_ID"));
    fProductCategory_ID = new VLookup("M_Product_Category_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MProductCategory.Table_Name, MProductCategory.COLUMNNAME_M_Product_Category_ID), DisplayType.TableDir));
    fProductCategory_ID.setBackground(AdempierePLAF.getInfoBackground());
    fProductCategory_ID.addActionListener(this);
    // @Trifon
    labelAS.setText(Msg.translate(Env.getCtx(), "M_AttributeSet_ID"));
    fAS_ID = new VLookup("M_AttributeSet_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MAttributeSet.Table_Name, MAttributeSet.COLUMNNAME_M_AttributeSet_ID), DisplayType.TableDir));
    fAS_ID.setBackground(AdempierePLAF.getInfoBackground());
    fAS_ID.addActionListener(this);
    //
    labelASI.setText(Msg.translate(Env.getCtx(), "M_AttributeSetInstance_ID"));
    MPAttributeLookup mpaLookup = new MPAttributeLookup(Env.getCtx(), p_WindowNo);
    fASI_ID = new VPAttribute((GridTab) null, false, false, true, p_WindowNo, mpaLookup, true);
    fASI_ID.setBackground(AdempierePLAF.getInfoBackground());
    fASI_ID.addActionListener(this);
    labelVendor.setText(Msg.translate(Env.getCtx(), "Vendor"));
    fVendor_ID = new VLookup("C_BPartner_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MProductPO.Table_Name, MProductPO.COLUMNNAME_C_BPartner_ID), DisplayType.Search));
    fVendor_ID.setBackground(AdempierePLAF.getInfoBackground());
    fVendor_ID.addActionListener(this);
    // Override the isSOTrx context, Vendors only
    fVendor_ID.setIsSOTrx(true, false);
    //  Setup the Grid
    //	Line 1
    p_criteriaGrid.add(labelValue, new ALayoutConstraint(0, 0));
    p_criteriaGrid.add(fieldValue, null);
    p_criteriaGrid.add(labelWarehouse, null);
    p_criteriaGrid.add(fWarehouse_ID, null);
    p_criteriaGrid.add(checkOnlyStock, new ALayoutConstraint(0, 5));
    //	Line 2
    p_criteriaGrid.add(labelName, new ALayoutConstraint(1, 0));
    p_criteriaGrid.add(fieldName, null);
    p_criteriaGrid.add(labelPriceList, null);
    p_criteriaGrid.add(fPriceList_ID, null);
    // @Trifon
    p_criteriaGrid.add(labelAS, null);
    // @Trifon
    p_criteriaGrid.add(fAS_ID, null);
    // Line 3
    p_criteriaGrid.add(labelUPC, new ALayoutConstraint(2, 0));
    p_criteriaGrid.add(fieldUPC, null);
    p_criteriaGrid.add(labelProductCategory, null);
    p_criteriaGrid.add(fProductCategory_ID, null);
    p_criteriaGrid.add(labelASI, null);
    p_criteriaGrid.add(fASI_ID, null);
    //  Line 4
    p_criteriaGrid.add(labelSKU, new ALayoutConstraint(3, 0));
    p_criteriaGrid.add(fieldSKU, null);
    p_criteriaGrid.add(labelVendor, null);
    p_criteriaGrid.add(fVendor_ID, null);
    p_criteriaGrid.add(checkAND, new ALayoutConstraint(3, 5));
    //	Product Attribute Instance
    m_PAttributeButton = ConfirmPanel.createPAttributeButton(true);
    confirmPanel.addButton(m_PAttributeButton);
    m_PAttributeButton.addActionListener(this);
    m_PAttributeButton.setEnabled(false);
    //Begin - fer_luck @ centuryon
    //add taskpane
    fieldDescription.setBackground(AdempierePLAF.getInfoBackground());
    fieldDescription.setEditable(false);
    fieldDescription.setPreferredSize(new Dimension(INFO_WIDTH - 100, 100));
    fieldPAttributes.setBackground(AdempierePLAF.getInfoBackground());
    fieldPAttributes.setEditable(false);
    fieldPAttributes.setPreferredSize(new Dimension(INFO_WIDTH - 100, 100));
    ColumnInfo[] s_layoutWarehouse = new ColumnInfo[] { new ColumnInfo(" ", "M_Warehouse_ID", IDColumn.class), new ColumnInfo(Msg.translate(Env.getCtx(), "WarehouseName"), "WarehouseName", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "sum(QtyAvailable)", Double.class, true, true, null), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "sum(QtyOnHand)", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "sum(QtyReserved)", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOrdered"), "sum(QtyOrdered)", Double.class) };
    //        		new ColumnInfo(Msg.translate(Env.getCtx(), "DocumentNote"), "DocumentNote", String.class)};
    /**	From Clause							*/
    String s_sqlFrom = " M_PRODUCT_STOCK_V ";
    /** Where Clause						*/
    String s_sqlWhere = "(QtyOnHand <> 0 OR QtyAvailable <> 0 OR QtyReserved <> 0 OR QtyOrdered <> 0) AND M_Product_ID = ?";
    m_sqlWarehouse = warehouseTbl.prepareTable(s_layoutWarehouse, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_STOCK_V");
    m_sqlWarehouse += " Group By M_Warehouse_ID, WarehouseName ";
    m_sqlWarehouse += " Order By sum(QtyOnHand) DESC, WarehouseName ";
    warehouseTbl.setRowSelectionAllowed(true);
    warehouseTbl.setMultiSelection(false);
    warehouseTbl.addMouseListener(this);
    warehouseTbl.setShowTotals(true);
    warehouseTbl.autoSize();
    ColumnInfo[] s_layoutSubstitute = new ColumnInfo[] { new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Description"), "description", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Value"), "value", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class, true, true, null), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "QtyReserved", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", Double.class) };
    s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V";
    s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'S'";
    m_sqlSubstitute = substituteTbl.prepareTable(s_layoutSubstitute, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V");
    substituteTbl.setRowSelectionAllowed(false);
    substituteTbl.setMultiSelection(false);
    substituteTbl.addMouseListener(this);
    substituteTbl.setShowTotals(false);
    substituteTbl.autoSize();
    ColumnInfo[] s_layoutRelated = new ColumnInfo[] { new ColumnInfo(Msg.translate(Env.getCtx(), "Warehouse"), "orgname", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Description"), "description", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Value"), "value", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), "Name", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyAvailable"), "QtyAvailable", Double.class, true, true, null), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyOnHand"), "QtyOnHand", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "QtyReserved"), "QtyReserved", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "PriceStd"), "PriceStd", Double.class) };
    s_sqlFrom = "M_PRODUCT_SUBSTITUTERELATED_V";
    s_sqlWhere = "M_Product_ID = ? AND M_PriceList_Version_ID = ? and RowType = 'R'";
    m_sqlRelated = relatedTbl.prepareTable(s_layoutRelated, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_SUBSTITUTERELATED_V");
    relatedTbl.setRowSelectionAllowed(false);
    relatedTbl.setMultiSelection(false);
    relatedTbl.addMouseListener(this);
    relatedTbl.setShowTotals(false);
    relatedTbl.autoSize();
    //Available to Promise Tab
    initAtpTab();
    m_tableAtp.setRowSelectionAllowed(false);
    m_tableAtp.setMultiSelection(false);
    //Vendor tab
    ColumnInfo[] s_layoutVendor = new ColumnInfo[] { new ColumnInfo(Msg.translate(Env.getCtx(), "Vendor"), "(SELECT bp.Name FROM C_BPartner bp WHERE bp.C_BPartner_ID = M_PRODUCT_PO.C_BPartner_ID)", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "IsCurrentVendor"), "IsCurrentVendor", Boolean.class), new ColumnInfo(Msg.translate(Env.getCtx(), "C_UOM_ID"), "(SELECT Name FROM C_UOM WHERE C_UOM_ID = M_PRODUCT_PO.C_UOM_ID)", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "C_Currency_ID"), "(SELECT iso_code FROM C_Currency WHERE C_Currency_ID = M_PRODUCT_PO.C_Currency_ID)", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "PriceList"), "PriceList", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "PricePO"), "PricePO", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "VendorProductNo"), "VendorProductNo", String.class), new ColumnInfo(Msg.translate(Env.getCtx(), "Order_Min"), "Order_Min", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "DeliveryTime_Promised"), "DeliveryTime_Promised", Double.class), new ColumnInfo(Msg.translate(Env.getCtx(), "DeliveryTime_Actual"), "DeliveryTime_Actual", Double.class) };
    s_sqlFrom = "M_PRODUCT_PO";
    s_sqlWhere = "M_Product_ID = ?";
    m_sqlVendor = vendorTbl.prepareTable(s_layoutVendor, s_sqlFrom, s_sqlWhere, false, "M_PRODUCT_PO");
    vendorTbl.setRowSelectionAllowed(false);
    vendorTbl.setMultiSelection(false);
    vendorTbl.addMouseListener(this);
    vendorTbl.setShowTotals(false);
    vendorTbl.autoSize();
    jTab.addTab(Msg.translate(Env.getCtx(), "Warehouse"), new JScrollPane(warehouseTbl));
    jTab.setPreferredSize(new Dimension(INFO_WIDTH, SCREEN_HEIGHT > 600 ? 250 : 105));
    jTab.addTab(Msg.translate(Env.getCtx(), "Description"), new JScrollPane(fieldDescription));
    jTab.addTab(Msg.translate(Env.getCtx(), "ProductAttribute"), new JScrollPane(fieldPAttributes));
    jTab.addTab(Msg.translate(Env.getCtx(), "Substitute_ID"), new JScrollPane(substituteTbl));
    jTab.addTab(Msg.translate(Env.getCtx(), "RelatedProduct_ID"), new JScrollPane(relatedTbl));
    jTab.addTab(Msg.getMsg(Env.getCtx(), "ATP"), new JScrollPane(m_tableAtp));
    jTab.addTab(Msg.translate(Env.getCtx(), "Vendor"), new JScrollPane(vendorTbl));
    jTab.addChangeListener(this);
    tablePanel.setPreferredSize(new Dimension(INFO_WIDTH, SCREEN_HEIGHT > 600 ? 255 : 110));
    tablePanel.setLayout(new BorderLayout());
    tablePanel.add(jTab, BorderLayout.CENTER);
    //  Add the details to the p_detailPanel
    p_detailTaskPane.setTitle(Msg.translate(Env.getCtx(), "WarehouseStock"));
    p_detailTaskPane.add(checkShowDetail, BorderLayout.NORTH);
    p_detailTaskPane.add(tablePanel, BorderLayout.CENTER);
    p_detailTaskPane.setVisible(true);
}
Also used : JScrollPane(javax.swing.JScrollPane) VPAttribute(org.compiere.grid.ed.VPAttribute) BorderLayout(java.awt.BorderLayout) GridTab(org.compiere.model.GridTab) VLookup(org.compiere.grid.ed.VLookup) ALayoutConstraint(org.compiere.apps.ALayoutConstraint) ColumnInfo(org.compiere.minigrid.ColumnInfo) Dimension(java.awt.Dimension) MPAttributeLookup(org.compiere.model.MPAttributeLookup)

Example 10 with VLookup

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

the class InfoPayment method statInit.

/**
	 *	Static Setup - add fields to parameterPanel
	 */
private void statInit() {
    lDocumentNo.setLabelFor(fDocumentNo);
    fDocumentNo.setBackground(AdempierePLAF.getInfoBackground());
    fDocumentNo.addActionListener(this);
    fcheckReceipt.setSelected(true);
    fcheckReceipt.setActionCommand("OnlyReceipt");
    fcheckReceipt.addActionListener(this);
    fcheckPayment.setSelected(false);
    fcheckPayment.setActionCommand("OnlyPayment");
    fcheckPayment.addActionListener(this);
    //
    fBankAccount_ID = new VLookup("C_BankAccount_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_C_BankAccount_ID), DisplayType.TableDir));
    lBankAccount_ID.setLabelFor(fBankAccount_ID);
    fBankAccount_ID.setBackground(AdempierePLAF.getInfoBackground());
    fBankAccount_ID.addActionListener(this);
    fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MPayment.Table_Name, MPayment.COLUMNNAME_C_BPartner_ID), DisplayType.Search));
    lBPartner_ID.setLabelFor(fBPartner_ID);
    fBPartner_ID.setBackground(AdempierePLAF.getInfoBackground());
    fBPartner_ID.addActionListener(this);
    //
    lDateFrom.setLabelFor(fDateFrom);
    fDateFrom.setBackground(AdempierePLAF.getInfoBackground());
    fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom"));
    fDateFrom.addActionListener(this);
    lDateTo.setLabelFor(fDateTo);
    fDateTo.setBackground(AdempierePLAF.getInfoBackground());
    fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo"));
    fDateTo.addActionListener(this);
    lAmtFrom.setLabelFor(fAmtFrom);
    fAmtFrom.setBackground(AdempierePLAF.getInfoBackground());
    fAmtFrom.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom"));
    // Not sure why this is necessary?  The border is not visible otherwise.
    fAmtFrom.setBorder(fDateFrom.getBorder());
    fAmtFrom.addActionListener(this);
    lAmtTo.setLabelFor(fAmtTo);
    fAmtTo.setBackground(AdempierePLAF.getInfoBackground());
    fAmtTo.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo"));
    // Not sure why this is necessary?  The border is not visible otherwise.
    fAmtTo.setBorder(fDateFrom.getBorder());
    fAmtTo.addActionListener(this);
    //
    CPanel amtPanel = new CPanel();
    CPanel datePanel = new CPanel();
    amtPanel.setLayout(new ALayout(0, 0, true));
    amtPanel.add(fAmtFrom, new ALayoutConstraint(0, 0));
    amtPanel.add(lAmtTo, null);
    amtPanel.add(fAmtTo, null);
    datePanel.setLayout(new ALayout(0, 0, true));
    datePanel.add(fDateFrom, new ALayoutConstraint(0, 0));
    datePanel.add(lDateTo, null);
    datePanel.add(fDateTo, null);
    //
    //  First Row
    p_criteriaGrid.add(lDocumentNo, new ALayoutConstraint(0, 0));
    p_criteriaGrid.add(fDocumentNo, null);
    p_criteriaGrid.add(lBPartner_ID, null);
    p_criteriaGrid.add(fBPartner_ID, null);
    p_criteriaGrid.add(fcheckReceipt, new ALayoutConstraint(0, 5));
    //  2nd Row
    p_criteriaGrid.add(lBankAccount_ID, new ALayoutConstraint(1, 0));
    p_criteriaGrid.add(fBankAccount_ID);
    p_criteriaGrid.add(lDateFrom, null);
    p_criteriaGrid.add(datePanel, null);
    p_criteriaGrid.add(fcheckPayment, new ALayoutConstraint(1, 5));
    //  3rd Row
    p_criteriaGrid.add(lAmtFrom, new ALayoutConstraint(2, 2));
    p_criteriaGrid.add(amtPanel, null);
}
Also used : VLookup(org.compiere.grid.ed.VLookup) CPanel(org.compiere.swing.CPanel) ALayoutConstraint(org.compiere.apps.ALayoutConstraint) ALayout(org.compiere.apps.ALayout)

Aggregations

VLookup (org.compiere.grid.ed.VLookup)44 MLookup (org.compiere.model.MLookup)25 ALayoutConstraint (org.compiere.apps.ALayoutConstraint)10 CPanel (org.compiere.swing.CPanel)9 Dimension (java.awt.Dimension)7 Properties (java.util.Properties)7 ALayout (org.compiere.apps.ALayout)7 Insets (java.awt.Insets)6 VComboBox (org.compiere.grid.ed.VComboBox)6 GridBagConstraints (java.awt.GridBagConstraints)5 KeyNamePair (org.compiere.util.KeyNamePair)5 CTextField (org.compiere.swing.CTextField)4 Language (org.compiere.util.Language)4 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 CLabel (org.compiere.swing.CLabel)3 BorderLayout (java.awt.BorderLayout)2 PropertyVetoException (java.beans.PropertyVetoException)2