use of net.sf.eclipsecs.core.config.CheckConfigurationTester in project eclipse-cs by checkstyle.
the class CheckConfigurationPropertiesDialog method okPressed.
/**
* @see org.eclipse.jface.dialogs.Dialog#okPressed()
*/
@Override
protected void okPressed() {
try {
// Check if the configuration is valid
mCheckConfig = mConfigurationEditor.getEditedWorkingCopy();
CheckConfigurationTester tester = new CheckConfigurationTester(mCheckConfig);
List<ResolvableProperty> unresolvedProps = tester.getUnresolvedProperties();
if (!unresolvedProps.isEmpty()) {
MessageDialog dialog = new MessageDialog(getShell(), Messages.CheckConfigurationPropertiesDialog_titleUnresolvedProps, null, NLS.bind(Messages.CheckConfigurationPropertiesDialog_msgUnresolvedProps, // $NON-NLS-1$
"" + unresolvedProps.size()), MessageDialog.WARNING, new String[] { Messages.CheckConfigurationPropertiesDialog_btnEditProps, Messages.CheckConfigurationPropertiesDialog_btnContinue, Messages.CheckConfigurationPropertiesDialog_btnCancel }, 0);
int result = dialog.open();
if (0 == result) {
ResolvablePropertiesDialog propsDialog = new ResolvablePropertiesDialog(getShell(), mCheckConfig);
propsDialog.open();
return;
} else if (1 == result) {
super.okPressed();
} else if (2 == result) {
return;
}
} else {
super.okPressed();
}
} catch (CheckstylePluginException e) {
CheckstyleLog.log(e);
this.setErrorMessage(e.getLocalizedMessage());
}
}
Aggregations