Search in sources :

Example 11 with VNumber

use of org.compiere.grid.ed.VNumber 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

VNumber (org.compiere.grid.ed.VNumber)11 ALayoutConstraint (org.compiere.apps.ALayoutConstraint)6 Component (java.awt.Component)4 VComboBox (org.compiere.grid.ed.VComboBox)4 VString (org.compiere.grid.ed.VString)4 CLabel (org.compiere.swing.CLabel)3 CPanel (org.compiere.swing.CPanel)3 Dimension (java.awt.Dimension)2 GridBagConstraints (java.awt.GridBagConstraints)2 Insets (java.awt.Insets)2 VLookup (org.compiere.grid.ed.VLookup)2 MLookup (org.compiere.model.MLookup)2 GridBagLayout (java.awt.GridBagLayout)1 BigDecimal (java.math.BigDecimal)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 Timestamp (java.sql.Timestamp)1 EventObject (java.util.EventObject)1 Properties (java.util.Properties)1 ButtonGroup (javax.swing.ButtonGroup)1