Package org.compiere.util

Examples of org.compiere.util.KeyNamePair


   */
  private boolean defaultsOK ()
  {
    log.info("");

    KeyNamePair org = (KeyNamePair)orgCombo.getSelectedItem();
    if (org == null)
      return false;

    //  Set Properties
    Ini.setProperty(Ini.P_CONNECTION, CConnection.get().toStringLong());
View Full Code Here


    m_comboActive = true;
    if (roleCombo.getItemCount() > 0)
      roleCombo.removeAllItems();

    //  Initial role
    KeyNamePair iniValue = null;
    String iniDefault = Ini.getProperty(Ini.P_ROLE);

    //  fill roles
    for (int i = 0; i < roles.length; i++)
    {
View Full Code Here

  /**
   *  Role changed - fill Client List
   */
  private void roleComboChanged ()
  {
    KeyNamePair role = (KeyNamePair)roleCombo.getSelectedItem();
    if (role == null || m_comboActive)
      return;
    log.config(": " + role);
    m_comboActive = true;
    //
    KeyNamePair[] clients = m_login.getClients(role);
    //  delete existing client/org items
    if (clientCombo.getItemCount() > 0)
      clientCombo.removeAllItems();
    if (orgCombo.getItemCount() > 0)
      orgCombo.removeAllItems();
    //  No Clients
    if (clients == null || clients.length == 0)
    {
      statusBar.setStatusLine(txt_RoleError, true);
      m_comboActive = false;
      return;
    }
    //  initial client
    KeyNamePair iniValue = null;
    String iniDefault = Ini.getProperty(Ini.P_CLIENT);

    //  fill clients
    for (int i = 0; i < clients.length; i++)
    {
View Full Code Here

  /**
   *  Client changed - fill Org & Warehouse List
   */
  private void clientComboChanged()
  {
    KeyNamePair client = (KeyNamePair)clientCombo.getSelectedItem();
    if (client == null || m_comboActive)
      return;
    log.config(": " + client);
    m_comboActive = true;
    //
    KeyNamePair[] orgs = m_login.getOrgs(client);
    //  delete existing cleint items
    if (orgCombo.getItemCount() > 0)
      orgCombo.removeAllItems();

    //  No Orgs
    if (orgs == null || orgs.length == 0)
    {
      statusBar.setStatusLine(txt_RoleError, true);
      m_comboActive = false;
      return;
    }
    //  initial client
    KeyNamePair orgValue = null;
    KeyNamePair orgValue2 = null;
    String iniDefault = Ini.getProperty(Ini.P_ORG);

    //  fill orgs
    for (int i = 0; i < orgs.length; i++)
    {
View Full Code Here

  /**
   *  Org changed - fill Warehouse List
   */
  private void orgComboChanged()
  {
    KeyNamePair org = (KeyNamePair)orgCombo.getSelectedItem();
    if (org == null || m_comboActive)
      return;
    log.config(": " + org);
    m_comboActive = true;
    //
    KeyNamePair[] whs = m_login.getWarehouses(org);
    //  Delete existing warehouse items
    if (warehouseCombo.getItemCount() > 0)
      warehouseCombo.removeAllItems();
   
    //  fill warehouses
    if (whs != null)
    {
      //  initial warehouse
      KeyNamePair iniValue = null;
      String iniDefault = Ini.getProperty(Ini.P_WAREHOUSE);
      for (int i = 0; i < whs.length; i++)
      {
        warehouseCombo.addItem(whs[i]);
        if (whs[i].getName().equals(iniDefault))
View Full Code Here

  //  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);
       
        panel.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InvGenerateSel"));//@@
  //  fillPicks
View Full Code Here

        panel.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InvGenerateSel"));//@@
  //  fillPicks
 
  public void executeQuery()
  {
    KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem();
    executeQuery(docTypeKNPair, panel.getMiniTable());
  }   //  executeQuery
View Full Code Here

  /**************************************************************************
   *  Generate Shipments
   */
  public String generate()
  {
    KeyNamePair docTypeKNPair = (KeyNamePair)cmbDocType.getSelectedItem();
    String docActionSelected = (String)docAction.getValue()
    return generate(panel.getStatusBar(), docTypeKNPair, docActionSelected);
  //  generateShipments
View Full Code Here

      + " ORDER BY M_PriceList_Version.Name";
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    try
    {
      pickPriceList.addItem(new KeyNamePair (0, ""));
      pstmt = DB.prepareStatement(SQL, null);
      rs = pstmt.executeQuery();
      while (rs.next())
      {
        KeyNamePair kn = new KeyNamePair (rs.getInt(1), rs.getString(2));
        pickPriceList.addItem(kn);
      }
      DB.close(rs, pstmt);

      //  Warehouse
      SQL = MRole.getDefault().addAccessSQL (
        "SELECT M_Warehouse_ID, Value || ' - ' || Name AS ValueName "
        + "FROM M_Warehouse "
        + "WHERE IsActive='Y'",
          "M_Warehouse", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO)
        + " ORDER BY Value";
      pickWarehouse.addItem(new KeyNamePair (0, ""));
      pstmt = DB.prepareStatement(SQL, null);
      rs = pstmt.executeQuery();
      while (rs.next())
      {
        KeyNamePair kn = new KeyNamePair
          (rs.getInt("M_Warehouse_ID"), rs.getString("ValueName"));
        pickWarehouse.addItem(kn);
      }
      DB.close(rs, pstmt);
     
View Full Code Here

    if (C_PaySelection_ID == 0)
      return;
    //
    for (int i = 0; i < fPaySelect.getItemCount(); i++)
    {
      KeyNamePair pp = (KeyNamePair)fPaySelect.getItemAt(i);
      if (pp.getKey() == C_PaySelection_ID)
      {
        fPaySelect.setSelectedIndex(i);
        return;
      }
    }
View Full Code Here

TOP

Related Classes of org.compiere.util.KeyNamePair

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.