use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.
the class InfoOrder method statInit.
/**
* Static Setup - add fields to parameterPanel
*/
private void statInit() {
lDocumentNo.setLabelFor(fDocumentNo);
fDocumentNo.setBackground(AdempierePLAF.getInfoBackground());
fDocumentNo.addActionListener(this);
lDescription.setLabelFor(fDescription);
fDescription.setBackground(AdempierePLAF.getInfoBackground());
fDescription.addActionListener(this);
lPOReference.setLabelFor(fPOReference);
fPOReference.setBackground(AdempierePLAF.getInfoBackground());
fPOReference.addActionListener(this);
fIsSOTrx.setSelected(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx")));
fIsSOTrx.addActionListener(this);
fIsDelivered.setSelected(false);
fIsDelivered.addActionListener(this);
//
fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MOrder.Table_Name, MOrder.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"));
fAmtFrom.addActionListener(this);
// Not sure why this is necessary? The border is not visible otherwise.
fAmtFrom.setBorder(fDateFrom.getBorder());
lAmtTo.setLabelFor(fAmtTo);
fAmtTo.setBackground(AdempierePLAF.getInfoBackground());
fAmtTo.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo"));
fAmtTo.addActionListener(this);
// Not sure why this is necessary? The border is not visible otherwise.
fAmtTo.setBorder(fDateFrom.getBorder());
//
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(lDescription, null);
p_criteriaGrid.add(fDescription, null);
p_criteriaGrid.add(fIsSOTrx, new ALayoutConstraint(0, 4));
// 2nd Row
p_criteriaGrid.add(lBPartner_ID, new ALayoutConstraint(1, 0));
p_criteriaGrid.add(fBPartner_ID, null);
p_criteriaGrid.add(lDateFrom, null);
p_criteriaGrid.add(datePanel, null);
p_criteriaGrid.add(fIsDelivered, new ALayoutConstraint(1, 4));
// 3rd Row
p_criteriaGrid.add(lPOReference, new ALayoutConstraint(2, 0));
p_criteriaGrid.add(fPOReference, null);
p_criteriaGrid.add(lAmtFrom, null);
p_criteriaGrid.add(amtPanel, null);
}
use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.
the class VHRActionNotice method dynInit.
// jbInit
/**
* Fill Picks.
* Column_ID from C_Order
* @throws Exception if Lookups cannot be initialized
*/
public void dynInit() throws Exception {
// Process
fieldProcess = new VComboBox(getProcess());
fieldProcess.addActionListener(this);
fieldProcess.setMandatory(true);
// Employee
fieldEmployee.addActionListener(this);
fieldEmployee.setReadWrite(false);
fieldEmployee.setMandatory(true);
// Concept
fieldConcept.addActionListener(this);
fieldConcept.setReadWrite(false);
fieldConcept.setMandatory(true);
// ValidFrom
fieldValidFrom.setReadWrite(false);
fieldValidFrom.setMandatory(true);
fieldValidFrom.addVetoableChangeListener(this);
// Description
fieldDescription.setValue("");
fieldDescription.setReadWrite(false);
// ColumnType
fieldColumnType = new VLookup("ColumnType", true, true, false, getColumnTypeLookup());
fieldColumnType.setReadWrite(false);
// For Text Message like reference
fieldTextLookup.setReadWrite(true);
// Qty-Amount-Date-Text-RuleEngine
fieldQty.setReadWrite(false);
fieldQty.setDisplayType(DisplayType.Quantity);
fieldQty.setVisible(true);
fieldAmount.setDisplayType(DisplayType.Amount);
fieldAmount.setVisible(false);
fieldDate.setVisible(false);
fieldText.setVisible(false);
fieldTextLookup.setVisible(false);
fieldRuleE.setVisible(false);
//
bOk.addActionListener(this);
// Yamel Senih 2013-03-11
// Fixed columns increment in minitable
miniTable = new MiniTable();
// End Yamel Senih
configureMiniTable(miniTable);
}
use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.
the class InfoCashLine method statInit.
/**
* Static Setup - add fields to parameterPanel
*/
private void statInit() {
// 5241 - C_Cash.C_Cash_ID
fCash_ID = new VLookup("C_Cash_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, p_TabNo, MColumn.getColumn_ID(MCash.Table_Name, MCash.COLUMNNAME_C_Cash_ID), DisplayType.Search));
lCash_ID.setLabelFor(fCash_ID);
fCash_ID.setBackground(AdempierePLAF.getInfoBackground());
fCash_ID.addActionListener(this);
;
// 5249 - C_Cash.C_CashBook_ID
fCashBook_ID = new VLookup("C_CashBook_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCash.Table_Name, MCash.COLUMNNAME_C_CashBook_ID), DisplayType.TableDir));
lCashBook_ID.setLabelFor(fCashBook_ID);
fCashBook_ID.setBackground(AdempierePLAF.getInfoBackground());
fCashBook_ID.addActionListener(this);
// 5354 - C_CashLine.C_Invoice_ID
fInvoice_ID = new VLookup("C_Invoice_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Invoice_ID), DisplayType.Search));
lInvoice_ID.setLabelFor(fInvoice_ID);
fInvoice_ID.setBackground(AdempierePLAF.getInfoBackground());
fInvoice_ID.addActionListener(this);
// 54090 - C_CashLine.C_Payment_ID
fPayment_ID = new VLookup("C_Payment_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Payment_ID), DisplayType.Search));
lPayment_ID.setLabelFor(fPayment_ID);
fPayment_ID.setBackground(AdempierePLAF.getInfoBackground());
fPayment_ID.addActionListener(this);
// 5295 - C_CashLine.C_BankAccount_ID
fBankAccount_ID = new VLookup("C_BankAccount_ID", false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_BankAccount_ID), DisplayType.TableDir));
lBankAccount_ID.setLabelFor(fBankAccount_ID);
fBankAccount_ID.setBackground(AdempierePLAF.getInfoBackground());
fBankAccount_ID.addActionListener(this);
// 5296 - C_CashLine.C_Charge_ID
fCharge_ID = new VLookup(MCashLine.COLUMNNAME_C_Charge_ID, false, false, true, MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, MColumn.getColumn_ID(MCashLine.Table_Name, MCashLine.COLUMNNAME_C_Charge_ID), DisplayType.TableDir));
fCharge_ID.setBackground(AdempierePLAF.getInfoBackground());
fCharge_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"));
fAmtFrom.addActionListener(this);
lAmtTo.setLabelFor(fAmtTo);
fAmtTo.setBackground(AdempierePLAF.getInfoBackground());
fAmtTo.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo"));
fAmtTo.addActionListener(this);
//
cbAbsolute.setText(Msg.translate(Env.getCtx(), "AbsoluteAmt"));
cbAbsolute.setName("AbsoluteAmt");
cbAbsolute.setToolTipText(Msg.getMsg(Env.getCtx(), "AbsoluteAmt"));
cbAbsolute.setSelected(false);
cbAbsolute.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.setLayout(new ALayout());
p_criteriaGrid.add(lCashBook_ID, new ALayoutConstraint(0, 0));
p_criteriaGrid.add(fCashBook_ID, null);
p_criteriaGrid.add(lCash_ID, null);
p_criteriaGrid.add(fCash_ID, null);
// 2nd Row
p_criteriaGrid.add(lInvoice_ID, new ALayoutConstraint(1, 0));
p_criteriaGrid.add(fInvoice_ID, null);
p_criteriaGrid.add(lPayment_ID, null);
p_criteriaGrid.add(fPayment_ID, null);
// 3rd Row
p_criteriaGrid.add(lBankAccount_ID, new ALayoutConstraint(2, 0));
p_criteriaGrid.add(fBankAccount_ID, null);
p_criteriaGrid.add(lDateFrom, null);
p_criteriaGrid.add(datePanel, null);
// 4th Row
p_criteriaGrid.add(lCharge_ID, new ALayoutConstraint(3, 0));
p_criteriaGrid.add(fCharge_ID, null);
p_criteriaGrid.add(lAmtFrom, null);
p_criteriaGrid.add(amtPanel, null);
p_criteriaGrid.add(cbAbsolute, new ALayoutConstraint(3, 5));
}
use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.
the class Find method addSelectionColumn.
// initFind
/**
* Add Selection Column to first Tab
* @param mField field
*/
private void addSelectionColumn(GridField mField) {
log.config(mField.getHeader());
int displayLength = mField.getDisplayLength();
if (displayLength > FIELDLENGTH)
mField.setDisplayLength(FIELDLENGTH);
else
displayLength = 0;
// Editor
VEditor editor = null;
//#221
VEditor editor2 = null;
CLabel label = null;
if (mField.isLookup()) {
VLookup vl = new VLookup(mField.getColumnName(), false, false, true, mField.getLookup());
//setting mField to avoid NPE
vl.setField(mField);
vl.setName(mField.getColumnName());
editor = vl;
//
if (// set it back
displayLength > 0)
mField.setDisplayLength(displayLength);
//
label = VEditorFactory.getLabel(mField);
//m_sLine++;
int lpos = 1;
int fpos = 2;
if (isTwoColumns) {
if (!isPair) {
lpos = 1;
fpos = 2;
m_sLine++;
} else {
lpos = 3;
fpos = 4;
}
} else {
lpos = 1;
fpos = 2;
m_sLine++;
}
if (// may be null for Y/N
label != null)
scontentPanel.add(label, new GridBagConstraints(lpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 5, 5), 0, 0));
scontentPanel.add((Component) editor, new GridBagConstraints(fpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
} else {
if (mField.isRangeLookup()) {
new Box(BoxLayout.X_AXIS);
Box box = Box.createHorizontalBox();
editor = VEditorFactory.getEditor(mField, false);
label = VEditorFactory.getLabel(mField);
editor.setMandatory(false);
editor.setReadWrite(true);
box.add((Component) editor);
//#221
editor2 = VEditorFactory.getEditor(mField, false);
editor2.setMandatory(false);
editor2.setReadWrite(true);
if (editor2 instanceof CTextField) {
((CTextField) editor2).addActionListener(this);
}
CLabel separator = new CLabel(" - ");
box.add(separator);
box.add((Component) editor2);
if (// set it back
displayLength > 0)
mField.setDisplayLength(displayLength);
int lpos = 1;
int fpos = 2;
if (isTwoColumns) {
if (!isPair) {
lpos = 1;
fpos = 2;
m_sLine++;
} else {
lpos = 3;
fpos = 4;
}
} else {
lpos = 1;
fpos = 2;
m_sLine++;
}
if (// may be null for Y/N
label != null)
scontentPanel.add(label, new GridBagConstraints(lpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 5, 5), 0, 0));
scontentPanel.add((Component) box, new GridBagConstraints(fpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
} else {
editor = VEditorFactory.getEditor(mField, false);
editor.setMandatory(false);
editor.setReadWrite(true);
label = VEditorFactory.getLabel(mField);
//
if (// set it back
displayLength > 0)
mField.setDisplayLength(displayLength);
int lpos = 1;
int fpos = 2;
if (isTwoColumns) {
if (!isPair) {
lpos = 1;
fpos = 2;
m_sLine++;
} else {
lpos = 3;
fpos = 4;
}
} else {
lpos = 1;
fpos = 2;
m_sLine++;
}
//
label = VEditorFactory.getLabel(mField);
//m_sLine++;
if (// may be null for Y/N
label != null)
scontentPanel.add(label, new GridBagConstraints(lpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(7, 5, 5, 5), 0, 0));
scontentPanel.add((Component) editor, new GridBagConstraints(fpos, m_sLine, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 5), 0, 0));
}
}
// Add action listener to custom text fields - teo_sarca [ 1709292 ]
if (editor instanceof CTextField) {
((CTextField) editor).addActionListener(this);
}
m_sEditors.add(editor);
// #221
m_sEditors2.add(editor2);
}
use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.
the class VTrxMaterial method dynParameter.
// jbInit
/**
* Initialize Parameter fields
* @throws Exception if Lookups cannot be initialized
*/
private void dynParameter() throws Exception {
Properties ctx = Env.getCtx();
// Organization
MLookup orgLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3660, DisplayType.TableDir);
orgField = new VLookup("AD_Org_ID", false, false, true, orgLookup);
// orgField.addVetoableChangeListener(this);
// Locator
MLocatorLookup locatorLookup = new MLocatorLookup(ctx, m_WindowNo);
locatorField = new VLocator("M_Locator_ID", false, false, true, locatorLookup, m_WindowNo);
// locatorField.addVetoableChangeListener(this);
// Product
MLookup productLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3668, DisplayType.Search);
productField = new VLookup("M_Product_ID", false, false, true, productLookup);
productField.addVetoableChangeListener(this);
// Movement Type
MLookup mtypeLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3666, DisplayType.List);
mtypeField = new VLookup("MovementType", false, false, true, mtypeLookup);
// Dates
dateFField = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.getMsg(Env.getCtx(), "DateFrom"));
dateTField = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.getMsg(Env.getCtx(), "DateTo"));
//
confirmPanel.addActionListener(this);
statusBar.setStatusLine("");
}
Aggregations