try {
if (pages > 0 && inputFile != null) {
modelList = new Vector<VisualPageListItem>(pages);
if (template == null || template.size() <= 0) {
for (int i = 1; i <= pages; i++) {
modelList.add(new VisualPageListItem(i, inputFile.getCanonicalPath(), getProvidedPassword()));
}
} else {
for (DocumentPage page : template) {
if (page.getPageNumber() > 0 && page.getPageNumber() <= pages) {
VisualPageListItem currentItem = new VisualPageListItem(page.getPageNumber(), inputFile
.getCanonicalPath(), getProvidedPassword());
currentItem.setDeleted(page.isDeleted());
currentItem.setRotation(page.getRotation());
modelList.add(currentItem);
}
}
}
}