Examples of OdfOfficeStyles


Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles

  public NumberDecorator(Document doc) {
    OdfContentDom contentDocument;
    try {
      contentDocument = doc.getContentDom();
      styles = contentDocument.getAutomaticStyles();
      OdfOfficeStyles documentStyles = doc.getDocumentStyles();
      listStyle = styles.getListStyle(DEFAULT_NAME);
      // create number style
      if (listStyle == null) {
        listStyle = styles.newListStyle();
        // <style:style style:name="Numbering_20_Symbols"
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles

  public BulletDecorator(Document doc) {
    OdfContentDom contentDocument;
    try {
      contentDocument = doc.getContentDom();
      styles = contentDocument.getAutomaticStyles();
      OdfOfficeStyles documentStyles = doc.getDocumentStyles();
      listStyle = styles.getListStyle(DEFAULT_NAME);
      // create bullet style
      if (listStyle == null) {
        listStyle = styles.newListStyle();
        // <style:style style:name="Numbering_20_Symbols"
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles

   */
  private void setWesternLanguage(Locale locale) throws Exception {
    if (getScriptType(locale) != ScriptType.WESTERN)
      return;

    OdfOfficeStyles styles = getStylesDom().getOfficeStyles();
    Iterable<OdfDefaultStyle> defaultStyles = styles.getDefaultStyles();
    if (defaultStyles != null) {
      Iterator<OdfDefaultStyle> itera = defaultStyles.iterator();
      while (itera.hasNext()) {
        OdfDefaultStyle style = itera.next();
        if (style.getFamily().getProperties().contains(OdfTextProperties.Language)) {
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles

  }

  private Locale getDefaultLanguageByProperty(OdfStyleProperty countryProp, OdfStyleProperty languageProp) throws Exception {
    String lang = null, ctry = null;

    OdfOfficeStyles styles = getStylesDom().getOfficeStyles();

    // get language and country setting from default style setting for
    // paragraph
    OdfDefaultStyle defaultStyle = styles.getDefaultStyle(OdfStyleFamily.Paragraph);
    if (defaultStyle != null) {
      if (defaultStyle.hasProperty(countryProp) && defaultStyle.hasProperty(languageProp)) {
        ctry = defaultStyle.getProperty(countryProp);
        lang = defaultStyle.getProperty(languageProp);
        return new Locale(lang, ctry);
      }
    }
    // if no default style setting for paragraph
    // get language and country setting from other default style settings
    Iterable<OdfDefaultStyle> defaultStyles = styles.getDefaultStyles();
    Iterator<OdfDefaultStyle> itera = defaultStyles.iterator();
    while (itera.hasNext()) {
      OdfDefaultStyle style = itera.next();
      if (style.hasProperty(countryProp) && style.hasProperty(languageProp)) {
        ctry = style.getProperty(countryProp);
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles

    String user_language = locale.getLanguage();
    if (!user_language.equals(Locale.CHINESE.getLanguage()) && !user_language.equals(Locale.TRADITIONAL_CHINESE.getLanguage())
        && !user_language.equals(Locale.JAPANESE.getLanguage()) && !user_language.equals(Locale.KOREAN.getLanguage()))
      return;

    OdfOfficeStyles styles = getStylesDom().getOfficeStyles();
    Iterable<OdfDefaultStyle> defaultStyles = styles.getDefaultStyles();
    if (defaultStyles != null) {
      Iterator<OdfDefaultStyle> itera = defaultStyles.iterator();
      while (itera.hasNext()) {
        OdfDefaultStyle style = itera.next();
        if (style.getFamily().getProperties().contains(OdfTextProperties.LanguageAsian)) {
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles

   * @throws Exception
   */
  private void setDefaultComplexLanguage(Locale locale) throws Exception {
    if (getScriptType(locale) != ScriptType.CTL)
      return;
    OdfOfficeStyles styles = getStylesDom().getOfficeStyles();
    Iterable<OdfDefaultStyle> defaultStyles = styles.getDefaultStyles();
    if (defaultStyles != null) {
      Iterator<OdfDefaultStyle> itera = defaultStyles.iterator();
      while (itera.hasNext()) {
        OdfDefaultStyle style = itera.next();
        if (style.getFamily().getProperties().contains(OdfTextProperties.LanguageComplex)) {
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles

      OdfStylesDom stylesDom = odfdoc.getStylesDom();
      Assert.assertNotNull(stylesDom);

      // test styles.xml:styles
      OdfOfficeStyles styles = odfdoc.getDocumentStyles();
      Assert.assertNotNull(styles);

      Assert.assertNotNull(styles.getDefaultStyle(OdfStyleFamily.Graphic));
      Assert.assertNotNull(styles.getDefaultStyle(OdfStyleFamily.Paragraph));
      Assert.assertNotNull(styles.getDefaultStyle(OdfStyleFamily.Table));
      Assert.assertNotNull(styles.getDefaultStyle(OdfStyleFamily.TableRow));

      OdfStyle style = styles.getStyle("Standard", OdfStyleFamily.Paragraph);
      Assert.assertNotNull(style);
      Assert.assertEquals(style.getStyleClassAttribute(), "text");

      style = styles.getStyle("List", OdfStyleFamily.Paragraph);
      Assert.assertNotNull(style);
      Assert.assertEquals(style.getProperty(StyleTextPropertiesElement.FontNameComplex), "Tahoma1");
      Assert.assertTrue(style.hasProperty(StyleTextPropertiesElement.FontNameComplex));
      Assert.assertFalse(style.hasProperty(StyleTextPropertiesElement.FontNameAsian));

      Assert.assertNull(styles.getStyle("foobar", OdfStyleFamily.Chart));

      // test styles.xml:automatic-styles
      OdfOfficeAutomaticStyles autostyles = stylesDom.getAutomaticStyles();
      Assert.assertNotNull(autostyles);
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles

  /** Returns the current Locale for the OdfStyleProperty of the corresponding UnicodeGroup */
  private Locale getDefaultLanguageByProperty(OdfStyleProperty countryProp,
      OdfStyleProperty languageProp) throws Exception {
    String lang = null, ctry = null;

    OdfOfficeStyles styles = getStylesDom().getOfficeStyles();

    // get language and country setting from default style setting for
    // paragraph
    OdfDefaultStyle defaultStyle = styles.getDefaultStyle(OdfStyleFamily.Paragraph);
    if (defaultStyle != null) {
      if (defaultStyle.hasProperty(countryProp) && defaultStyle.hasProperty(languageProp)) {
        ctry = defaultStyle.getProperty(countryProp);
        lang = defaultStyle.getProperty(languageProp);
        return new Locale(lang, ctry);
      }
    }
    // if no default style setting for paragraph
    // get language and country setting from other default style settings
    Iterable<OdfDefaultStyle> defaultStyles = styles.getDefaultStyles();
    Iterator<OdfDefaultStyle> itera = defaultStyles.iterator();
    while (itera.hasNext()) {
      OdfDefaultStyle style = itera.next();
      if (style.hasProperty(countryProp) && style.hasProperty(languageProp)) {
        ctry = style.getProperty(countryProp);
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles

   *            - an instance of Locale that the default language and country
   *            will be set to.
   * @throws Exception
   */
  private void setDefaultWesternLanguage(Locale locale) throws Exception {
    OdfOfficeStyles styles = getStylesDom().getOfficeStyles();
    Iterable<OdfDefaultStyle> defaultStyles = styles.getDefaultStyles();
    if (defaultStyles != null) {
      Iterator<OdfDefaultStyle> itera = defaultStyles.iterator();
      while (itera.hasNext()) {
        OdfDefaultStyle style = itera.next();
        if (style.getFamily().getProperties().contains(
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeStyles

   *            - an instance of Locale that the default Asian language and
   *            country will be set to.
   * @throws Exception
   */
  private void setDefaultAsianLanguage(Locale locale) throws Exception {
    OdfOfficeStyles styles = getStylesDom().getOfficeStyles();
    Iterable<OdfDefaultStyle> defaultStyles = styles.getDefaultStyles();
    if (defaultStyles != null) {
      Iterator<OdfDefaultStyle> itera = defaultStyles.iterator();
      while (itera.hasNext()) {
        OdfDefaultStyle style = itera.next();
        if (style.getFamily().getProperties().contains(
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.