use of org.compiere.swing.CComboBox in project adempiere by adempiere.
the class VAttributeGrid method init.
/**
* Init
* @param WindowNo
* @param frame
*/
public void init(int WindowNo, FormFrame frame) {
m_WindowNo = WindowNo;
m_frame = frame;
// Layout
frame.getContentPane().add(this, BorderLayout.CENTER);
this.setLayout(new BorderLayout());
this.add(tabbedPane, BorderLayout.CENTER);
this.add(confirmPanel, BorderLayout.SOUTH);
tabbedPane.addChangeListener(this);
confirmPanel.addActionListener(this);
//
tabbedPane.add(selectPanel, Msg.getMsg(Env.getCtx(), "Selection"));
selectPanel.add(attributeLabel1, new ALayoutConstraint(0, 0));
m_attributes = MAttribute.getOfClient(Env.getCtx(), true, true);
Vector<KeyNamePair> vector = new Vector<KeyNamePair>();
vector.add(new KeyNamePair(0, ""));
for (int i = 0; i < m_attributes.length; i++) vector.add(m_attributes[i].getKeyNamePair());
attributeCombo1 = new CComboBox(vector);
selectPanel.add(attributeCombo1, null);
selectPanel.add(attributeLabel2, new ALayoutConstraint(1, 0));
attributeCombo2 = new CComboBox(vector);
selectPanel.add(attributeCombo2, null);
//
fillPicks();
selectPanel.add(labelPriceList, new ALayoutConstraint(2, 0));
selectPanel.add(pickPriceList);
selectPanel.add(labelWarehouse, new ALayoutConstraint(3, 0));
selectPanel.add(pickWarehouse);
//
selectPanel.setPreferredSize(new Dimension(300, 200));
//
// Grid
tabbedPane.add(gridPanel, "AttributeGrid");
modePanel.add(modeLabel);
modePanel.add(modeCombo);
modeCombo.addActionListener(this);
}
use of org.compiere.swing.CComboBox in project adempiere by adempiere.
the class VBOMDrop method createSelectionPanel.
/**************************************************************************
* Create Selection Panel
* @param order
* @param invoice
* @param project
*/
private void createSelectionPanel(boolean order, boolean invoice, boolean project) {
int row = 0;
selectionPanel.setBorder(new TitledBorder(Msg.translate(Env.getCtx(), "Selection")));
productField = new CComboBox(getProducts());
CLabel label = new CLabel(Msg.translate(Env.getCtx(), "M_Product_ID"));
label.setLabelFor(productField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(productField);
productField.addActionListener(this);
// Qty
label = new CLabel(productQty.getTitle());
label.setLabelFor(productQty);
selectionPanel.add(label);
selectionPanel.add(productQty);
productQty.setValue(Env.ONE);
productQty.addActionListener(this);
if (order) {
orderField = new CComboBox(getOrders());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Order_ID"));
label.setLabelFor(orderField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(orderField);
orderField.addActionListener(this);
}
if (invoice) {
invoiceField = new CComboBox(getInvoices());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Invoice_ID"));
label.setLabelFor(invoiceField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(invoiceField);
invoiceField.addActionListener(this);
}
if (project) {
projectField = new CComboBox(getProjects());
label = new CLabel(Msg.translate(Env.getCtx(), "C_Project_ID"));
label.setLabelFor(projectField);
selectionPanel.add(label, new ALayoutConstraint(row++, 0));
selectionPanel.add(projectField);
projectField.addActionListener(this);
}
// Enabled in ActionPerformed
confirmPanel.getOKButton().setEnabled(false);
// Size
Dimension size = selectionPanel.getPreferredSize();
size.width = WINDOW_WIDTH;
selectionPanel.setPreferredSize(size);
}
use of org.compiere.swing.CComboBox in project adempiere by adempiere.
the class RecordAccessDialog method dynInit.
/**
* Dynamic Init
*/
private void dynInit() {
// Load Roles
String sql = MRole.getDefault().addAccessSQL("SELECT AD_Role_ID, Name FROM AD_Role ORDER BY 2", "AD_Role", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO);
roleField = new CComboBox(DB.getKeyNamePairs(sql, false));
// Load Record Access for all roles
sql = "SELECT * FROM AD_Record_Access " + "WHERE AD_Table_ID=? AND Record_ID=? AND AD_Client_ID=?";
PreparedStatement pstmt = null;
try {
pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, m_AD_Table_ID);
pstmt.setInt(2, m_Record_ID);
pstmt.setInt(3, Env.getAD_Client_ID(Env.getCtx()));
ResultSet rs = pstmt.executeQuery();
while (rs.next()) m_recordAccesss.add(new MRecordAccess(Env.getCtx(), rs, null));
rs.close();
pstmt.close();
pstmt = null;
} catch (Exception e) {
log.log(Level.SEVERE, sql, e);
}
try {
if (pstmt != null)
pstmt.close();
pstmt = null;
} catch (Exception e) {
pstmt = null;
}
log.fine("#" + m_recordAccesss.size());
setLine(0, false);
}
Aggregations