本文整理汇总了Java中org.eclipse.ui.statushandlers.AbstractStatusHandler类的典型用法代码示例。如果您正苦于以下问题:Java AbstractStatusHandler类的具体用法?Java AbstractStatusHandler怎么用?Java AbstractStatusHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractStatusHandler类属于org.eclipse.ui.statushandlers包,在下文中一共展示了AbstractStatusHandler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getWorkbenchErrorHandler
import org.eclipse.ui.statushandlers.AbstractStatusHandler; //导入依赖的package包/类
/**
* 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();
}
}
};
}
示例2: getWorkbenchErrorHandler
import org.eclipse.ui.statushandlers.AbstractStatusHandler; //导入依赖的package包/类
@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);
}
};
}
示例3: getWorkbenchErrorHandler
import org.eclipse.ui.statushandlers.AbstractStatusHandler; //导入依赖的package包/类
public synchronized AbstractStatusHandler getWorkbenchErrorHandler()
{
if (ideWorkbenchErrorHandler == null)
{
ideWorkbenchErrorHandler =
new IDEWorkbenchErrorHandler(getWorkbenchConfigurer());
}
return ideWorkbenchErrorHandler;
}