diff options
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationPopup.java')
-rw-r--r-- | org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationPopup.java | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationPopup.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationPopup.java index 6545f2a39..8e678d6d0 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationPopup.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListNotificationPopup.java @@ -19,7 +19,6 @@ import org.eclipse.mylar.internal.tasks.ui.views.TaskListView; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Display; @@ -91,7 +90,7 @@ public class TaskListNotificationPopup extends PopupDialog { if (count < NUM_NOTIFICATIONS_TO_DISPLAY) { Label notificationLabelIcon = toolkit.createLabel(sectionClient, ""); notificationLabelIcon.setImage(notification.getOverlayIcon()); - ImageHyperlink link = toolkit.createImageHyperlink(sectionClient, SWT.BEGINNING | SWT.WRAP); + ImageHyperlink link = toolkit.createImageHyperlink(sectionClient, SWT.BEGINNING | SWT.WRAP); link.setText(notification.getLabel()); link.setImage(notification.getNotificationIcon()); link.addHyperlinkListener(new HyperlinkAdapter() { @@ -122,7 +121,8 @@ public class TaskListNotificationPopup extends PopupDialog { } } else { int numNotificationsRemain = notifications.size() - count; - Hyperlink remainingHyperlink = toolkit.createHyperlink(sectionClient, numNotificationsRemain+NOTIFICATIONS_HIDDEN, SWT.NONE); + Hyperlink remainingHyperlink = toolkit.createHyperlink(sectionClient, numNotificationsRemain + + NOTIFICATIONS_HIDDEN, SWT.NONE); GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).applyTo(remainingHyperlink); remainingHyperlink.addHyperlinkListener(new HyperlinkAdapter() { @@ -137,7 +137,8 @@ public class TaskListNotificationPopup extends PopupDialog { windowShell.open(); } } - }}); + } + }); break; } count++; @@ -145,21 +146,18 @@ public class TaskListNotificationPopup extends PopupDialog { section.setClient(sectionClient); - Composite buttonsComposite = toolkit.createComposite(section); - section.setTextClient(buttonsComposite); - buttonsComposite.setLayout(new RowLayout()); - buttonsComposite.setBackground(section.getTitleBarBackground()); - final ImageHyperlink closeHyperlink = new ImageHyperlink(buttonsComposite, SWT.NONE); - toolkit.adapt(closeHyperlink, true, true); - closeHyperlink.setBackground(null); - closeHyperlink.setImage(TaskListImages.getImage(TaskListImages.NOTIFICATION_CLOSE)); - closeHyperlink.addHyperlinkListener(new HyperlinkAdapter() { - @Override + ImageHyperlink hyperlink = new ImageHyperlink(section, SWT.NONE); + toolkit.adapt(hyperlink, true, true); + hyperlink.setBackground(null); + hyperlink.setImage(TaskListImages.getImage(TaskListImages.NOTIFICATION_CLOSE)); + hyperlink.addHyperlinkListener(new HyperlinkAdapter() { public void linkActivated(HyperlinkEvent e) { close(); } }); + section.setTextClient(hyperlink); + form.pack(); return parent; } @@ -175,9 +173,10 @@ public class TaskListNotificationPopup extends PopupDialog { private Rectangle restoreBounds() { bounds = form.getBounds(); Rectangle maxBounds = null; -// IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); -// if (window != null) { -// maxBounds = window.getShell().getBounds(); + // IWorkbenchWindow window = + // PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + // if (window != null) { + // maxBounds = window.getShell().getBounds(); if (getShell() != null && !getShell().isDisposed()) { maxBounds = getShell().getDisplay().getClientArea(); } else { @@ -189,7 +188,7 @@ public class TaskListNotificationPopup extends PopupDialog { maxBounds = display.getBounds(); } - if (bounds.width > -1 && bounds.height > -1) { + if (bounds.width > -1 && bounds.height > -1) { if (maxBounds != null) { bounds.width = Math.min(bounds.width, maxBounds.width); bounds.height = Math.min(bounds.height, maxBounds.height); |