XDrawPage planPage = findPageByIndex(planIndex);
// Shape de titre
XShape titleShape = findShapeByType(planPage, SHAPE_TYPE_TITLETEXT);
if (titleShape != null) {
XSimpleText titleText = unoCast(XSimpleText.class, titleShape);
titleText.setString(bundle.getShortTocTitle());
}
// Shape principal
XShape mainShape = findShapeByType(planPage, SHAPE_TYPE_OUTLINER);
if (mainShape != null) {
XSimpleText mainText = unoCast(XSimpleText.class, mainShape);
XTextCursor cursor = mainText.createTextCursor();
cursor.getStart();
XPropertySet xCursorProps = unoCast(XPropertySet.class, cursor);
TabStop[] tabStops = new TabStop[1];
tabStops[0] = new TabStop(bundle.getShortTocTabulation(),
TabAlign.RIGHT, ',', '.');
xCursorProps.setPropertyValue("ParaTabStops", tabStops);
StringBuilder planBuilder = new StringBuilder();
String newLine = "";
for (SlideDesc slide : toc.getAllSlides()) {
if (slide.getLevel() == 1) {
planBuilder.append(newLine);
planBuilder.append(slide.getTitle());
planBuilder.append("\t");
planBuilder.append(slide.getPage());
newLine = "\n";
}
}
mainText.setString(planBuilder.toString());
}
// Shape de notes
XPresentationPage xPresentationPage = unoCast(
XPresentationPage.class, planPage);
XDrawPage planNotesPage = xPresentationPage.getNotesPage();
XShape notesShape = findShapeByType(planNotesPage, SHAPE_TYPE_NOTES);
if (notesShape != null) {
XSimpleText notesText = unoCast(XSimpleText.class, notesShape);
notesText.setString(bundle.getShortTocNotesText());
}
} catch (Exception e) {
throw new ImpressException(e);
}