本文整理汇总了Java中com.openbravo.pos.util.StringUtils类的典型用法代码示例。如果您正苦于以下问题:Java StringUtils类的具体用法?Java StringUtils怎么用?Java StringUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringUtils类属于com.openbravo.pos.util包,在下文中一共展示了StringUtils类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
/**
*
* @param app
* @throws BeanFactoryException
*/
@Override
public void init(AppView app) throws BeanFactoryException {
// Resource
try {
ScriptEngine eng = ScriptFactory.getScriptEngine(ScriptFactory.BEANSHELL);
eng.put("app", app);
bean = (BeanFactory) eng.eval(StringUtils.readResource(script));
if (bean == null) {
// old definition
bean = (BeanFactory) eng.get("bean");
}
// todo // llamar al init del bean
if (bean instanceof BeanFactoryApp) {
((BeanFactoryApp) bean).init(app);
}
// JG 16 May use multicatch
} catch (ScriptException | IOException e) {
throw new BeanFactoryException(e);
}
}
示例2: getSHA1
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
public String getSHA1(String input){
byte[] output = null;
try {
MessageDigest md = MessageDigest.getInstance("SHA1");
md.update(input.getBytes());
output = md.digest();
} catch (Exception e) {
System.out.println("Exception: "+e);
}
return StringUtils.byte2hex(output);
}
示例3: getSHA1
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
/**
*
* @param input
* @return
*/
public String getSHA1(String input){
byte[] output = null;
try {
MessageDigest md = MessageDigest.getInstance("SHA1");
md.update(input.getBytes());
output = md.digest();
} catch (Exception e) {
// System.out.println("Exception: "+e);
}
return StringUtils.byte2hex(output);
}
示例4: jButton2ActionPerformed
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
if (JOptionPane.showConfirmDialog(this, AppLocal.getIntString("message.cardnew"), AppLocal.getIntString("title.editor"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
jcard.setText(m_App.getUserCard() + StringUtils.getCardNumber());
m_Dirty.setDirty(true);
}
}
示例5: getTransactionID
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
public String getTransactionID(){
return (getPayments().size()>0)
? ( getPayments().get(getPayments().size()-1) ).getTransactionID()
: StringUtils.getCardNumber(); //random transaction ID
}
示例6: printName
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
public String printName() {
return StringUtils.encodeXML(attributes.getProperty("product.name"));
}
示例7: JPrincipalApp
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
/** Creates new form JPrincipalApp */
public JPrincipalApp(JRootApp appview, AppUser appuser) {
m_appview = appview;
m_appuser = appuser;
m_dlSystem = (DataLogicSystem) m_appview.getBean("com.openbravo.pos.forms.DataLogicSystem");
// Cargamos los permisos del usuario
m_appuser.fillPermissions(m_dlSystem);
m_actionfirst = null;
m_jLastView = null;
m_aPreparedViews = new HashMap<String, JPanelView>();
m_aCreatedViews = new HashMap<String, JPanelView>();
initComponents();
jPanel2.add(Box.createVerticalStrut(50), 0);
applyComponentOrientation(appview.getComponentOrientation());
m_principalnotificator = new JLabel();
m_principalnotificator.applyComponentOrientation(getComponentOrientation());
m_principalnotificator.setText(m_appuser.getName());
m_principalnotificator.setIcon(m_appuser.getIcon());
// m_principalnotificator.setBorder(javax.swing.BorderFactory.createCompoundBorder(javax.swing.BorderFactory.createLineBorder(javax.swing.UIManager.getDefaults().getColor("TextField.shadow")), javax.swing.BorderFactory.createEmptyBorder(1, 5, 1, 5)));
if (jButton1.getComponentOrientation().isLeftToRight()) {
menu_open = new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/menu-right.png"));
menu_close = new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/menu-left.png"));
} else {
menu_open = new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/menu-left.png"));
menu_close = new javax.swing.ImageIcon(getClass().getResource("/com/openbravo/images/menu-right.png"));
}
assignMenuButtonIcon();
// m_jPanelTitle.setUI(new GradientUI());
m_jPanelTitle.setBorder(RoundedBorder.createGradientBorder());
m_jPanelTitle.setVisible(false);
// Anado el panel nulo
m_jPanelContainer.add(new JPanel(), "<NULL>");
showView("<NULL>");
try {
m_jPanelLeft.setViewportView(getScriptMenu(m_dlSystem.getResourceAsText("Menu.Root")));
} catch (ScriptException e) {
logger.log(Level.SEVERE, "Cannot read Menu.Root resource. Trying defaut menu.", e);
try {
m_jPanelLeft.setViewportView(getScriptMenu(StringUtils.readResource("/com/openbravo/pos/templates/Menu.Root.txt")));
} catch (IOException ex) {
logger.log(Level.SEVERE, "Cannot read default menu", ex);
} catch (ScriptException es) {
logger.log(Level.SEVERE, "Cannot read default menu", es);
}
}
}
示例8: checkExpDate
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
private boolean checkExpDate(String sDate) {
return ( sDate.length()==4 && StringUtils.isNumber(sDate.trim()) );
}
示例9: jButton2ActionPerformed
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
if (JOptionPane.showConfirmDialog(this, AppLocal.getIntString("message.cardnew"), AppLocal.getIntString("title.editor"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION) {
jcard.setText("c" + StringUtils.getCardNumber());
m_Dirty.setDirty(true);
}
}
示例10: printTaxid
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
public String printTaxid() {
return StringUtils.encodeXML(taxid);
}
示例11: printName
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
public String printName() {
return StringUtils.encodeXML(name);
}
示例12: printHost
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
public String printHost() {
return StringUtils.encodeXML(m_sHost);
}
示例13: printLocation
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
public String printLocation() {
return StringUtils.encodeXML(m_locationOri.toString());
}
示例14: printReason
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
public String printReason() {
return StringUtils.encodeXML(m_reason.toString());
}
示例15: printName
import com.openbravo.pos.util.StringUtils; //导入依赖的package包/类
public String printName() {
return StringUtils.encodeXML(m_sProdName);
}