Package org.odftoolkit.simple.text.list

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


      ListDecorator numberDecorator = new NumberDecorator(doc);
      ListDecorator imageDecorator = new ImageDecorator(doc, ResourceUtilities.getURI("image_list_item.png"));
      String[] numberItemContents = { "number item 1", "number item 2", "number item 3" };

      // add list.
      ListContainer container = table.getCellByPosition(0, 0);
      org.odftoolkit.simple.text.list.List bulletList = container.addList(bulletDecorator);
      bulletList.addItems(numberItemContents);
      container = table.getCellByPosition(1, 1);
      org.odftoolkit.simple.text.list.List numberList = container.addList(numberDecorator);
      numberList.addItems(numberItemContents);
      container = table.getCellByPosition(2, 2);
      org.odftoolkit.simple.text.list.List imageList = container.addList(imageDecorator);
      imageList.addItems(numberItemContents);
      // iterate list
      Assert.assertTrue(container.getListIterator().hasNext());
      // remove list
      container.clearList();
      Assert.assertFalse(container.getListIterator().hasNext());
    } catch (Exception e) {
      Logger.getLogger(TableCellTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here


      ListDecorator numberDecorator = new NumberDecorator(doc);
      ListDecorator imageDecorator = new ImageDecorator(doc, ResourceUtilities.getURI("image_list_item.png"));
      String[] numberItemContents = { "number item 1", "number item 2", "number item 3" };

      // add list.
      ListContainer container = table.getCellByPosition(0, 0);
      org.odftoolkit.simple.text.list.List bulletList = container.addList(bulletDecorator);
      bulletList.addItems(numberItemContents);
      container = table.getCellByPosition(1, 1);
      org.odftoolkit.simple.text.list.List numberList = container.addList(numberDecorator);
      numberList.addItems(numberItemContents);
      container = table.getCellByPosition(2, 2);
      org.odftoolkit.simple.text.list.List imageList = container.addList(imageDecorator);
      imageList.addItems(numberItemContents);
      // iterate list
      Assert.assertTrue(container.getListIterator().hasNext());
      // remove list
      container.clearList();
      Assert.assertFalse(container.getListIterator().hasNext());
    } catch (Exception e) {
      Logger.getLogger(TableCellTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      ListDecorator imageDecorator = new ImageDecorator(doc, ResourceUtilities.getURI("image_list_item.png"));
      String[] numberItemContents = { "number item 1", "number item 2", "number item 3" };

      // add list.
      Slide slide = doc.newSlide(0, "test0", Slide.SlideLayout.TITLE_OUTLINE);
      ListContainer container = slide.getNotesPage();
      org.odftoolkit.simple.text.list.List bulletList = container.addList(bulletDecorator);
      bulletList.addItems(numberItemContents);
      org.odftoolkit.simple.text.list.List numberList = container.addList(numberDecorator);
      numberList.addItems(numberItemContents);
      org.odftoolkit.simple.text.list.List imageList = container.addList(imageDecorator);
      imageList.addItems(numberItemContents);
      // iterate list
      Iterator<org.odftoolkit.simple.text.list.List> lists = container.getListIterator();
      int i = 0;
      while (lists.hasNext()) {
        lists.next();
        i++;
      }
      Assert.assertEquals(3, i);
      // remove list
      container.clearList();
      Assert.assertFalse(container.getListIterator().hasNext());
    } catch (Exception e) {
      Logger.getLogger(NotesTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      ListDecorator numberDecorator = new NumberDecorator(doc);
      ListDecorator imageDecorator = new ImageDecorator(doc, ResourceUtilities.getURI("image_list_item.png"));
      String[] numberItemContents = { "number item 1", "number item 2", "number item 3" };

      // add list.
      ListContainer container = doc.newSlide(0, "test0", Slide.SlideLayout.TITLE_OUTLINE);
      org.odftoolkit.simple.text.list.List bulletList = container.addList(bulletDecorator);
      bulletList.addItems(numberItemContents);
      container = doc.newSlide(1, "test1", Slide.SlideLayout.TITLE_PLUS_2_TEXT_BLOCK);
      org.odftoolkit.simple.text.list.List numberList = container.addList(numberDecorator);
      numberList.addItems(numberItemContents);
      container = doc.newSlide(2, "test2", Slide.SlideLayout.TITLE_PLUS_TEXT);
      org.odftoolkit.simple.text.list.List imageList = container.addList(imageDecorator);
      imageList.addItems(numberItemContents);
      // iterate list
      Assert.assertTrue(container.getListIterator().hasNext());
      // remove list
      container.clearList();
      Assert.assertFalse(container.getListIterator().hasNext());
    } catch (Exception e) {
      LOG.log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

      ListDecorator numberDecorator = new NumberDecorator(doc);
      ListDecorator imageDecorator = new ImageDecorator(doc, ResourceUtilities.getURI("image_list_item.png"));
      String[] numberItemContents = { "number item 1", "number item 2", "number item 3" };

      // add list.
      ListContainer container = table.getCellByPosition(0, 0);
      org.odftoolkit.simple.text.list.List bulletList = container.addList(bulletDecorator);
      bulletList.addItems(numberItemContents);
      container = table.getCellByPosition(1, 1);
      org.odftoolkit.simple.text.list.List numberList = container.addList(numberDecorator);
      numberList.addItems(numberItemContents);
      container = table.getCellByPosition(2, 2);
      org.odftoolkit.simple.text.list.List imageList = container.addList(imageDecorator);
      imageList.addItems(numberItemContents);
      // iterate list
      Assert.assertTrue(container.getListIterator().hasNext());
      // remove list
      container.clearList();
      Assert.assertFalse(container.getListIterator().hasNext());
    } catch (Exception e) {
      Logger.getLogger(TableCellTest.class.getName()).log(Level.SEVERE, null, e);
      Assert.fail(e.getMessage());
    }
  }
View Full Code Here

TOP

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

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.