Search in sources :

Example 6 with Notification

use of org.openide.awt.Notification in project almond by trixon.

the class NotifocationHelper method displayTextNotification.

public static void displayTextNotification(String title, String text, int autoCloseDelayMilliSeconds) {
    ImageIcon icon = ImageUtilities.loadImageIcon("se/trixon/almond/nbp/res/null.png", true);
    final Notification notification = NotificationDisplayer.getDefault().notify(title, icon, text, null);
    if (autoCloseDelayMilliSeconds > 0) {
        Runnable task = new Runnable() {

            @Override
            public void run() {
                notification.clear();
            }
        };
        sSCHEDULED_EXECUTOR_SERVICE.schedule(task, autoCloseDelayMilliSeconds, TimeUnit.MILLISECONDS);
    }
}
Also used : ImageIcon(javax.swing.ImageIcon) Notification(org.openide.awt.Notification)

Aggregations

Notification (org.openide.awt.Notification)6 ShowDataAccessPluginTask (au.gov.asd.tac.constellation.views.dataaccess.tasks.ShowDataAccessPluginTask)2 DataAccessUtilities (au.gov.asd.tac.constellation.views.dataaccess.utilities.DataAccessUtilities)2 NotificationDisplayer (org.openide.awt.NotificationDisplayer)2 Test (org.testng.annotations.Test)2 DataAccessTabPane (au.gov.asd.tac.constellation.views.dataaccess.components.DataAccessTabPane)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 ImageIcon (javax.swing.ImageIcon)1 ProgressHandle (org.netbeans.api.progress.ProgressHandle)1 Messages (org.openide.util.NbBundle.Messages)1