Package org.odftoolkit.simple.table

Examples of org.odftoolkit.simple.table.Table


 
  @Test
  public void testGetSetLanguageParam() {
    try {
      SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = document.getTableByName("Sheet1");
      Font font = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 17.5, Color.GREEN, StyleTypeDefinitions.TextLinePosition.REGULAR, Locale.ENGLISH);
      Cell cell = table.getCellByPosition("A1");
      cell.setFont(font);
      cell.setStringValue("testGetFontStyle.");
     
      TextProperties textProperties = cell.getStyleHandler().getTextPropertiesForWrite();
      textProperties.setLanguage("Chinese", Document.ScriptType.CJK);
View Full Code Here


 
  @Test
  public void testGetCountry() {
    try {
      SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = document.getTableByName("Sheet1");
      Font font = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 17.5, Color.GREEN, StyleTypeDefinitions.TextLinePosition.REGULAR, Locale.ENGLISH);
      Cell cell = table.getCellByPosition("A1");
      cell.setFont(font);
      cell.setStringValue("testGetFontStyle.");
     
      TextProperties textProperties = cell.getStyleHandler().getTextPropertiesForWrite();
      textProperties.setCountry("china");
View Full Code Here

      FormControl textBox = form.createTextBox(para, textBoxRtg,
          "TextBox2", "TextBox2", false);
      textBox.setAnchorType(AnchorType.TO_CHARACTER);

      // textbox3
      Table table = Table.newTable(doc, 2, 2);
      Cell cell = table.getCellByPosition("B1");
      para = cell.addParagraph("Insert a text box here.");
      form.createTextBox(para, textBoxRtg, "TextBox3", "TextBox3", false);
     
      doc.save(ResourceUtilities
          .newTestOutputFile("TestCreateTextBox.odt"));
View Full Code Here

 
  @Test
  public void testGetCountryParam() {
    try {
      SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = document.getTableByName("Sheet1");
      Font font = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 17.5, Color.GREEN, StyleTypeDefinitions.TextLinePosition.REGULAR, Locale.ENGLISH);
      Cell cell = table.getCellByPosition("A1");
      cell.setFont(font);
      cell.setStringValue("testGetFontStyle.");
     
      TextProperties textProperties = cell.getStyleHandler().getTextPropertiesForWrite();
      textProperties.setCountry("china", Document.ScriptType.WESTERN);
View Full Code Here

 
  @Test
  public void testGetColor() {
    try {
      SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = document.getTableByName("Sheet1");
      Font font = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 17.5, Color.GREEN, StyleTypeDefinitions.TextLinePosition.REGULAR, Locale.ENGLISH);
      Cell cell = table.getCellByPosition("A1");
      cell.setFont(font);
      cell.setStringValue("testGetFontStyle.");
     
      TextProperties textProperties = cell.getStyleHandler().getTextPropertiesForWrite();
      textProperties.setFontColor(Color.GREEN);
View Full Code Here

 
  @Test
  public void testGetSetName() {
    try {
      SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = document.getTableByName("Sheet1");
      Font font = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 17.5, Color.GREEN, StyleTypeDefinitions.TextLinePosition.REGULAR, Locale.ENGLISH);
      Cell cell = table.getCellByPosition("A1");
      cell.setFont(font);
      cell.setStringValue("testGetFontStyle.");
     
      TextProperties textProperties = cell.getStyleHandler().getTextPropertiesForWrite();
      textProperties.setFontName("fontname");
View Full Code Here

 
  @Test
  public void testGetSetNameParam() {
    try {
      SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = document.getTableByName("Sheet1");
      Font font = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 17.5, Color.GREEN, StyleTypeDefinitions.TextLinePosition.REGULAR, Locale.ENGLISH);
      Cell cell = table.getCellByPosition("A1");
      cell.setFont(font);
      cell.setStringValue("testGetFontStyle.");
     
      TextProperties textProperties = cell.getStyleHandler().getTextPropertiesForWrite();
      textProperties.setFontName("fontname", Document.ScriptType.WESTERN);
View Full Code Here

 
  @Test
  public void testSetFont() {
    try {
      SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = document.getTableByName("Sheet1");
      Font font = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 17.5, Color.GREEN, StyleTypeDefinitions.TextLinePosition.REGULAR, Locale.ENGLISH);
      Cell cell = table.getCellByPosition("A1");
      //cell.setFont(font);
      cell.setStringValue("testGetFontStyle.");
     
      TextProperties textProperties = cell.getStyleHandler().getTextPropertiesForWrite();
      textProperties.setFont(font);
View Full Code Here

  @Test
  public void testGetSheetByIndex() throws Exception{
    File file = new File(ResourceUtilities.getAbsolutePath("TestSpreadsheetTable.ods"));
    SpreadsheetDocument spDocument = SpreadsheetDocument.loadDocument(file);
    //index < 0 , Not expected, table ==null
    Table tablenull = spDocument.getSheetByIndex(-1);
    Assert.assertTrue((tablenull == null));
    //index > 0
    //index = 0
    Table tableSheet0 = spDocument.getSheetByIndex(0);
    Assert.assertTrue((tableSheet0 != null));
    Assert.assertEquals("Sheet1", tableSheet0.getTableName());
    Assert.assertEquals(29, tableSheet0.getColumnCount());
    //index = 1
    Table tableSheet1 = spDocument.getSheetByIndex(1);
    Assert.assertTrue((tableSheet1 != null));
    Assert.assertEquals("Sheet2", tableSheet1.getTableName());
    Assert.assertEquals(1, tableSheet1.getColumnCount());
  }
View Full Code Here

 
  @Test
  public void testSetFontName() {
    try {
      SpreadsheetDocument document = SpreadsheetDocument.newSpreadsheetDocument();
      Table table = document.getTableByName("Sheet1");
      Font font = new Font("Arial", StyleTypeDefinitions.FontStyle.ITALIC, 17.5, Color.GREEN, StyleTypeDefinitions.TextLinePosition.REGULAR, Locale.ENGLISH);
      Cell cell = table.getCellByPosition("A1");
      //cell.setFont(font);
      font.setFamilyName("Chinese");
      cell.setStringValue("testGetFontStyle.");
     
      TextProperties textProperties = cell.getStyleHandler().getTextPropertiesForWrite();
View Full Code Here

TOP

Related Classes of org.odftoolkit.simple.table.Table

Copyright © 2018 www.massapicom. 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.