本文整理汇总了Java中com.openbravo.pos.util.Base64Encoder类的典型用法代码示例。如果您正苦于以下问题:Java Base64Encoder类的具体用法?Java Base64Encoder怎么用?Java Base64Encoder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Base64Encoder类属于com.openbravo.pos.util包,在下文中一共展示了Base64Encoder类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createValue
import com.openbravo.pos.util.Base64Encoder; //导入依赖的package包/类
public Object createValue() throws BasicException {
Object[] resource = new Object[4];
resource[0] = m_oId == null ? UUID.randomUUID().toString() : m_oId;
resource[1] = m_jName.getText();
ResourceType restype = (ResourceType) m_ResourceModel.getSelectedItem();
resource[2] = restype.getKey();
if (restype == ResourceType.TEXT) {
resource[3] = Formats.BYTEA.parseValue(m_jText.getText());
} else if (restype == ResourceType.IMAGE) {
resource[3] = ImageUtils.writeImage(m_jImage.getImage());
} else if (restype == ResourceType.BINARY) {
resource[3] = Base64Encoder.decode(m_jText.getText());
} else {
resource[3] = null;
}
return resource;
}
示例2: createValue
import com.openbravo.pos.util.Base64Encoder; //导入依赖的package包/类
/**
*
* @return
* @throws BasicException
*/
@Override
public Object createValue() throws BasicException {
Object[] resource = new Object[4];
resource[0] = m_oId == null ? UUID.randomUUID().toString() : m_oId;
resource[1] = m_jName.getText();
ResourceType restype = (ResourceType) m_ResourceModel.getSelectedItem();
resource[2] = restype.getKey();
if (restype == ResourceType.TEXT) {
resource[3] = Formats.BYTEA.parseValue(m_jText.getText());
} else if (restype == ResourceType.IMAGE) {
resource[3] = ImageUtils.writeImage(m_jImage.getImage());
} else if (restype == ResourceType.BINARY) {
resource[3] = Base64Encoder.decode(m_jText.getText());
} else {
resource[3] = null;
}
return resource;
}
示例3: createValue
import com.openbravo.pos.util.Base64Encoder; //导入依赖的package包/类
public Object createValue() throws BasicException {
Object[] resource = new Object[4];
resource[0] = m_oId == null ? UUID.randomUUID().toString() : m_oId;
resource[1] = m_jName.getText();
ResourceType restype = (ResourceType) m_ResourceModel.getSelectedItem();
resource[2] = restype.getKey();
if (restype == ResourceType.TEXT) {
resource[3] = Formats.BYTEA.parseValue(m_jText.getText());
} else if (restype == ResourceType.IMAGE) {
resource[3] = ImageUtils.writeImage(m_jImage.getImage());
} else if (restype == ResourceType.BINARY) {
resource[3] = Base64Encoder.decode(m_jText.getText());
} else {
resource[3] = null;
}
return resource;
}
示例4: writeValueDelete
import com.openbravo.pos.util.Base64Encoder; //导入依赖的package包/类
public void writeValueDelete(Object value) {
Object[] resource = (Object[]) value;
m_oId = resource[0];
m_jName.setText((String) resource[1]);
m_ResourceModel.setSelectedKey(resource[2]);
ResourceType restype = (ResourceType) m_ResourceModel.getSelectedItem();
if (restype == ResourceType.TEXT) {
m_jText.setText(Formats.BYTEA.formatValue(resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else if (restype == ResourceType.IMAGE) {
m_jText.setText(null);
m_jImage.setImage(ImageUtils.readImage((byte[]) resource[3]));
} else if (restype == ResourceType.BINARY) {
m_jText.setText(resource[3] == null
? null
: Base64Encoder.encodeChunked((byte[]) resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else {
m_jText.setText(null);
m_jImage.setImage(null);
}
m_jName.setEnabled(false);
m_jType.setEnabled(false);
m_jText.setEnabled(false);
m_jImage.setEnabled(false);
}
示例5: writeValueEdit
import com.openbravo.pos.util.Base64Encoder; //导入依赖的package包/类
public void writeValueEdit(Object value) {
Object[] resource = (Object[]) value;
m_oId = resource[0];
m_jName.setText((String) resource[1]);
m_ResourceModel.setSelectedKey(resource[2]);
ResourceType restype = (ResourceType) m_ResourceModel.getSelectedItem();
if (restype == ResourceType.TEXT) {
m_jText.setText(Formats.BYTEA.formatValue(resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else if (restype == ResourceType.IMAGE) {
m_jText.setText(null);
m_jImage.setImage(ImageUtils.readImage((byte[]) resource[3]));
} else if (restype == ResourceType.BINARY) {
m_jText.setText(resource[2] == null
? null
: Base64Encoder.encodeChunked((byte[]) resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else {
m_jText.setText(null);
m_jImage.setImage(null);
}
m_jName.setEnabled(true);
m_jType.setEnabled(true);
m_jText.setEnabled(true);
m_jImage.setEnabled(true);
}
示例6: writeValueDelete
import com.openbravo.pos.util.Base64Encoder; //导入依赖的package包/类
/**
*
* @param value
*/
@Override
public void writeValueDelete(Object value) {
Object[] resource = (Object[]) value;
m_oId = resource[0];
m_jName.setText((String) resource[1]);
m_ResourceModel.setSelectedKey(resource[2]);
ResourceType restype = (ResourceType) m_ResourceModel.getSelectedItem();
if (restype == ResourceType.TEXT) {
m_jText.setText(Formats.BYTEA.formatValue(resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else if (restype == ResourceType.IMAGE) {
m_jText.setText(null);
m_jImage.setImage(ImageUtils.readImage((byte[]) resource[3]));
} else if (restype == ResourceType.BINARY) {
m_jText.setText(resource[3] == null
? null
: Base64Encoder.encodeChunked((byte[]) resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else {
m_jText.setText(null);
m_jImage.setImage(null);
}
m_jName.setEnabled(false);
m_jType.setEnabled(false);
m_jText.setEnabled(false);
m_jImage.setEnabled(false);
}
示例7: writeValueEdit
import com.openbravo.pos.util.Base64Encoder; //导入依赖的package包/类
/**
*
* @param value
*/
@Override
public void writeValueEdit(Object value) {
Object[] resource = (Object[]) value;
m_oId = resource[0];
m_jName.setText((String) resource[1]);
m_ResourceModel.setSelectedKey(resource[2]);
ResourceType restype = (ResourceType) m_ResourceModel.getSelectedItem();
if (restype == ResourceType.TEXT) {
m_jText.setText(Formats.BYTEA.formatValue(resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else if (restype == ResourceType.IMAGE) {
m_jText.setText(null);
m_jImage.setImage(ImageUtils.readImage((byte[]) resource[3]));
} else if (restype == ResourceType.BINARY) {
m_jText.setText(resource[2] == null
? null
: Base64Encoder.encodeChunked((byte[]) resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else {
m_jText.setText(null);
m_jImage.setImage(null);
}
m_jName.setEnabled(true);
m_jType.setEnabled(true);
m_jText.setEnabled(true);
m_jImage.setEnabled(true);
}
示例8: writeValueDelete
import com.openbravo.pos.util.Base64Encoder; //导入依赖的package包/类
public void writeValueDelete(Object value) {
Object[] resource = (Object[]) value;
m_oId = resource[0];
m_jName.setText((String) resource[1]);
m_ResourceModel.setSelectedKey(resource[2]);
ResourceType restype = (ResourceType) m_ResourceModel.getSelectedItem();
if (restype == ResourceType.TEXT) {
m_jText.setText(Formats.BYTEA.formatValue(resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else if (restype == ResourceType.IMAGE) {
m_jText.setText(null);
m_jImage.setImage(ImageUtils.readImage((byte[]) resource[3]));
} else if (restype == ResourceType.BINARY) {
m_jText.setText(resource[3] == null
? null
: Base64Encoder.encodeChunked((byte[]) resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else {
m_jText.setText(null);
m_jImage.setImage(null);
}
m_jName.setEnabled(false);
m_jType.setEnabled(false);
m_jText.setEnabled(false);
m_jImage.setEnabled(false);
}
示例9: writeValueEdit
import com.openbravo.pos.util.Base64Encoder; //导入依赖的package包/类
public void writeValueEdit(Object value) {
Object[] resource = (Object[]) value;
m_oId = resource[0];
String sResourceName = (String) resource[1];
m_jName.setText(sResourceName);
m_jName.setBackground(null);
m_ResourceModel.setSelectedKey(resource[2]);
ResourceType restype = (ResourceType) m_ResourceModel.getSelectedItem();
if (restype == ResourceType.TEXT) {
m_jText.setText(Formats.BYTEA.formatValue(resource[3]));
if (sResourceName.toLowerCase().startsWith("printer.")
|| sResourceName.toLowerCase().startsWith("role.")
|| sResourceName.toLowerCase().startsWith("ticket.")
|| sResourceName.endsWith("/properties")) {
m_jText.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_XML);
} else if (sResourceName.toLowerCase().startsWith("menu.")
|| sResourceName.toLowerCase().startsWith("payment.")
|| sResourceName.toLowerCase().startsWith("script.")
|| sResourceName.toLowerCase().startsWith("event.")
|| sResourceName.toLowerCase().startsWith("code.")) {
m_jText.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_JAVA);
} else {
m_jText.setSyntaxEditingStyle(SyntaxConstants.SYNTAX_STYLE_NONE);
}
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else if (restype == ResourceType.IMAGE) {
m_jText.setText(null);
m_jImage.setImage(ImageUtils.readImage((byte[]) resource[3]));
} else if (restype == ResourceType.BINARY) {
m_jText.setText(resource[2] == null
? null
: Base64Encoder.encodeChunked((byte[]) resource[3]));
m_jText.setCaretPosition(0);
m_jImage.setImage(null);
} else {
m_jText.setText(null);
m_jImage.setImage(null);
}
m_jName.setEnabled(true);
m_jType.setEnabled(true);
m_jText.setEnabled(true);
m_jImage.setEnabled(true);
}