Eclipse RCP应用程序中的自定义错误 [英] Custom errors in Eclipse RCP application

查看:112
本文介绍了Eclipse RCP应用程序中的自定义错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一种为RCP应用程序的用户提供自定义错误的方法,以帮助他们了解导致某些运行时错误的原因。我创建了一个自定义的问题视图,并在每次发生错误时创建一个标记。我在此视图中仅显示与注释相关的自定义标记类型的标记。

I was looking for a way to provide users of an RCP application customized errors that will help them understand what causes some runtime errors. I created a custom Problems view and I create a marker each time an error occur. I'm showing in this view only markers of a custom marker type that are related to an annotation.

我的问题:

1-有没有比这更好的方法?

1-Is there a better approach then this one ?

2-如何处理核心插件中发生的错误?在核心插件中调用Activator方法(例如Activator.logError(..)...)时,是否可以在ui插件中收到通知?

2-How to handle the errors that occur in a core plugin ? Is there a way to be notified in a ui plugin when an Activator method is called (like Activator.logError (..) ...) in a core plugin ?

推荐答案

您可以通过以下方式监听Eclipse日志上的日志记录事件:

You can listen to logging events on the Eclipse log by calling:

Platform.addLogListener(listener);

其中侦听器实现 org.eclipse.core.runtime.ILogListener

这篇关于Eclipse RCP应用程序中的自定义错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆