/**
* Action called when OK button is pressed.
*/
public void actionOk() {
if (page != null) {
PageComment comment = page.getComment();
if (comment == null) {
comment = new PageComment();
}
comment.setComment(txtComments.getText());
try {
comment.setMaxMainArticles(Integer.valueOf(txtMaxMain.getText()));
} catch (NumberFormatException e) {
comment.setMaxMainArticles(null);
}
try {
comment.setMaxTemplateArticles(Integer.valueOf(txtMaxTemplate.getText()));
} catch (NumberFormatException e) {
comment.setMaxTemplateArticles(null);
}
try {
comment.setMaxOtherArticles(Integer.valueOf(txtMaxOther.getText()));
} catch (NumberFormatException e) {
comment.setMaxOtherArticles(null);
}
page.setComment(comment);
Configuration config = Configuration.getConfiguration();
config.addPojo(page.getWikipedia(), Configuration.POJO_PAGE_COMMENTS, comment, page.getTitle());
}