コード例 #1
0
  private void showProductPanel(String id) {
    ProductInfoExt product = m_productsset.get(id);
    if (product == null) {
      if (m_productsset.containsKey(id)) {
      } else {
        try {
          java.util.List<ProductInfoExt> products = m_dlSales.getProductComments(id);

          if (products.isEmpty()) {
            m_productsset.put(id, null);
          } else {
            product = m_dlSales.getProductInfo(id);
            m_productsset.put(id, product);

            JCatalogTab jcurrTab = new JCatalogTab();
            jcurrTab.applyComponentOrientation(getComponentOrientation());
            m_jProducts.add(jcurrTab, "PRODUCT." + id);

            // Add products
            for (ProductInfoExt prod : products) {
              jcurrTab.addButton(
                  new ImageIcon(tnbbutton.getThumbNailText(prod.getImage(), getProductLabel(prod))),
                  new SelectedAction(prod),
                  prod.getTextTip(),
                  "");
            }
            CardLayout cl = (CardLayout) (m_jProducts.getLayout());
            cl.show(m_jProducts, "PRODUCT." + id);
          }
        } catch (BasicException eb) {
          m_productsset.put(id, null);
        }
      }
    } else {

      CardLayout cl = (CardLayout) (m_jProducts.getLayout());
      cl.show(m_jProducts, "PRODUCT." + id);
    }
  }
コード例 #2
0
 private void buildProductPanel() {
   try {
     JCatalogTab jcurrTab = new JCatalogTab();
     m_jProducts.add(jcurrTab, "");
     java.util.List<ProductInfoExt> prods = m_dlSales.getAllProductCatalog();
     for (ProductInfoExt prod : prods) {
       newColour = m_dlSales.getCategoryColour(prod.getCategoryID());
       String sColour = (String) newColour;
       if (sColour == null) {
         sColour = "";
       }
       jcurrTab.addButton(
           new ImageIcon(tnbbutton.getThumbNailText(prod.getImage(), getProductLabel(prod))),
           new SelectedAction(prod),
           prod.getTextTip(),
           sColour);
     }
   } catch (BasicException e) {
     JMessageDialog.showMessage(
         this,
         new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.notactive"), e));
   }
 }