use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.
the class VBrowserCellEditor method getTableCellEditorComponent.
// isCellEditable
/**
* Sets an initial value for the editor. This will cause the editor to
* stopEditing and lose any partially edited value if the editor is editing
* when this method is called.
* Returns the component that should be added to the client's Component hierarchy.
* Once installed in the client's hierarchy this component
* will then be able to draw and receive user input.
*
* @param table
* @param value
* @param isSelected
* @param row
* @param col
* @return component
*/
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col) {
log.finest(m_mField.getColumnName() + ": Value=" + value + ", row=" + row + ", col=" + col);
if (row >= 0)
// force moving to new row
table.setRowSelectionInterval(row, row);
if (m_editor == null)
createEditor();
if (m_editor instanceof VLookup) {
((VLookup) m_editor).setStopEditing(false);
}
this.row = row;
this.col = col;
m_editor.setReadWrite(m_mField.isEditable(false));
this.table = (VBrowserTable) table;
// Set Value
m_editor.setValue(value);
// Set Background/Foreground to "normal" (unselected) colors
m_editor.setBackground(m_mField.isError());
m_editor.setForeground(AdempierePLAF.getTextColor_Normal());
// Other UI
m_editor.setFont(table.getFont());
if (m_editor instanceof VLookup) {
VLookup lookup = (VLookup) m_editor;
if (lookup.getComponents()[0] instanceof JComboBox) {
lookup.setBorder(BorderFactory.createEmptyBorder());
} else {
lookup.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
}
} else {
m_editor.setBorder(UIManager.getBorder("Table.focusCellHighlightBorder"));
}
//
return (Component) m_editor;
}
use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.
the class VInOutInvoiceGen method fillPicks.
// jbInit
/**
* Fill Picks.
* Column_ID from C_Order
* @throws Exception if Lookups cannot be initialized
*/
private void fillPicks() 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);
m_M_Warehouse_ID = fWarehouse.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);
//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);
}
use of org.compiere.grid.ed.VLookup in project lar_361 by comitsrl.
the class VInvoiceGen method dynInit.
// jbInit
/**
* Fill Picks.
* Column_ID from C_Order
* @throws Exception if Lookups cannot be initialized
*/
public void dynInit() throws Exception {
// @m_zuniga custom
if (MSysConfig.getBooleanValue("ERGIO_InvoiceGen_Login_ORG_and_PDV", true, Env.getAD_Client_ID(Env.getCtx()))) {
// Muestra unicamente la Organización con que se logueó
MLookup orgL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 2163, /* C_Order.AD_Org_ID */
DisplayType.TableDir, Env.getLanguage(Env.getCtx()), "AD_Org_ID", 3000023, /* AD_Org Login */
false, "");
// Campo obligatorio para evitar selección vacía y que se muestren órdenes de otras organizaciones
fOrg = new VLookup("AD_Org_ID", true, false, true, orgL);
} else // @m_zuniga custom
{
MLookup orgL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 2163, DisplayType.TableDir);
fOrg = new VLookup("AD_Org_ID", false, false, true, orgL);
}
// lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID"));
fOrg.addVetoableChangeListener(this);
MLookup docActionL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 3494, /* C_Invoice.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);
// lDcoACtion.setText((Msg.translate(Env.getCtx(), "DocAction")););
docAction.addVetoableChangeListener(this);
// @mzuniga Deja por defecto la acción Completar
docAction.setValue("CO");
//
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(), "CustomerRMA")));
cmbDocType.addActionListener(this);
// @m_zuniga custom
if (MSysConfig.getBooleanValue("ERGIO_InvoiceGen_Login_ORG_and_PDV", true, Env.getAD_Client_ID(Env.getCtx()))) {
// Muestra PDVS disponibles para la Organización con que se logueó
MLookup posL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 3000068, /* C_Invoice.C_POS_ID */
DisplayType.Table, Env.getLanguage(Env.getCtx()), "C_POS_ID", 3000022, /* LAR_POS_ID Login Org*/
false, "");
fPOS = new VLookup("C_POS_ID", true, false, true, posL);
} else // @m_zuniga custom
// @emmie custom
{
MLookup posL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 3000068, DisplayType.Table);
fPOS = new VLookup("C_POS_ID", true, false, true, posL);
}
lPOS.setText("PDV");
// @emmie custom
// @@
panel.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InvGenerateSel"));
}
Aggregations