Provide more options to configure the NotificationPopup
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Java
- Estrellas
- 124
- Forks
- 269
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 68
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de eclipse-platform/eclipse.platform.ui
-
Theme controls do not show/hide when the checkbox is toggledPosiblemente ocupada @nburnwal09 la tomó hace 1 día. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
eclipse-platform/eclipse.platform.ui#4502 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
eclipse-platform/eclipse.platform.ui#4125 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
eclipse-platform/eclipse.platform.ui#4016 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
eclipse-platform/eclipse.platform.ui#3892 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
eclipse-platform/eclipse.platform.ui#2687 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de eclipse-platform/eclipse.platform.ui
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
apache/rocketmq-dashboard#6896 ·
Los mantenedores suelen responder en 3 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
OpenIntegrationEngine/engine#496 ·
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
SasanLabs/VulnerableApp#836 ·
Los mantenedores suelen responder en 1 día
-
enhancement frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Albertinesilva/backend-engineering-journey-java-springboot#46 ·
-
Snyk: vulnerabilities in jackson-databind 2.21.5Posiblemente ocupada @harrywu23 la tomó hoy. Abiertobug
Dificultad 1/5 1-3 horas Aptitud para principiantes 80/100
SOFTENG-310-Group-4/Project-A1-310-Group-4#115 ·
Los mantenedores suelen responder en 1 día