org.eclipse.ui.statushandlers.StatusAdapter Java Examples

The following examples show how to use org.eclipse.ui.statushandlers.StatusAdapter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: N4StatusAreaProvider.java    From n4js with Eclipse Public License 1.0 6 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
public Control createSupportArea(final Composite parent, final StatusAdapter statusAdapter) {

	final IStatus status = statusAdapter.getStatus();

	if (status instanceof BinaryStatus) {
		final Binary binary = ((BinaryStatus) status).getBinary();
		final Composite control = new Composite(parent, SWT.NONE);
		control.setLayout(GridLayoutFactory.swtDefaults().margins(10, 10).create());
		control.setLayoutData(new GridData(FILL, FILL, true, true));
		return createCustomAreaWithLink(control, manager.getDialog(), binary);
	}

	return new DefaultDetailsArea(manager.getDialogState()).createSupportArea(parent, statusAdapter);
}
 
Example #2
Source File: ApplicationWorkbenchAdvisor.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
/**
 * 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();
			if ( e instanceof OutOfMemoryError ) {
				GamaExecutorService.EXCEPTION_HANDLER.uncaughtException(Thread.currentThread(), e);
			}
			final String message = statusAdapter.getStatus().getMessage();
			// Stupid Eclipse
			if ( !message.contains("File toolbar contribution item") &&
				!message.contains("Duplicate template id") ) {
				DEBUG.OUT("GAMA Caught a workbench message : " + message);
			}
			if ( e != null ) {
				e.printStackTrace();
			}
		}
	};
}
 
Example #3
Source File: BonitaStatusHandler.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void handle(StatusAdapter statusAdapter, int style) {
    if (style == StatusManager.SHOW) {
        String message = statusAdapter.getStatus().getMessage();
        if (message != null && message.contains("Server Tomcat")) {
            return;
        }else {
            super.handle(statusAdapter, style);
        }
    } else {
        super.handle(statusAdapter, style);
    }
}
 
Example #4
Source File: N4StatusHandler.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void handle(final StatusAdapter statusAdapter, final int style) {
	delegate.handle(statusAdapter, style);
}