Search in sources :

Example 11 with VComboBox

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

the class VCollectDetail method loadStandardPanel.

/**
	 * Load Standard Fields for Collect
	 * @return void
	 */
private void loadStandardPanel() {
    standardPanel = new CPanel(layout);
    //	For Tender Type
    //  C_Payment_v.TenderType
    int columnId = 8416;
    MLookup lookup = MLookupFactory.get(Env.getCtx(), 0, 0, columnId, DisplayType.List);
    fieldTenderType = new VLookup("TenderType", true, false, true, lookup);
    ((VComboBox) fieldTenderType.getCombo()).setRenderer(new POSLookupListCellRenderer(font));
    fieldTenderType.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
    ((VComboBox) fieldTenderType.getCombo()).setFont(font);
    fieldTenderType.addVetoableChangeListener(this);
    //	For Amount
    fieldPayAmt = new VNumber("PayAmt", true, false, true, DisplayType.Amount, "");
    fieldPayAmt.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
    fieldPayAmt.setFont(font);
    fieldPayAmt.setValue(Env.ZERO);
    fieldPayAmt.addVetoableChangeListener(this);
    fieldPayAmt.addKeyListener(this);
    //	Button
    AppsAction action = new AppsAction("Minus", KeyStroke.getKeyStroke(KeyEvent.VK_F2, Event.F2), false);
    action.setDelegate(this);
    buttonMinus = (CButton) action.getButton();
    buttonMinus.setPreferredSize(new Dimension(FIELD_HEIGHT, FIELD_HEIGHT));
    buttonMinus.setFocusable(false);
    //	Add Tender Type
    standardPanel.add(fieldTenderType, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
    standardPanel.add(fieldPayAmt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
}
Also used : AppsAction(org.compiere.apps.AppsAction) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) MLookup(org.compiere.model.MLookup) CPanel(org.compiere.swing.CPanel) VLookup(org.compiere.grid.ed.VLookup) VNumber(org.compiere.grid.ed.VNumber) VComboBox(org.compiere.grid.ed.VComboBox) Dimension(java.awt.Dimension)

Aggregations

VComboBox (org.compiere.grid.ed.VComboBox)11 VLookup (org.compiere.grid.ed.VLookup)6 ALayoutConstraint (org.compiere.apps.ALayoutConstraint)5 VString (org.compiere.grid.ed.VString)5 VNumber (org.compiere.grid.ed.VNumber)4 Component (java.awt.Component)3 Dimension (java.awt.Dimension)3 VCheckBox (org.compiere.grid.ed.VCheckBox)3 CPanel (org.compiere.swing.CPanel)3 CTextField (org.compiere.swing.CTextField)3 GridBagConstraints (java.awt.GridBagConstraints)2 Insets (java.awt.Insets)2 BigDecimal (java.math.BigDecimal)2 PreparedStatement (java.sql.PreparedStatement)2 ResultSet (java.sql.ResultSet)2 MAttributeSet (org.compiere.model.MAttributeSet)2 MLookup (org.compiere.model.MLookup)2 KeyNamePair (org.compiere.util.KeyNamePair)2 SQLException (java.sql.SQLException)1 Timestamp (java.sql.Timestamp)1