use of com.willshex.blogwt.client.wizard.WizardPage in project blogwt by billy1380.
the class EditPagePage method onfinished.
/* (non-Javadoc)
*
* @see com.willshex.blogwt.client.wizard.PagePlanFinishedHandler#onfinished
* (java.util.List) */
@Override
public void onfinished(List<WizardPage<?>> pages) {
Page page = null;
Post post = null;
for (WizardPage<?> wizardPage : pages) {
if (wizardPage instanceof EditPageWizardPage) {
page = ((EditPageWizardPage) wizardPage).getData();
if (page.posts != null) {
page.posts.clear();
}
} else if (wizardPage instanceof SelectPostWizardPage) {
if (page.posts == null) {
page.posts = new ArrayList<Post>();
}
post = ((SelectPostWizardPage) wizardPage).getData();
page.posts.add(post);
}
}
if (page.id == null) {
PageController.get().createPage(page);
} else {
PageController.get().updatePage(page);
}
}
Aggregations