Package org.odftoolkit.simple.text.list

Examples of org.odftoolkit.simple.text.list.List


      ListDecorator numberDecorator = new NumberDecorator(doc);
      ListDecorator outLineDecorator = new OutLineDecorator(doc);
      String[] subItemContents = { "sub list item 1", "sub list item 2",
          "sub list item 3" };

      List list1 = new List(sect);
      boolean removeResult = sect.removeList(list1);
      Assert.assertTrue(removeResult);

      List list2 = new List(sect, numberDecorator);
      list2.addItems(subItemContents);
      Assert.assertEquals(ListDecorator.ListType.NUMBER, list2.getType());
      removeResult = sect.removeList(list2);
      Assert.assertTrue(removeResult);

      List list3 = new List(sect, "Bullet List", null);
      list3.addItems(subItemContents);
      Assert.assertEquals(ListDecorator.ListType.BULLET, list3.getType());
      removeResult = sect.removeList(list3);
      Assert.assertTrue(removeResult);

      List list4 = sect.addList();
      removeResult = sect.removeList(list4);
      Assert.assertTrue(removeResult);

      List list5 = sect.addList(outLineDecorator);
      list5.addItems(subItemContents);
      Assert.assertEquals(ListDecorator.ListType.NUMBER, list5.getType());
      removeResult = sect.removeList(list5);
      Assert.assertTrue(removeResult);
    } catch (Exception e) {
      Logger.getLogger(ListTest.class.getName()).log(Level.SEVERE, null,
          e);
View Full Code Here


      ListDecorator outLineDecorator = new OutLineDecorator(doc);
      String[] subItemContents = { "sub list item 1", "sub list item 2",
          "sub list item 3" };

      // create 2 lists
      new List(sect, numberDecorator);
      sect.addList().addItems(subItemContents);

      Iterator<List> listIterator = sect.getListIterator();
      int i = 0;
      while (listIterator.hasNext()) {
        listIterator.next();
        i++;
      }
      Assert.assertEquals(2, i);

      // add 2 new lists.
      sect.addList(outLineDecorator);
      List list = sect.addList();
      listIterator = sect.getListIterator();
      i = 0;
      while (listIterator.hasNext()) {
        listIterator.next();
        i++;
View Full Code Here

      Slide slidepre = doc.newSlide(0, "testlayout", Slide.SlideLayout.TITLE_LEFT_CHART_RIGHT_OUTLINE);
      Textbox titleBox = slidepre.getTextboxByUsage(PresentationClass.TITLE).get(0);
        titleBox.setTextContent("This is the title");

      Textbox outline = slidepre.getTextboxByUsage(PresentationClass.OUTLINE).get(0);
        List txtList = outline.addList();
        txtList.addItem("List Item1");
        txtList.addItem("List Item2");

      doc.save(ResourceUtilities.newTestOutputFile("slidetitlelayout.odp"));
     
      //load
      doc = PresentationDocument.loadDocument(ResourceUtilities.getTestResourceAsStream("slidetitlelayout.odp"));
View Full Code Here

      rect1.width = 10000;
      rect1.height = 8000;
      Chart newChart = slidepre.createChart(title, lables, legends, data, rect);
     
      Textbox outline = slidepre.getTextboxByUsage(PresentationClass.OUTLINE).get(0);
        List txtList = outline.addList();
        txtList.addItem("List Item1");
        txtList.addItem("List Item2");
     
      Chart newChart1 = slidepre.createChart(title1, lables1, legends1, data1, rect1);

      doc.save(ResourceUtilities.newTestOutputFile("slidetitlelayout.odp"));
     
View Full Code Here

      rect2.height = 6000;
     
      Chart newChart = slidepre.createChart(title, lables, legends, data, rect);
      Chart newChart1 = slidepre.createChart(title1, lables1, legends1, data1, rect1);
      Textbox outline = slidepre.getTextboxByUsage(PresentationClass.OUTLINE).get(0);
        List txtList = outline.addList();
        txtList.addItem("List Item1");
        txtList.addItem("List Item2");
        Chart newChart2 = slidepre.createChart(title2, lables2, legends2, data2, rect2);
     
      doc.save(ResourceUtilities.newTestOutputFile("slidetitlelayout.odp"));
     
      //load
View Full Code Here

      titleTextbox.setTextContent("My Title1");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
      list1.addItem("Test outline2");

      presentDoc.save(ResourceUtilities.newTestOutputFile("abc.odp"));
    } catch (Exception e) {
      Logger.getLogger(TextBoxTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail();
View Full Code Here

      titleTextbox.setTextContent("This is Title");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
      list1.addItem("Test outline2");
     
      //
      Textbox rightTextbox = boxList.get(1);
      Assert.assertNotNull(rightTextbox);
     
      ListDecorator decorator = new NumberDecorator(presentDoc);
      rightTextbox.setBackgroundColor(Color.RED);
      List list2 = rightTextbox.addList(decorator);
      list2.addItem("test one");
      list2.addItem("test two");
      list2.addItem("test three");
     
      //save
      presentDoc.save(ResourceUtilities.newTestOutputFile("abc.odp"));
    } catch (Exception e) {
      Logger.getLogger(TextBoxTest.class.getName()).log(Level.SEVERE, null, e);
View Full Code Here

      titleTextbox.setTextContent("This is Title");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
      list1.addItem("Test outline2");
      leftTextbox.clearList();
      List list3 = leftTextbox.addList();
      list3.addItem("Test line3");
      list3.addItem("Test line3");
      //
      Textbox rightTextbox = boxList.get(1);
      Assert.assertNotNull(rightTextbox);
     
      ListDecorator decorator = new NumberDecorator(presentDoc);
      rightTextbox.setBackgroundColor(Color.RED);
      List list2 = rightTextbox.addList(decorator);
      list2.addItem("test one");
      list2.addItem("test two");
      list2.addItem("test three");
      rightTextbox.clearList();
      Iterator iterator = rightTextbox.getListIterator();
      Assert.assertEquals(false, iterator.hasNext());
     
      //save
View Full Code Here

      titleTextbox.setTextContent("This is Title");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
      list1.addItem("Test outline2");
      //
      Textbox rightTextbox = boxList.get(1);
      Assert.assertNotNull(rightTextbox);
     
      ListDecorator decorator = new NumberDecorator(presentDoc);
      rightTextbox.setBackgroundColor(Color.RED);
      List list2 = rightTextbox.addList(decorator);
      list2.addItem("test AAA");
      OdfElement odfEle = rightTextbox.getListContainerElement();
      NodeList nodes = odfEle.getChildNodes();
      for(int i=0;i<nodes.getLength();i++){
        Node node = nodes.item(i);
        Assert.assertEquals("test AAA", node.getTextContent());
View Full Code Here

      titleTextbox.setTextContent("This is Title");
      java.util.List<Textbox> boxList = slide1.getTextboxByUsage(PresentationDocument.PresentationClass.OUTLINE);
      Assert.assertNotNull(boxList);
      Assert.assertEquals(2, boxList.size());
      Textbox leftTextbox = boxList.get(0);
      List list1 = leftTextbox.addList();
      list1.addItem("Test outline1");
      list1.addItem("Test outline2");

      //
      Textbox rightTextbox = boxList.get(1);
      Assert.assertNotNull(rightTextbox);
     
      ListDecorator decorator = new NumberDecorator(presentDoc);
      rightTextbox.setBackgroundColor(Color.RED);
      List list2 = rightTextbox.addList();
      list2.addItem("test AAA");
      list2.addItem("test BBB");
      Iterator iterator = rightTextbox.getListIterator();
      while(iterator.hasNext()){
        List list = (List)iterator.next();
        Assert.assertEquals(2, list.size());
        Assert.assertEquals("test AAA", list.getItem(0).toString());
        Assert.assertEquals("test BBB", list.getItem(1).toString());
      }
     
      //save
      presentDoc.save(ResourceUtilities.newTestOutputFile("abc.odp"));
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.odftoolkit.simple.text.list.List

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.