/** * Set language and currency for the currency symbol. * @param language the language for the country * @param country the country name */ public void setCurrencyLocale(String language, String country) { NumberCurrencySymbolElement cSymbol = getCurrencySymbolElement(); cSymbol.setNumberCountryAttribute(country); cSymbol.setNumberLanguageAttribute(language); }
/** * Set language and currency for the currency symbol. * @param language the language for the country * @param country the country name */ public void setCurrencyLocale(String language, String country) { NumberCurrencySymbolElement cSymbol = getCurrencySymbolElement(); cSymbol.setNumberCountryAttribute(country); cSymbol.setNumberLanguageAttribute(language); }
/** * Set language and currency for the currency symbol. * @param language the language for the country * @param country the country name */ public void setCurrencyLocale(String language, String country) { NumberCurrencySymbolElement cSymbol = getCurrencySymbolElement(); cSymbol.setNumberCountryAttribute(country); cSymbol.setNumberLanguageAttribute(language); }
/** * Set language and currency for the currency symbol. * Argument could be just a language like "el" or a * language and country like "en-US". * @param locale string in form language-country or language */ public void setCurrencyLocale(String locale) { NumberCurrencySymbolElement cSymbol = getCurrencySymbolElement(); int pos = locale.indexOf('-'); if (pos >= 0) { cSymbol.setNumberLanguageAttribute(locale.substring(0, pos)); cSymbol.setNumberCountryAttribute(locale.substring(pos + 1)); } else { cSymbol.setNumberLanguageAttribute(locale); } }
/** * Set language and currency for the currency symbol. * Argument could be just a language like "el" or a * language and country like "en-US". * @param locale string in form language-country or language */ public void setCurrencyLocale(String locale) { NumberCurrencySymbolElement cSymbol = getCurrencySymbolElement(); int pos = locale.indexOf('-'); if (pos >= 0) { cSymbol.setNumberLanguageAttribute(locale.substring(0, pos)); cSymbol.setNumberCountryAttribute(locale.substring(pos + 1)); } else { cSymbol.setNumberLanguageAttribute(locale); } }
/** * Set language and currency for the currency symbol. * Argument could be just a language like "el" or a * language and country like "en-US". * @param locale string in form language-country or language */ public void setCurrencyLocale(String locale) { NumberCurrencySymbolElement cSymbol = getCurrencySymbolElement(); int pos = locale.indexOf('-'); if (pos >= 0) { cSymbol.setNumberLanguageAttribute(locale.substring(0, pos)); cSymbol.setNumberCountryAttribute(locale.substring(pos + 1)); } else { cSymbol.setNumberLanguageAttribute(locale); } }
/** * Get the symbol of currency. * @return the currency symbol * @throws IllegalArgumentException an IllegalArgumentException will be thrown if the value type is not "currency". */ public String getCurrencySymbol() { if (getTypeAttr() != OfficeValueTypeAttribute.Value.CURRENCY) { throw new IllegalArgumentException(); } OdfStyle style = getCellStyleElement(); if (style != null) { String dataStyleName = style.getOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE, "data-style-name")); OdfNumberCurrencyStyle dataStyle = mCellElement.getAutomaticStyles().getCurrencyStyle(dataStyleName); if (dataStyle == null) { dataStyle = mDocument.getDocumentStyles().getCurrencyStyle(dataStyleName); } if ((dataStyle != null) && (dataStyle.getCurrencySymbolElement() != null)) { return dataStyle.getCurrencySymbolElement().getTextContent(); } } return null; }
/** * Get the symbol of currency. * @return the currency symbol * @throws IllegalArgumentException an IllegalArgumentException will be thrown if the value type is not "currency". */ public String getCurrencySymbol() { if (getTypeAttr() != OfficeValueTypeAttribute.Value.CURRENCY) { throw new IllegalArgumentException(); } OdfStyle style = getCellStyleElement(); if (style != null) { String dataStyleName = style.getOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE, "data-style-name")); OdfNumberCurrencyStyle dataStyle = mCellElement.getAutomaticStyles().getCurrencyStyle(dataStyleName); if (dataStyle == null) { dataStyle = mDocument.getDocumentStyles().getCurrencyStyle(dataStyleName); } if ((dataStyle != null) && (dataStyle.getCurrencySymbolElement() != null)) { return dataStyle.getCurrencySymbolElement().getTextContent(); } } return null; }
/** * Get the symbol of currency. * @return the currency symbol * @throws IllegalArgumentException an IllegalArgumentException will be thrown if the value type is not "currency". */ public String getCurrencySymbol() { if (getTypeAttr() != OfficeValueTypeAttribute.Value.CURRENCY) { throw new IllegalArgumentException(); } OdfStyle style = getCellStyleElement(); if (style != null) { String dataStyleName = style.getOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE, "data-style-name")); OdfNumberCurrencyStyle dataStyle = mCellElement.getAutomaticStyles().getCurrencyStyle(dataStyleName); if (dataStyle == null) { dataStyle = mDocument.getDocumentStyles().getCurrencyStyle(dataStyleName); } if ((dataStyle != null) && (dataStyle.getCurrencySymbolElement() != null)) { return dataStyle.getCurrencySymbolElement().getTextContent(); } } return null; }
/** * Get the symbol of currency. * * @return the currency symbol * @throws IllegalArgumentException * an IllegalArgumentException will be thrown if the value type * is not "currency". */ public String getCurrencySymbol() { if (getTypeAttr() != OfficeValueTypeAttribute.Value.CURRENCY) { throw new IllegalArgumentException(); } OdfStyleBase style = getStyleHandler().getStyleElementForRead(); if (style != null) { String dataStyleName = style.getOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE, "data-style-name")); OdfNumberCurrencyStyle dataStyle = mCellElement.getAutomaticStyles().getCurrencyStyle(dataStyleName); if (dataStyle == null) { dataStyle = mDocument.getDocumentStyles().getCurrencyStyle(dataStyleName); } if ((dataStyle != null) && (dataStyle.getCurrencySymbolElement() != null)) { return dataStyle.getCurrencySymbolElement().getTextContent(); } } return null; }
/** * Get the symbol of currency. * * @return the currency symbol * @throws IllegalArgumentException * an IllegalArgumentException will be thrown if the value type * is not "currency". */ public String getCurrencySymbol() { if (getTypeAttr() != OfficeValueTypeAttribute.Value.CURRENCY) { throw new IllegalArgumentException(); } OdfStyleBase style = getStyleHandler().getStyleElementForRead(); if (style != null) { String dataStyleName = style.getOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE, "data-style-name")); OdfNumberCurrencyStyle dataStyle = mCellElement.getAutomaticStyles().getCurrencyStyle(dataStyleName); if (dataStyle == null) { dataStyle = mDocument.getDocumentStyles().getCurrencyStyle(dataStyleName); } if ((dataStyle != null) && (dataStyle.getCurrencySymbolElement() != null)) { return dataStyle.getCurrencySymbolElement().getTextContent(); } } return null; }
/** * Get the symbol of currency. * * @return the currency symbol * @throws IllegalArgumentException * an IllegalArgumentException will be thrown if the value type * is not "currency". */ public String getCurrencySymbol() { if (getTypeAttr() != OfficeValueTypeAttribute.Value.CURRENCY) { throw new IllegalArgumentException(); } OdfStyleBase style = getStyleHandler().getStyleElementForRead(); if (style != null) { String dataStyleName = style.getOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE, "data-style-name")); OdfNumberCurrencyStyle dataStyle = mCellElement.getAutomaticStyles().getCurrencyStyle(dataStyleName); if (dataStyle == null) { dataStyle = mDocument.getDocumentStyles().getCurrencyStyle(dataStyleName); } if ((dataStyle != null) && (dataStyle.getCurrencySymbolElement() != null)) { return dataStyle.getCurrencySymbolElement().getTextContent(); } } return null; }