use of net.sf.eclipsecs.core.config.CheckConfigurationWorkingCopy in project eclipse-cs by checkstyle.
the class CheckConfigurationWorkingSetEditor method addCheckConfig.
/**
* Create a new Check configuration.
*/
private void addCheckConfig() {
CheckConfigurationPropertiesDialog dialog = new CheckConfigurationPropertiesDialog(getShell(), null, mWorkingSet);
dialog.setBlockOnOpen(true);
if (Window.OK == dialog.open()) {
CheckConfigurationWorkingCopy newConfig = dialog.getCheckConfiguration();
mWorkingSet.addCheckConfiguration(newConfig);
mViewer.setInput(mWorkingSet.getWorkingCopies());
mViewer.refresh(true);
}
}
use of net.sf.eclipsecs.core.config.CheckConfigurationWorkingCopy in project eclipse-cs by checkstyle.
the class CheckConfigurationWorkingSetEditor method removeCheckConfig.
/**
* Remove a config.
*/
private void removeCheckConfig() {
IStructuredSelection selection = (IStructuredSelection) mViewer.getSelection();
CheckConfigurationWorkingCopy checkConfig = (CheckConfigurationWorkingCopy) selection.getFirstElement();
if (checkConfig == null || !checkConfig.isEditable()) {
//
return;
}
boolean confirm = MessageDialog.openQuestion(getShell(), Messages.CheckstylePreferencePage_titleDelete, NLS.bind(Messages.CheckstylePreferencePage_msgDelete, checkConfig.getName()));
if (confirm) {
//
if (mWorkingSet.removeCheckConfiguration(checkConfig)) {
mViewer.setInput(mWorkingSet.getWorkingCopies());
mViewer.refresh();
} else {
MessageDialog.openInformation(getShell(), Messages.CheckstylePreferencePage_titleCantDelete, NLS.bind(Messages.CheckstylePreferencePage_msgCantDelete, checkConfig.getName()));
return;
}
}
}
Aggregations