/** Dynamic Init. Table Layout, Visual, Listener */ private void dynInit() { ColumnInfo[] layout = new ColumnInfo[] { new ColumnInfo(Msg.translate(Env.getCtx(), "M_Product_ID"), ".", KeyNamePair.class), // 1 new ColumnInfo(Msg.translate(Env.getCtx(), "Name"), ".", String.class) // 2 }; xProductTable.prepareTable(layout, "", "", false, ""); xAssociateTable.prepareTable(layout, "", "", true, ""); xAssociateTable.setAutoResizeMode(3); xProductTable.setAutoResizeMode(3); // Visual CompiereColor.setBackground(this); // Listener xProductTable.getSelectionModel().addListSelectionListener(this); xAssociateTable.getModel().addTableModelListener(this); bDisassociate.addActionListener(this); bNewProduct.addActionListener(this); // pregunto si hay productos asociados para ver si cargo las tablas boolean ready = verify(); if (ready == false) { tableInit_option = 0; tableInit(); tableLoad(xProductTable); } else { tableInit_option = 1; tableInit(); tableLoad(xAssociateTable); bNewProduct.setEnabled(false); bDisassociate.setEnabled(true); } xProductTable.addMouseListener( new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { int rowP = xProductTable.getSelectedRow(); if (!(rowP == -1)) { cmd_associate(); } } } }); // Init statusBar.setStatusLine(""); statusBar.setStatusDB(0); MOrder order = new MOrder(Env.getCtx(), LineRefProv.getC_Order_ID(), null); boolean block = false; String oS = order.getXX_OrderStatus(); String compS = order.getDocStatus(); if (oS.equals("AN") || compS.equals("CO")) { block = true; } if (order.isXX_OrderReadyStatus() && order.getXX_OrderType().equalsIgnoreCase("Nacional")) block = true; if (order.getXX_OrderType().equalsIgnoreCase("Importada") && order.get_ValueAsInt("XX_ImportingCompany_ID") != 0) { if (order.get_ValueAsInt("XX_ImportingCompany_ID") != Env.getCtx().getContextAsInt("#XX_L_VSI_CLIENTCENTROBECO_ID")) { block = true; } } if (order.getXX_StoreDistribution().equals("Y") || block) { xProductTable.setEnabled(false); xAssociateTable.setEnabled(false); bNewProduct.setEnabled(false); bDisassociate.setEnabled(false); } } // dynInit