Returns an initiliazed instance of toc component. @return the initialized component instance
()
| 1347 | * @return the initialized component instance |
| 1348 | */ |
| 1349 | public List getToc() { |
| 1350 | if (toc == null) {//GEN-END:|325-getter|0|325-preInit |
| 1351 | // write pre-init user code here |
| 1352 | toc = new List("Table of contents", Choice.IMPLICIT);//GEN-BEGIN:|325-getter|1|325-postInit |
| 1353 | toc.addCommand(getBACK_COMMAND()); |
| 1354 | toc.addCommand(getNEXT_COMMAND()); |
| 1355 | toc.setCommandListener(this); |
| 1356 | toc.setFitPolicy(Choice.TEXT_WRAP_DEFAULT); |
| 1357 | toc.setSelectCommand(getNEXT_COMMAND());//GEN-END:|325-getter|1|325-postInit |
| 1358 | // write post-init user code here |
| 1359 | final Book book = bookCanvas.getCurrentBook(); |
| 1360 | final int count = book.getChaptersCount(); |
| 1361 | for (int i = 0; i < count; i++) { |
| 1362 | toc.append(book.getChapter(i).getTitle(), null); |
| 1363 | } |
| 1364 | }//GEN-BEGIN:|325-getter|2| |
| 1365 | return toc; |
| 1366 | } |
| 1367 | //</editor-fold>//GEN-END:|325-getter|2| |
| 1368 | |
| 1369 | //<editor-fold defaultstate="collapsed" desc=" Generated Getter: GO_COMMAND ">//GEN-BEGIN:|359-getter|0|359-preInit |
no test coverage detected