当前位置: 首页>>代码示例>>Java>>正文


Java LocalRes类代码示例

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


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

示例1: actionClosingForm

import com.openbravo.data.loader.LocalRes; //导入依赖的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

示例2: removeRecord

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
public final int removeRecord(int index) throws BasicException {
    if (canDeleteData() && index >= 0 && index < m_aData.size()) {
        if (m_saveprov.deleteData(getElementAt(index)) > 0) { 
            // borramos el elemento indicado
            m_aData.remove(index);
            // disparamos los eventos
            fireDataIntervalRemoved(index, index);
            
            int newindex;
            if (index < m_aData.size()) {
                newindex = index;
            } else {
                newindex = m_aData.size() - 1;
            }
            return newindex;
        } else {
            throw new BasicException(LocalRes.getIntString("exception.nodelete"));
        }     
    } else {
        // indice no valido
        throw new BasicException(LocalRes.getIntString("exception.nodelete"));
    }
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:24,代码来源:BrowsableData.java

示例3: insertRecord

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
public final int insertRecord(Object value) throws BasicException {   
    
    if (canInsertData() && m_saveprov.insertData(value) > 0) { 
        int newindex;
        if (m_comparer == null) {
            // Anadimos el elemento indicado al final...
            newindex = m_aData.size();       
         } else {
             // lo insertamos en el lugar adecuado
            newindex = insertionPoint(value);
         }
         m_aData.add(newindex, value);
         
        // Disparamos la inserccion
        fireDataIntervalAdded(newindex, newindex);
        return newindex;
    } else {
        throw new BasicException(LocalRes.getIntString("exception.noinsert"));
    }       
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:21,代码来源:BrowsableData.java

示例4: doLoad

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
public void doLoad() {
    JFileChooser fc = new JFileChooser(m_fCurrentDirectory);
    
    fc.addChoosableFileFilter(new ExtensionsFilter(LocalRes.getIntString("label.imagefiles"), "png", "gif", "jpg", "jpeg", "bmp"));

    if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {  
        try {
            BufferedImage img = ImageIO.read(fc.getSelectedFile());
            if (img != null) {
                // compruebo que no exceda el tamano maximo.
                if (m_maxsize != null && (img.getHeight() > m_maxsize.height || img.getWidth() > m_maxsize.width)) {
                    if (JOptionPane.showConfirmDialog(this, LocalRes.getIntString("message.resizeimage"), LocalRes.getIntString("title.editor"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {          
                        // Redimensionamos la imagen para que se ajuste
                        img = resizeImage(img);
                    }                        
                }
                setImage(img);
                m_fCurrentDirectory = fc.getCurrentDirectory();
            }
        } catch (IOException eIO) {
        }
    }
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:24,代码来源:JImageEditor.java

示例5: valueChanged

import com.openbravo.data.loader.LocalRes; //导入依赖的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

示例6: jcmdOKActionPerformed

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
private void jcmdOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcmdOKActionPerformed

        int iSort1 = m_jSort1.getSelectedIndex();
        int iSort2 = m_jSort2.getSelectedIndex();
        int iSort3 = m_jSort3.getSelectedIndex();
        
        if (iSort1 > 0 && iSort2 == 0 && iSort3 == 0) {
            m_Comparator = m_cc.createComparator(new int[] {iSort1 - 1});
            dispose();
        } else if (iSort1 > 0 && iSort2 > 0 && iSort3 == 0) {
            m_Comparator = m_cc.createComparator(new int[] {iSort1 - 1, iSort2 - 1});
            dispose();
        } else if (iSort1 > 0 && iSort2 > 0 && iSort3 > 0) {
            m_Comparator = m_cc.createComparator(new int[] {iSort1 - 1, iSort2 - 1,  iSort3 - 1});
            dispose();
        } else {
            MessageInf msg = new MessageInf(MessageInf.SGN_NOTICE, LocalRes.getIntString("message.nosort"));
            msg.show(this);   
        }
  
    }
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:22,代码来源:JSort.java

示例7: getMessageMsg

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
public String getMessageMsg() {
    
    StringBuffer sb = new StringBuffer();     
    int iSignalWord = getSignalWord();
    if (iSignalWord == SGN_DANGER) {
        sb.append(LocalRes.getIntString("sgn.danger"));
    } else if (iSignalWord == SGN_WARNING) {
        sb.append(LocalRes.getIntString("sgn.warning"));
    } else if (iSignalWord == SGN_CAUTION) {
        sb.append(LocalRes.getIntString("sgn.caution"));
    } else if (iSignalWord == SGN_NOTICE) {
        sb.append(LocalRes.getIntString("sgn.notice"));
    } else if (iSignalWord == SGN_IMPORTANT) {
        sb.append(LocalRes.getIntString("sgn.important"));
    } else if (iSignalWord == SGN_SUCCESS) {
        sb.append(LocalRes.getIntString("sgn.success"));
    } else {
        sb.append(LocalRes.getIntString("sgn.unknown"));
    }
    sb.append(m_sHazard);
    sb.append(m_sConsequences);
    sb.append(m_sAvoiding);
    return sb.toString();
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:25,代码来源:MessageInf.java

示例8: splitXML

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
public Map splitXML(){
    try {
        if (m_sp == null) {
            SAXParserFactory spf = SAXParserFactory.newInstance();
            m_sp = spf.newSAXParser();
        }
        m_sp.parse(is, this);
    } catch (ParserConfigurationException ePC) {
        result = LocalRes.getIntString("exception.parserconfig");
    } catch (SAXException eSAX) {
        result = LocalRes.getIntString("exception.xmlfile");
    } catch (IOException eIO) {
        result = LocalRes.getIntString("exception.iofile");
    }
    result = LocalRes.getIntString("button.ok");
    return props;
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:18,代码来源:PaymentGatewayAuthorizeNet.java

示例9: printTicket

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
public void printTicket(Reader in) throws TicketPrinterException  {
    
    try {
        
        if (m_sp == null) {
            SAXParserFactory spf = SAXParserFactory.newInstance();
            m_sp = spf.newSAXParser();
        }
        m_sp.parse(new InputSource(in), this);
                    
    } catch (ParserConfigurationException ePC) {
        throw new TicketPrinterException(LocalRes.getIntString("exception.parserconfig") , ePC);
    } catch (SAXException eSAX) {
        throw new TicketPrinterException(LocalRes.getIntString("exception.xmlfile") , eSAX);
    } catch (IOException eIO) {
        throw new TicketPrinterException(LocalRes.getIntString("exception.iofile") , eIO);
    }
}
 
开发者ID:iMartinezMateu,项目名称:openbravo-pos,代码行数:19,代码来源:TicketParser.java

示例10: actionClosingForm

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
/**
 * Evaluate data before before commit
 * @param c
 * @return
 * @throws BasicException
 */
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:gnoopy,项目名称:wifepos,代码行数:23,代码来源:BrowsableEditableData.java

示例11: removeRecord

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
/**
 *
 * @param index
 * @return
 * @throws BasicException
 */
public final int removeRecord(int index) throws BasicException {
    if (canDeleteData() && index >= 0 && index < m_aData.size()) {
        if (m_saveprov.deleteData(getElementAt(index)) > 0) { 
            // borramos el elemento indicado
            m_aData.remove(index);
            // disparamos los eventos
            fireDataIntervalRemoved(index, index);
            
            int newindex;
            if (index < m_aData.size()) {
                newindex = index;
            } else {
                newindex = m_aData.size() - 1;
            }
            return newindex;
        } else {
            throw new BasicException(LocalRes.getIntString("exception.nodelete"));
        }     
    } else {
        // indice no valido
        throw new BasicException(LocalRes.getIntString("exception.nodelete"));
    }
}
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:30,代码来源:BrowsableData.java

示例12: insertRecord

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
/**
 *
 * @param value
 * @return
 * @throws BasicException
 */
public final int insertRecord(Object value) throws BasicException {   
    
    if (canInsertData() && m_saveprov.insertData(value) > 0) { 
        int newindex;
        if (m_comparer == null) {
            // Anadimos el elemento indicado al final...
            newindex = m_aData.size();       
         } else {
             // lo insertamos en el lugar adecuado
            newindex = insertionPoint(value);
         }
         m_aData.add(newindex, value);
         
        // Disparamos la inserccion
        fireDataIntervalAdded(newindex, newindex);
        return newindex;
    } else {
        throw new BasicException(LocalRes.getIntString("exception.noinsert"));
    }       
}
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:27,代码来源:BrowsableData.java

示例13: doLoad

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
/**
 *
 */
public void doLoad() {
    JFileChooser fc = new JFileChooser(m_fCurrentDirectory);
    
    fc.addChoosableFileFilter(new ExtensionsFilter(LocalRes.getIntString("label.imagefiles"), "png", "gif", "jpg", "jpeg", "bmp"));

    if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {  
        try {
            BufferedImage img = ImageIO.read(fc.getSelectedFile());
            if (img != null) {
                // compruebo que no exceda el tamano maximo.
                if (m_maxsize != null && (img.getHeight() > m_maxsize.height || img.getWidth() > m_maxsize.width)) {
                    if (JOptionPane.showConfirmDialog(this, LocalRes.getIntString("message.resizeimage"), LocalRes.getIntString("title.editor"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {          
                        // Redimensionamos la imagen para que se ajuste
                        img = resizeImage(img);
                    }                        
                }
                setImage(img);
                m_fCurrentDirectory = fc.getCurrentDirectory();
            }
        } catch (IOException eIO) {
        }
    }
}
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:27,代码来源:JImageEditor.java

示例14: valueChanged

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
@Override
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:gnoopy,项目名称:wifepos,代码行数:23,代码来源:JListNavigator.java

示例15: getMessageMsg

import com.openbravo.data.loader.LocalRes; //导入依赖的package包/类
/**
 *
 * @return
 */
public String getMessageMsg() {
    
    StringBuilder sb = new StringBuilder();     
    int iSignalWord = getSignalWord();
    if (iSignalWord == SGN_DANGER) {
        sb.append(LocalRes.getIntString("sgn.danger"));
    } else if (iSignalWord == SGN_WARNING) {
        sb.append(LocalRes.getIntString("sgn.warning"));
    } else if (iSignalWord == SGN_CAUTION) {
        sb.append(LocalRes.getIntString("sgn.caution"));
    } else if (iSignalWord == SGN_NOTICE) {
        sb.append(LocalRes.getIntString("sgn.notice"));
    } else if (iSignalWord == SGN_IMPORTANT) {
        sb.append(LocalRes.getIntString("sgn.important"));
    } else if (iSignalWord == SGN_SUCCESS) {
        sb.append(LocalRes.getIntString("sgn.success"));
    } else {
        sb.append(LocalRes.getIntString("sgn.unknown"));
    }
    sb.append(m_sHazard);
    sb.append(m_sConsequences);
    sb.append(m_sAvoiding);
    return sb.toString();
}
 
开发者ID:gnoopy,项目名称:wifepos,代码行数:29,代码来源:MessageInf.java


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