Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.mylyn.commons.notifications.ui/src/org/eclipse/mylyn/internal/commons/notifications/ui/NotificationAction.java')
-rw-r--r--org.eclipse.mylyn.commons.notifications.ui/src/org/eclipse/mylyn/internal/commons/notifications/ui/NotificationAction.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/org.eclipse.mylyn.commons.notifications.ui/src/org/eclipse/mylyn/internal/commons/notifications/ui/NotificationAction.java b/org.eclipse.mylyn.commons.notifications.ui/src/org/eclipse/mylyn/internal/commons/notifications/ui/NotificationAction.java
new file mode 100644
index 00000000..0ae1fd48
--- /dev/null
+++ b/org.eclipse.mylyn.commons.notifications.ui/src/org/eclipse/mylyn/internal/commons/notifications/ui/NotificationAction.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Tasktop Technologies and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.commons.notifications.ui;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.mylyn.commons.notifications.core.NotificationSink;
+
+/**
+ * Describes how a {@link NotificationEvent} is handled. {@link NotificationAction}s store enablement and parameters
+ * that determine how the {@link NotificationSink} executes the action.
+ *
+ * @author Steffen Pingel
+ */
+public class NotificationAction {
+
+ private boolean selected;
+
+ private final NotificationSinkDescriptor sinkDescriptor;
+
+ public NotificationAction(NotificationSinkDescriptor sinkDescriptor) {
+ Assert.isNotNull(sinkDescriptor);
+ this.sinkDescriptor = sinkDescriptor;
+ }
+
+ public NotificationSinkDescriptor getSinkDescriptor() {
+ return sinkDescriptor;
+ }
+
+ public boolean isSelected() {
+ return selected;
+ }
+
+ public void setSelected(boolean selected) {
+ this.selected = selected;
+ }
+
+ @Override
+ public String toString() {
+ return sinkDescriptor.getLabel();
+ }
+
+}

Back to the top