public class Notifications extends Object
Modifier and Type | Field and Description |
---|---|
static String |
EVENT_TYPE_ACTION |
static String |
EVENT_TYPE_CLOSED |
static String |
EVENT_TYPE_CREATED |
Constructor and Description |
---|
Notifications(DesktopConnection desktopConnection) |
Modifier and Type | Method and Description |
---|---|
boolean |
addEventListener(String eventType,
NotificationEventListener listener)
Add a listener to handle specified notification events.
|
CompletionStage<Boolean> |
clear(String id)
Clears a specific notification from the Notification Center.
|
CompletionStage<Integer> |
clearAll()
Clears all Notifications which were created by the calling application,
including child windows.
|
CompletionStage<NotificationOptions> |
create(NotificationOptions options)
Creates a new notification.
|
CompletionStage<List<NotificationOptions>> |
getAll()
Retrieves all Notifications which were created by the calling application,
including child windows.
|
CompletionStage<ProviderStatus> |
getProviderStatus()
Get notification service provider status.
|
boolean |
removeEventListener(String eventType,
NotificationEventListener listener)
Removes a listener previously added with addEventListener.
|
CompletionStage<Void> |
toggleNotificationCenter()
Toggles the visibility of the Notification Center.
|
public static final String EVENT_TYPE_ACTION
public static final String EVENT_TYPE_CREATED
public static final String EVENT_TYPE_CLOSED
public Notifications(DesktopConnection desktopConnection)
public CompletionStage<NotificationOptions> create(NotificationOptions options)
options
- Notification configuration options.public CompletionStage<Boolean> clear(String id)
id
- ID of the notification to clear.public CompletionStage<Integer> clearAll()
public CompletionStage<List<NotificationOptions>> getAll()
public CompletionStage<Void> toggleNotificationCenter()
public boolean addEventListener(String eventType, NotificationEventListener listener)
eventType
- EVENT_TYPE_ACTION, EVENT_TYPE_CREATED or EVENT_TYPE_CLOSED.listener
- the event listener to be added.public boolean removeEventListener(String eventType, NotificationEventListener listener)
eventType
- EVENT_TYPE_ACTION, EVENT_TYPE_CREATED or EVENT_TYPE_CLOSED.listener
- the event listener to be removed.public CompletionStage<ProviderStatus> getProviderStatus()
Copyright © 2022. All rights reserved.