Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications helper to show notifications #27

Merged
merged 2 commits into from
Sep 20, 2024
Merged

Conversation

pras0131
Copy link
Contributor

Reference ticket: https://issues.amazon.com/issues/ECLIPSE-293

The PR aims to create a common place to get the notifications displayed on some plugin actions. One of the first use cases where notifications will be required is the Customization use case, where we display a notification to the user once the selection of the customization is performed. The current PR does not aim at integrating this code with the logic where we wish to display the same (that will be done when the logic is implemented)

However, for local testing - this is how i used the newly created notification helper functionality.
final String message = "Amazon Q inline suggestions are now coming from the Amazon-Internal-V1 customization"; AbstractNotificationPopup notification = new NotificationHelper(Display.getCurrent(), "Amazon Q Customization", message, NotificationType.CUSTOMIZATION_CHANGED); notification.open();

Attaching a screenshot for the same:

Notification-Eclipse

@pras0131 pras0131 requested a review from breedloj September 19, 2024 15:47
Comment on lines 54 to 56
if (this.notificationType.equals(NotificationType.CUSTOMIZATION_CHANGED)) {
showStandardNotification(parent);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try to avoid this tight coupling to a specific NotificationType. If we anticipate multiple notification types we can subclass those off a base ToolkitNotification type. Granular text (e.g. for the customization message) should be passed in at time of use.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, then i'll also rename NotificationHelper as ToolkitNotification then and remove the NotificationType enum.

@breedloj breedloj merged commit a9d995b into main Sep 20, 2024
1 check passed
@breedloj breedloj deleted the paras/notificationHelper branch September 20, 2024 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants