browserContentProvider.removeFilter(renamer.changingFileFilter);
}
browserTableViewer.refresh(true);
}
});
final ControlDecoration lessThanZeroListNotification = new ControlDecoration(applyButton, SWT.RIGHT | SWT.TOP);
lessThanZeroListNotification.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_ERROR));
lessThanZeroListNotification.hide();
final ControlDecoration namingConflictNotification = new ControlDecoration(applyButton, SWT.RIGHT | SWT.TOP);
namingConflictNotification
.setDescriptionText("One or more files would have been renamed to the same thing. \nModify your inputs to avoid this happening again.");
namingConflictNotification.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_ERROR));
namingConflictNotification.hide();
final ControlDecoration badRegexNotification = new ControlDecoration(applyButton, SWT.RIGHT | SWT.TOP);
badRegexNotification.setDescriptionText("The regular expression you entered is invalid. Please edit it and try again");
badRegexNotification.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_ERROR));
badRegexNotification.hide();
final ControlDecoration ioExceptionNotification = new ControlDecoration(applyButton, SWT.RIGHT | SWT.TOP);
final String ioExceptionString = "An I/O Error occurred during renaming.";
ioExceptionNotification.setDescriptionText(ioExceptionString);
ioExceptionNotification.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_DEC_FIELD_WARNING));
ioExceptionNotification.hide();
renamer.addEventListener(new EventListener() {
@Override
public void seeEvent(EventType eventType, File file, RenamerRule rule) {
switch (eventType) {
case BadRegex:
badRegexNotification.show();
applyButton.setEnabled(false);
break;
case IOException:
ioExceptionNotification.setDescriptionText(ioExceptionString);
ioExceptionNotification.show();
break;
case CouldNotRename:
ioExceptionNotification.setDescriptionText("Could not rename <" + file.getName() + ">");
ioExceptionNotification.show();
break;
case NameConflict:
namingConflictNotification.show();
applyButton.setEnabled(false);
break;
case RenamedWithNoProblems:
namingConflictNotification.hide();
ioExceptionNotification.hide();
badRegexNotification.hide();
lessThanZeroListNotification.hide();
applyButton.setEnabled(true);
break;
case LessThanOneRomanList: