try
{
int precedence = precedenceCheckbox.getSelection() ? precedenceSpinner.getSelection() : -1;
Collection<UserClass> userClasses = userClassesComposite.getUserClasses();
Collection<GrantAndDenial> grantsAndDenials = grantsAndDenialsComposite.getGrantsAndDenials();
returnItemPermission = new ItemPermission( precedence, grantsAndDenials, userClasses );
super.okPressed();
}
catch ( Exception e )
{
MessageDialog.openError( getShell(), Messages.getString("ItemPermissionDialog.error.invalidItemPermission"), e.getMessage() ); //$NON-NLS-1$