问题描述
有没有人知道是否存在某些弹出窗口的实现,比如Android:TOAST?
Does anybody know if there exist some implementation of some popup window, something like in Android: TOAST ?
推荐答案
通知是的一部分。
要集成它们,请从到您的目标平台定义。相关的包是
To integrate them, add the Mylyn Commons Notifications feature from http://download.eclipse.org/mylyn/releases/latest to your target platform definition. The relevant bundles are
-
org.eclipse.mylyn.commons.notifications.ui
-
org.eclipse.mylyn.commons.notifications.core
。
org.eclipse.mylyn.commons.notifications.ui
org.eclipse.mylyn.commons.notifications.core
.
您可以将类别
和事件
添加到这样的通知扩展点:
You can add a category
and an event
to the notifications extension point like this:
</extension>
<extension
point="org.eclipse.mylyn.commons.notifications.ui.notifications">
<category
icon="icons/obj16/repository.gif"
id="myNotificationCategory"
label="My Category">
</category>
<event
categoryId="myNotificationCategory"
icon="icons/obj16/some-image.gif"
id="myEvent"
label="Hello World">
<defaultHandler
sinkId="org.eclipse.mylyn.commons.notifications.sink.Popup">
</defaultHandler>
<description>
This is the description of the event.
</description>
</event>
</extension>
要触发通知,请使用 NotificationService
像这样:
To trigger a notification, use the NotificationService
like this:
AbstractUiNotification notification = ...
NotificationsUi.getService().notify( asList( notification ) );
通知
必须是 AbstractUiNotification 其中传递给构造函数的 eventId
必须与扩展名中的匹配。
The notification
must be a subclass of AbstractUiNotification
where the eventId
passed to the constructor must match the one from the extension.
通知插件还在常规>通知下添加了一个首选项页面,允许用户选择应显示哪些通知。
The notifications plug-in also adds a preference page under General > Notifications that lets the user choose which notifications should be shown.
这篇关于Java RCP / SWT - “Android Toast like” Eclipse RCP中的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!