Java RCP / SWT - “Android Toast like” Eclipse RCP中的对话框 [英] Java RCP/SWT - "Android Toast like" dialog in Eclipse RCP

查看:176
本文介绍了Java RCP / SWT - “Android Toast like” Eclipse RCP中的对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道是否存在某些弹出窗口的实现,比如Android:TOAST?

Does anybody know if there exist some implementation of some popup window, something like in Android: TOAST ?

推荐答案

通知是 Mylyn commons 的一部分。

要集成它们,请从 Mylyn Commons Notifications 功能发布/最新的rel =nofollow noreferrer> http://download.eclipse.org/mylyn/releases/latest 到您的目标平台定义。相关的包是

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 ) );

通知必须是<的子类code> 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中的对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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