Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-02-17 09:16:43 -0500
committerUwe Stieber2014-02-17 09:16:43 -0500
commitf37d71a82e5cf633956c23184a03f16df8d55fc8 (patch)
treea900d00c6eaf706d346395ae1f99e3286fc47476
parentd18dd7815e4f5bf339432162d9ff07b96b778451 (diff)
downloadorg.eclipse.tcf-f37d71a82e5cf633956c23184a03f16df8d55fc8.tar.gz
org.eclipse.tcf-f37d71a82e5cf633956c23184a03f16df8d55fc8.tar.xz
org.eclipse.tcf-f37d71a82e5cf633956c23184a03f16df8d55fc8.zip
Target Explorer: Make the notification popup close delay customizeable
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/delegates/DefaultFormTextFactoryDelegate.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/interfaces/IFormTextFactoryDelegate.java7
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/internal/popup/AbstractNotificationPopup.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/internal/popup/NotificationPopup.java2
4 files changed, 18 insertions, 1 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/delegates/DefaultFormTextFactoryDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/delegates/DefaultFormTextFactoryDelegate.java
index 6a629cb6e..6a2985a9a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/delegates/DefaultFormTextFactoryDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/delegates/DefaultFormTextFactoryDelegate.java
@@ -118,4 +118,12 @@ public class DefaultFormTextFactoryDelegate implements IFormTextFactoryDelegate
protected Image getImage(String key) {
return UIPlugin.getImage(key);
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.ui.notifications.interfaces.IFormTextFactoryDelegate#getNotificationCloseDelay()
+ */
+ @Override
+ public long getNotificationCloseDelay() {
+ return -1;
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/interfaces/IFormTextFactoryDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/interfaces/IFormTextFactoryDelegate.java
index 44c9ecd14..aa683b44e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/interfaces/IFormTextFactoryDelegate.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/interfaces/IFormTextFactoryDelegate.java
@@ -29,4 +29,11 @@ public interface IFormTextFactoryDelegate {
* @param event The notification event. Must not be <code>null</code>.
*/
public void populateFormText(FormToolkit toolkit, FormText widget, NotifyEvent event);
+
+ /**
+ * Returns the delay in milliseconds until to auto-close the notification popup.
+ *
+ * @return The delay in milliseconds or <code>-1</code> to apply the default delay.
+ */
+ public long getNotificationCloseDelay();
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/internal/popup/AbstractNotificationPopup.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/internal/popup/AbstractNotificationPopup.java
index 10feee51c..beb5ee3c9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/internal/popup/AbstractNotificationPopup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/internal/popup/AbstractNotificationPopup.java
@@ -565,7 +565,7 @@ public abstract class AbstractNotificationPopup extends Window {
}
public void setDelayClose(long delayClose) {
- this.delayClose = delayClose;
+ this.delayClose = delayClose >= 0 ? delayClose : DEFAULT_DELAY_CLOSE;
}
private Point fixupDisplayBounds(Point tipSize, Point location) {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/internal/popup/NotificationPopup.java b/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/internal/popup/NotificationPopup.java
index 83b5edb24..645ba2aa9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/internal/popup/NotificationPopup.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui.notifications/src/org/eclipse/tcf/te/ui/notifications/internal/popup/NotificationPopup.java
@@ -105,6 +105,8 @@ public class NotificationPopup extends AbstractNotificationPopup {
// Populate the widget content based on the current notification event
delegate.populateFormText(toolkit, widget, notification);
+ // Adjust the notification close delay
+ setDelayClose(delegate.getNotificationCloseDelay());
} else {
int numNotificationsRemain = notifications.size() - count;
ScalingHyperlink remainingLink = new ScalingHyperlink(notificationComposite, SWT.NO_FOCUS);

Back to the top