• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BasicException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.openbravo.basic.BasicException的典型用法代码示例。如果您正苦于以下问题:Java BasicException类的具体用法?Java BasicException怎么用?Java BasicException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BasicException类属于com.openbravo.basic包,在下文中一共展示了BasicException类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: findNext

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public final int findNext(int index, Finder f) throws BasicException {
    int i = index + 1;
    
    // search up to the end of the recordset
    while (i < m_aData.size()) {
        if (f.match(this.getElementAt(i))) {
            return i;
        }
        i++;
    }    
    // search from the begining
    i = 0;
    while (i < index) {
        if (f.match(this.getElementAt(i))) {
            return i;
        }
        i++;
    }    
    
    // No se ha encontrado
    return -1;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:23,代码来源:BrowsableData.java


示例2: valueChanged

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public void valueChanged(ListSelectionEvent evt) {
    
    if (!evt.getValueIsAdjusting()) {
        int i = m_jlist.getSelectedIndex();
        if (i >= 0) {
            if (!m_bd.isAdjusting()) {

                try {
                    m_bd.moveTo(i);
                } catch (BasicException eD) {
                    MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, LocalRes.getIntString("message.nomove"), eD);
                    msg.show(this);
                    // Y ahora tendriamos que seleccionar silenciosamente el registro donde estabamos.
                }
            }
            // Lo hago visible...
            Rectangle oRect = m_jlist.getCellBounds(i, i);
            m_jlist.scrollRectToVisible(oRect);       
        }
    }
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:22,代码来源:JListNavigator.java


示例3: writeValues

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public void writeValues(DataWrite dp) throws BasicException {
    dp.setString(1, m_sTicket);
    dp.setInt(2, new Integer(m_iLine));
    dp.setString(3, productid);
    dp.setString(4, attsetinstid);

    dp.setDouble(5, new Double(multiply));
    dp.setDouble(6, new Double(price));

    dp.setString(7, tax.getId());
    try {
        ByteArrayOutputStream o = new ByteArrayOutputStream();
        attributes.storeToXML(o, AppLocal.APP_NAME, "UTF-8");
        dp.setBytes(8, o.toByteArray());
    } catch (IOException e) {
        dp.setBytes(8, null);
    }
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:19,代码来源:TicketLineInfo.java


示例4: deleteTicket

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public void deleteTicket() {
    
    if (m_ticketCopy != null) {           
        // Para editar borramos el ticket anterior
        try {               
            m_dlSales.deleteTicket(m_ticketCopy, m_App.getInventoryLocation());
        } catch (BasicException eData) {
            MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, AppLocal.getIntString("message.nosaveticket"), eData);
            msg.show(this);                
        }            
    }
    
    m_ticket = null;
    m_ticketCopy = null;
    resetToTicket(); 
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:17,代码来源:JTicketsBagTicket.java


示例5: jEditAttributesActionPerformed

import com.openbravo.basic.BasicException; //导入依赖的package包/类
private void jEditAttributesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEditAttributesActionPerformed

        int i = m_ticketlines.getSelectedIndex();
        if (i < 0) {
            Toolkit.getDefaultToolkit().beep(); // no line selected
        } else {
            try {
                TicketLineInfo line = m_oTicket.getLine(i);
                JProductAttEdit attedit = JProductAttEdit.getAttributesEditor(this, m_App.getSession());
                attedit.editAttributes(line.getProductAttSetId(), line.getProductAttSetInstId());
                attedit.setVisible(true);
                if (attedit.isOK()) {
                    // The user pressed OK
                    line.setProductAttSetInstId(attedit.getAttributeSetInst());
                    line.setProductAttSetInstDesc(attedit.getAttributeSetInstDescription());
                    paintTicketLine(i, line);
                }
            } catch (BasicException ex) {
                MessageInf msg = new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotfindattributes"), ex);
                msg.show(this);
            }
        }
        
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:25,代码来源:JPanelTicket.java


示例6: getReservationsUpdate

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public final SentenceExec getReservationsUpdate() {
    return new SentenceExecTransaction(s) {
        public int execInTransaction(Object params) throws BasicException {  

            new PreparedSentence(s
                , "DELETE FROM RESERVATION_CUSTOMERS WHERE ID = ?"
                , new SerializerWriteBasicExt(customerdatas, new int[]{0})).exec(params);
            if (((Object[]) params)[3] != null) {
                new PreparedSentence(s
                    , "INSERT INTO RESERVATION_CUSTOMERS (ID, CUSTOMER) VALUES (?, ?)"
                    , new SerializerWriteBasicExt(customerdatas, new int[]{0, 3})).exec(params);                
            }
            return new PreparedSentence(s
                , "UPDATE RESERVATIONS SET ID = ?, CREATED = ?, DATENEW = ?, TITLE = ?, CHAIRS = ?, ISDONE = ?, DESCRIPTION = ? WHERE ID = ?"
                , new SerializerWriteBasicExt(customerdatas, new int[]{0, 1, 2, 6, 7, 8, 9, 0})).exec(params);
        }
    };
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:19,代码来源:DataLogicCustomers.java


示例7: deleteTicket

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public void deleteTicket() {
    
    if (m_PlaceCurrent != null) {
        
        String id = m_PlaceCurrent.getId();
        try {
            dlReceipts.deleteSharedTicket(id);
        } catch (BasicException e) {
            new MessageInf(e).show(this);
        }       
        
        m_PlaceCurrent.setPeople(false);
        
        m_PlaceCurrent = null;
    }        
    
    printState();     
    m_panelticket.setActiveTicket(null, null); 
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:20,代码来源:JTicketsBagRestaurantMap.java


示例8: AttributeUseEditor

import com.openbravo.basic.BasicException; //导入依赖的package包/类
/** Creates new form AttributeSetEditor */
public AttributeUseEditor(AppView app, DirtyManager dirty) {

    attributesent = new StaticSentence(app.getSession()
        , "SELECT ID, NAME FROM ATTRIBUTE ORDER BY NAME"
        , null
        , new SerializerRead() { public Object readValues(DataRead dr) throws BasicException {
            return new AttributeInfo(dr.getString(1), dr.getString(2));
        }}
    );
    attributemodel = new ComboBoxValModel();

    initComponents();

    jLineno.getDocument().addDocumentListener(dirty);
    jAttribute.addActionListener(dirty);
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:18,代码来源:AttributeUseEditor.java


示例9: next

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public boolean next() throws JRException {
    
    if (SRS == null) {
        throw new JRException(AppLocal.getIntString("exception.unavailabledataset"));
    }
    
    try {
        if (SRS.next()) {
            current = SRS.getCurrent();
            return true;
        } else {                
            current = null;
            SRS = null;
            sent.closeExec();
            sent = null;
            return false;
        }                
    } catch (BasicException e) {
        throw new JRException(e);
    }      
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:22,代码来源:JRDataSourceBasic.java


示例10: actionClosingForm

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public boolean actionClosingForm(Component c) throws BasicException {
    if (m_Dirty.isDirty()) {
        int res = JOptionPane.showConfirmDialog(c, LocalRes.getIntString("message.wannasave"), LocalRes.getIntString("title.editor"), JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
        if (res == JOptionPane.YES_OPTION) {
            saveData();
            return true;
        } else if (res == JOptionPane.NO_OPTION) {
            refreshCurrent();
            return true;
        } else {
            return false;
        }
    } else {
        return true;
    }
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:17,代码来源:BrowsableEditableData.java


示例11: syncCategory

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public void syncCategory(final CategoryInfo cat) throws BasicException {
    
    Transaction t = new Transaction(s) {
        public Object transact() throws BasicException {
            // Sync the Category in a transaction
            
            // Try to update
            if (new PreparedSentence(s, 
                        "UPDATE CATEGORIES SET NAME = ?, IMAGE = ? WHERE ID = ?", 
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                             setString(1, cat.getName());
                             setBytes(2, ImageUtils.writeImage(cat.getImage()));
                             setString(3, cat.getID());                                   
                        }}) == 0) {
                   
                // If not updated, try to insert
                new PreparedSentence(s, 
                    "INSERT INTO CATEGORIES(ID, NAME, IMAGE) VALUES (?, ?, ?)",
                    SerializerWriteParams.INSTANCE
                    ).exec(new DataParams() { public void writeValues() throws BasicException {
                        setString(1, cat.getID());
                        setString(2, cat.getName());
                        setBytes(3, ImageUtils.writeImage(cat.getImage()));
                    }});
            }
            return null;        
        }
    };
    t.execute();        
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:32,代码来源:DataLogicIntegration.java


示例12: getTicketPayments

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public List getTicketPayments(final String ticket) throws BasicException {
    return new PreparedSentence(s
            , "SELECT TOTAL, PAYMENT FROM PAYMENTS WHERE RECEIPT = ?"
            , SerializerWriteString.INSTANCE
            , new SerializerRead() {
                public Object readValues(DataRead dr) throws BasicException {
                    return new PaymentInfoTicket(
                            dr.getDouble(1),
                            dr.getString(2));
                }                
            }).list(ticket);
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:13,代码来源:DataLogicIntegration.java


示例13: createValue

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public Object createValue() throws BasicException {
    return new Object[] {
        id,
        attid,
        Formats.STRING.formatValue(jValue.getText())
    };
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:8,代码来源:AttributeValuesEditor.java


示例14: syncTaxCategory

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public void syncTaxCategory(final TaxCategoryInfo taxcat) throws BasicException {
    
    Transaction t = new Transaction(s) {
        public Object transact() throws BasicException {
            // Sync the Tax in a transaction
            
            // Try to update                
            if (new PreparedSentence(s, 
                        "UPDATE TAXCATEGORIES SET NAME = ?  WHERE ID = ?",
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, taxcat.getName());
                            setString(2, taxcat.getID());                                    
                        }}) == 0) {
                   
                // If not updated, try to insert
                new PreparedSentence(s, 
                        "INSERT INTO TAXCATEGORIES(ID, NAME) VALUES (?, ?)", 
                        SerializerWriteParams.INSTANCE
                        ).exec(new DataParams() { public void writeValues() throws BasicException {
                            setString(1, taxcat.getID());
                            setString(2, taxcat.getName());
                        }});
            }
            
            return null;
        }
    };
    t.execute();                   
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:31,代码来源:DataLogicIntegration.java


示例15: getProductCatalog

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public List<ProductInfoExt> getProductCatalog(String category) throws BasicException  {
    return new PreparedSentence(s
        , "SELECT P.ID, P.REFERENCE, P.CODE, P.NAME, P.ISCOM, P.ISSCALE, P.PRICEBUY, P.PRICESELL, P.TAXCAT, P.CATEGORY, P.ATTRIBUTESET_ID, P.IMAGE, P.ATTRIBUTES " +
          "FROM PRODUCTS P, PRODUCTS_CAT O WHERE P.ID = O.PRODUCT AND P.CATEGORY = ? " +
          "ORDER BY O.CATORDER, P.NAME"
        , SerializerWriteString.INSTANCE
        , ProductInfoExt.getSerializerRead()).list(category);
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:9,代码来源:DataLogicSales.java


示例16: getCurrent

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public Object getCurrent() throws BasicException {
    if (m_iIndex < 0 || m_iIndex >= l.size()) {
        throw new BasicException(LocalRes.getIntString("exception.outofbounds"));
    } else {
        return l.get(m_iIndex);
    }
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:8,代码来源:BatchSentence.java


示例17: readValues

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public Object readValues(DataRead dr) throws BasicException {
    try {
        return new String((byte[]) Datas.BYTES.getValue(dr,1), "UTF-8");
    } catch (java.io.UnsupportedEncodingException e) {
        return null;
    }
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:8,代码来源:SerializerReadUTF8.java


示例18: getBytes

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public byte[] getBytes(int columnIndex) throws BasicException {
    try {
        return m_rs.getBytes(columnIndex);
    } catch (SQLException eSQL) {
        throw new BasicException(eSQL);
    }
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:8,代码来源:JDBCSentence.java


示例19: next

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public boolean next() throws BasicException {
    try {
        return m_rs.next();
    } catch (SQLException eSQL) {
        throw new BasicException(eSQL);
    }
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:8,代码来源:JDBCSentence.java


示例20: createSession

import com.openbravo.basic.BasicException; //导入依赖的package包/类
public static Session createSession(AppProperties props) throws BasicException {
           
    try{

        // register the database driver
        if (isJavaWebStart()) {
            Class.forName(props.getProperty("db.driver"), true, Thread.currentThread().getContextClassLoader());
        } else {
            ClassLoader cloader = new URLClassLoader(new URL[] {new File(props.getProperty("db.driverlib")).toURI().toURL()});
            DriverManager.registerDriver(new DriverWrapper((Driver) Class.forName(props.getProperty("db.driver"), true, cloader).newInstance()));
        }

        String sDBUser = props.getProperty("db.user");
        String sDBPassword = props.getProperty("db.password");        
        if (sDBUser != null && sDBPassword != null && sDBPassword.startsWith("crypt:")) {
            // the password is encrypted
            AltEncrypter cypher = new AltEncrypter("cypherkey" + sDBUser);
            sDBPassword = cypher.decrypt(sDBPassword.substring(6));
        }   

         return new Session(props.getProperty("db.URL"), sDBUser,sDBPassword);     

    } catch (InstantiationException e) {
        throw new BasicException(AppLocal.getIntString("message.databasedrivererror"), e);
    } catch (IllegalAccessException eIA) {
        throw new BasicException(AppLocal.getIntString("message.databasedrivererror"), eIA);
    } catch (MalformedURLException eMURL) {
        throw new BasicException(AppLocal.getIntString("message.databasedrivererror"), eMURL);
    } catch (ClassNotFoundException eCNF) {
        throw new BasicException(AppLocal.getIntString("message.databasedrivererror"), eCNF);
    } catch (SQLException eSQL) {
        throw new BasicException(AppLocal.getIntString("message.databaseconnectionerror"), eSQL);
    }   
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:35,代码来源:AppViewConnection.java



注:本文中的com.openbravo.basic.BasicException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UIUtil类代码示例发布时间:2022-05-22
下一篇:
Java CasAuthenticationToken类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap