Java 类org.eclipse.ui.statushandlers.AbstractStatusHandler 实例源码

项目:gama    文件:ApplicationWorkbenchAdvisor.java   
/**
 * Method getWorkbenchErrorHandler()
 * @see org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor#getWorkbenchErrorHandler()
 */
@Override
public synchronized AbstractStatusHandler getWorkbenchErrorHandler() {
    return new AbstractStatusHandler() {

        @Override
        public void handle(final StatusAdapter statusAdapter, final int style) {
            final int severity = statusAdapter.getStatus().getSeverity();
            if ( severity == IStatus.INFO || severity == IStatus.CANCEL )
                return;
            final Throwable e = statusAdapter.getStatus().getException();
            final String message = statusAdapter.getStatus().getMessage();
            // Stupid Eclipse
            if ( !message.contains("File toolbar contribution item") )
                System.out.println("GAMA Caught a workbench message : " + message);
            if ( e != null ) {
                e.printStackTrace();
            }
        }
    };
}
项目:OpenSPIFe    文件:EnsembleWorkbenchAdvisor.java   
@Override
public synchronized AbstractStatusHandler getWorkbenchErrorHandler() {
    return new WorkbenchErrorHandler() {
        @Override
        public void handle(StatusAdapter statusAdapter, int style) {
            if (isClosing) {
                // we are shutting down, so just log
                WorkbenchPlugin.log(statusAdapter.getStatus());
                return;
            }
            if ((style & StatusManager.SHOW) != 0) {
                style = style | StatusManager.BLOCK;
            }
            super.handle(statusAdapter, style);
        }
    };
}
项目:limpet    文件:ApplicationWorkbenchAdvisor.java   
public synchronized AbstractStatusHandler getWorkbenchErrorHandler()
{
  if (ideWorkbenchErrorHandler == null)
  {
    ideWorkbenchErrorHandler =
        new IDEWorkbenchErrorHandler(getWorkbenchConfigurer());
  }
  return ideWorkbenchErrorHandler;
}