I develop an eclipse plugin at the moment and I want to create a custom error dialog. I have tried to extend the workbencherrorhandler, but no dialog occurs. Can someone help me and tell me how to create a custom error Handler with equinox 2020 09. This is my first try:
public class StatusHandler extends WorkbenchErrorHandler {
@Override
public void handle(final StatusAdapter statusAdapter, final int style) {
if (statusAdapter.getStatus() instanceof MultiStatus
&& ((MultiStatus) statusAdapter.getStatus()).getPlugin().contains("de.audivw.jabaf")) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
Shell shell = PlatformUI.getWorkbench().getDisplay().getActiveShell();
MultiStatus ms = (MultiStatus) statusAdapter.getStatus();
ErrorDialog dialog = new ErrorDialog(shell, "Fehler", null, ms,
IStatus.OK | IStatus.INFO | IStatus.WARNING | IStatus.ERROR);
dialog.open();
}
});
return;
}
super.handle(statusAdapter, style);
}
}
Thank you for your help,
Tobias
WorkbenchAdvisor.getWorkbenchErrorHandlermethod - are you doing that? An ordinary plug-in the standard Eclipse can't change the error handler.