Provide more options to configure the NotificationPopup
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Start in the org.eclipse.jface.notifications package, reading AbstractNotificationPopup for the hardcoded MIN_HEIGHT, MAX_WIDTH and PADDING_EDGE constants and NotificationPopup for the builder. Before writing code, check the three comments for whether maintainers agree on the builder API and on making the popup follow its parent shell by default. Done means the new options are configurable and the popup repositions on parent Move and Resize, which needs SWT knowledge and likely a test in the UI test bundle.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Let's make sure issue is not already fixed in latest builds first.
- I verified latest Integration Build of Eclipse SDK doesn't provide the feature.
Suggestion
The NotificationPopup (org.eclipse.jface.notifications) has some minor flaws, where some workarounds are necessary.
- The MIN_HEIGHT, MAX_WIDTH and PADDING_EDGE of the popup cannot be configured as desired, as it is hardcoded in the AbstractNotificationPopup.
To shrink the height of the popup, I needed to create a workaround like this:
Point size = popup.getShell().getSize();
Point location = popup.getShell().getLocation();
popup.getShell().pack();
popup.getShell().setLocation(location.x, location.y + (size.y - popup.getShell().getSize().y));
It would be nice to have these options in the builder like this:
NotificationPopup.forDisplay(Display.getDefault())
.text("A problem occurred.")
.title("Warning", true)
.minHeight(0)
.maxWidth(500)
.paddingEdge(10)
.open();
- The Popup does not follow its parent shell, when it is moved or resized. It would be nice to have an option for this when creating the popup (or maybe as default behavior)
The listener could look like this:
static void attachPopupFollower(Shell parentShell, Shell popupShell, int padding) {
Listener moveListener = e -> {
if (parentShell == null || parentShell.isDisposed()) {
return;
}
if (popupShell == null || popupShell.isDisposed()) {
return;
}
Rectangle clientArea = parentShell.getClientArea();
Point clientOriginOnDisplay = parentShell.toDisplay(clientArea.x, clientArea.y);
Point popupSize = popupShell.getSize();
int x = clientOriginOnDisplay.x + clientArea.width - popupSize.x - padding; //use the configured paddingEdge here
int y = clientOriginOnDisplay.y + clientArea.height - popupSize.y - padding;
popupShell.setLocation(x, y);
};
parentShell.addListener(SWT.Move, moveListener);
parentShell.addListener(SWT.Resize, moveListener);
popupShell.addListener(SWT.Dispose, e -> {
if (!parentShell.isDisposed()) {
parentShell.removeListener(SWT.Move, moveListener);
parentShell.removeListener(SWT.Resize, moveListener);
}
});
}
I attached the whole example as a file here.
Community
- I understand suggesting an enhancement doesn't mandate anyone to implement it. Other contributors may consider this suggestion, or not, at their own convenience. The most efficient way to get it fixed is that I implement it myself and contribute it back as a good quality patch to the project.
- Ngôn ngữ chính
- Java
- Star
- 124
- Fork
- 269
- Merge trung bình
- 2 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 70
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của eclipse-platform/eclipse.platform.ui
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
eclipse-platform/eclipse.platform.ui#4125 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
eclipse-platform/eclipse.platform.ui#4016 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
eclipse-platform/eclipse.platform.ui#3892 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
eclipse-platform/eclipse.platform.ui#2687 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Provide a shared color blend helper in JFaceCó thể đã có người làm @vogella đã nhận hôm nay. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
eclipse-platform/eclipse.platform.ui#4486 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của eclipse-platform/eclipse.platform.ui
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
NationalSecurityAgency/ghidra#9884 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Status: Pending Review Type: Feature Request
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
OpenRefine/OpenRefine#8019 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`timer` rule rejects dates the engine acceptsCó thể đã có người làm @MFA-G đã nhận hôm nay. Đang mởbug ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
camunda/bpmnlint-plugin-camunda-compat#281 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status: waiting-for-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100