boolean finish() { IPersonService service = (IPersonService) locator.getService(IPersonService.class); Person person = service.createPerson(getId()); if (person == null) { return false; } person.setGivenname(getGivenname()); person.setSurname(getSurname()); return true; }
private boolean validatePage() { if (getId() == 0) { return false; } IPersonService service = (IPersonService) locator.getService(IPersonService.class); if (service.getPerson(getId()) != null) { setErrorMessage( NLS.bind( ContributionMessages.PersonWizardPage_error_alreadyExists, new Integer(getId()))); return false; } if (getSurname() == null || getSurname().length() == 0) { setErrorMessage(ContributionMessages.PersonWizardPage_error_missingSurname); return false; } if (getGivenname() == null || getGivenname().length() == 0) { setErrorMessage(ContributionMessages.PersonWizardPage_error_missingGivenname); return false; } setErrorMessage(null); return true; }