Permalink
Browse files

Improve collection capability names; add task comments capability

  • Loading branch information...
twschiller committed Nov 7, 2013
1 parent 0c427b8 commit 566d716ecc31a1a8495b45de16294c8a04fbedb0
@@ -2,7 +2,7 @@
<feature
id="edu.washington.cs.cupid.core"
label="Cupid for Eclipse"
version="1.3.3.v20131030-1350"
version="1.3.3.v20131106-1900"
provider-name="University of Washington PLSE"
plugin="edu.washington.cs.cupid"
license-feature="edu.washington.cs.cupid.license"
@@ -2,7 +2,7 @@
<feature
id="edu.washington.cs.cupid.mylyn"
label="Cupid Mylyn Capabilities"
version="1.3.2.v20131030-1130"
version="1.3.2.v20131106-1900"
provider-name="University of Washington PLSE"
plugin="edu.washington.cs.cupid"
license-feature="edu.washington.cs.cupid.license"
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Cupid Mylyn Capabilities
Bundle-SymbolicName: edu.washington.cs.cupid.mylyn;singleton:=true
Bundle-Version: 1.3.2.v20131030-1130
Bundle-Version: 1.3.2.v20131106-1900
Bundle-Activator: edu.washington.cs.cupid.mylyn.internal.Activator
Bundle-Vendor: University of Washington PLSE
Require-Bundle: org.eclipse.core.runtime,
@@ -0,0 +1,58 @@
package edu.washington.cs.cupid.mylyn;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.mylyn.internal.tasks.core.TaskComment;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskComment;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
import org.eclipse.mylyn.tasks.core.data.TaskData;
import com.google.common.collect.Lists;
import com.google.common.reflect.TypeToken;
import edu.washington.cs.cupid.capability.ICapability;
import edu.washington.cs.cupid.capability.linear.LinearCapability;
import edu.washington.cs.cupid.capability.linear.LinearJob;
import edu.washington.cs.cupid.capability.linear.LinearStatus;
public final class TaskCommentsCapability extends LinearCapability<ITask, List<ITaskComment>> {
public TaskCommentsCapability(){
super("Task Comments", "Get the comments for a Mylyn task",
TypeToken.of(ITask.class), new TypeToken<List<ITaskComment>>(){},
ICapability.Flag.PURE);
}
@Override
public LinearJob<ITask, List<ITaskComment>> getJob(ITask input) {
return new LinearJob<ITask, List<ITaskComment>>(this, input) {
@Override
protected LinearStatus<List<ITaskComment>> run(final IProgressMonitor monitor) {
try {
ITask task = getInput();
TaskData data = TasksUiPlugin.getTaskDataManager().getTaskData(getInput());
List<TaskAttribute> commentAttributes = data.getAttributeMapper().getAttributesByType(data, TaskAttribute.TYPE_COMMENT);
TaskRepository repository =TasksUiPlugin.getRepositoryManager().getRepository(data.getRepositoryUrl());
List<ITaskComment> result = Lists.newArrayList();
for (TaskAttribute a : commentAttributes){
result.add(new TaskComment(repository, task, a));
}
return new LinearStatus<List<ITaskComment>>(TaskCommentsCapability.this, result);
} catch (Exception e) {
return new LinearStatus<List<ITaskComment>>(e);
} finally {
monitor.done();
}
}
};
}
}
@@ -19,6 +19,7 @@
import edu.washington.cs.cupid.mylyn.ActiveContextCapability;
import edu.washington.cs.cupid.mylyn.InActiveContextCapability;
import edu.washington.cs.cupid.mylyn.MylynTaskCapability;
import edu.washington.cs.cupid.mylyn.TaskCommentsCapability;
import edu.washington.cs.cupid.mylyn.TaskContextCapability;
import edu.washington.cs.cupid.mylyn.TaskFilter;
import edu.washington.cs.cupid.mylyn.TasksForResource;
@@ -73,6 +74,7 @@ public void removeChangeListener(ICapabilityChangeListener listener) {
@Override
public ICapability[] publish() {
return new ICapability[]{
new TaskCommentsCapability(),
new MylynTaskCapability(),
new TaskContextCapability(),
new ActiveContextCapability(),
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Cupid
Bundle-SymbolicName: edu.washington.cs.cupid;singleton:=true
Bundle-Version: 1.3.4.v20131030-1350
Bundle-Version: 1.3.4.v20131106-1900
Bundle-Activator: edu.washington.cs.cupid.internal.CupidActivator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
@@ -16,7 +16,7 @@
* A capability that indicates whether any of the elements in the collection are true
*/
public Any() {
super("Any",
super("Any (One or More)",
"True if any of the elements are true",
new TypeToken<Collection<Boolean>>(){},
TypeToken.of(Boolean.class),
@@ -30,7 +30,7 @@
*/
public Count() {
super(
"Count",
"Count (Number of Elements)",
"Count the number of elements in a collection",
Flag.PURE);
}
@@ -32,7 +32,7 @@
*/
public Distinct() {
super(
"Distinct",
"Distinct (Remove Duplicates)",
"Returns the distinct elements in a collection",
Flag.PURE);
}
@@ -29,7 +29,7 @@
* A capability that indicates whether or not a collection is empty.
*/
public Empty() {
super("Empty",
super("Is Empty",
"True if the input is empty",
Flag.PURE);
}
@@ -31,7 +31,7 @@
*/
public Last() {
super(
"Last",
"Last Element",
"Gets the last item in a list",
Flag.PURE);
}
@@ -33,7 +33,7 @@
*/
public Max() {
super(
"Max",
"Maximum Element",
"Get the maximum element in a collection",
Flag.PURE);
}
@@ -37,7 +37,7 @@
*/
public MostFrequent() {
super(
"Most Frequent",
"Most Frequent Element",
"Get the most frequent element in a collection",
Flag.PURE);
}
@@ -30,7 +30,7 @@
*/
public NonEmpty() {
super(
"NonEmpty",
"Is Non-Empty (Has Elements)",
"True if the input is non empty",
Flag.PURE);
}
@@ -24,12 +24,12 @@
<feature url="features/edu.washington.cs.cupid.egit_1.3.2.v20131030-1130.jar" id="edu.washington.cs.cupid.egit" version="1.3.2.v20131030-1130">
<category name="edu.washington.cs.cupid.discover"/>
</feature>
<feature url="features/edu.washington.cs.cupid.mylyn_1.3.2.v20131030-1130.jar" id="edu.washington.cs.cupid.mylyn" version="1.3.2.v20131030-1130">
<category name="edu.washington.cs.cupid.discover"/>
</feature>
<feature url="features/edu.washington.cs.cupid.core_1.3.3.v20131030-1350.jar" id="edu.washington.cs.cupid.core" version="1.3.3.v20131030-1350">
<feature url="features/edu.washington.cs.cupid.core_1.3.3.v20131106-1900.jar" id="edu.washington.cs.cupid.core" version="1.3.3.v20131106-1900">
<category name="edu.washington.cs.cupid"/>
</feature>
<feature url="features/edu.washington.cs.cupid.mylyn_1.3.2.v20131106-1900.jar" id="edu.washington.cs.cupid.mylyn" version="1.3.2.v20131106-1900">
<category name="edu.washington.cs.cupid.discover"/>
</feature>
<category-def name="edu.washington.cs.cupid" label="Cupid"/>
<category-def name="edu.washington.cs.cupid.discover" label="Integration (Information Discovery)"/>
<category-def name="edu.washington.cs.cupid.visualize" label="Visualization"/>

0 comments on commit 566d716

Please sign in to comment.