Provide more options to configure the NotificationPopup
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Java
- スター
- 124
- フォーク
- 269
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 70
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eclipse-platform/eclipse.platform.ui のほかの issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
eclipse-platform/eclipse.platform.ui#4125 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
eclipse-platform/eclipse.platform.ui#4016 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
eclipse-platform/eclipse.platform.ui#3892 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
eclipse-platform/eclipse.platform.ui#2687 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Provide a shared color blend helper in JFace対応中かも @vogella が今日担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
eclipse-platform/eclipse.platform.ui#4486 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
eclipse-platform/eclipse.platform.ui の issue をすべて見る
似ている issue
-
Status: Pending Review Type: Feature Request
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
OpenRefine/OpenRefine#8019 ·
メンテナーはふだん 1 日以内に返信
-
`timer` rule rejects dates the engine accepts対応中かも @MFA-G が今日担当しました。 オープンbug ready
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
camunda/bpmnlint-plugin-camunda-compat#281 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信
-
status: waiting-for-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信