blob: e4df216181b846f22d04fb88f96597c766623ed5 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
/*******************************************************************************
* Copyright (c) 2004 - 2006 University Of British Columbia 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:
* University Of British Columbia - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.tasks.core;
import java.util.Collections;
import java.util.Set;
import org.w3c.dom.Element;
/**
* Responsible for storing and creating task list elements.
*
* When overriding these methods be sure not to perform network access since the Task List is
* read and written frequently.
*
* @author Mik Kersten
* @author Ken Sueda
* @since 2.0
*/
public abstract class AbstractTaskListFactory {
public static final String KEY_QUERY = "Query";
public static final String KEY_QUERY_STRING = "QueryString";
public static final String KEY_TASK = "Task";
public abstract boolean canCreate(AbstractTask task);
public boolean canCreate(AbstractRepositoryQuery query) {
return false;
}
public AbstractRepositoryQuery createQuery(String repositoryUrl, String queryString, String label, Element element){
return null;
}
public abstract AbstractTask createTask(String repositoryUrl, String taskId, String label, Element element);
public String getQueryElementName(AbstractRepositoryQuery query) {
return "";
}
public Set<String> getQueryElementNames() {
return Collections.emptySet();
}
public abstract String getTaskElementName();
public void setAdditionalAttributes(AbstractRepositoryQuery query, Element node) {
// ignore
}
public void setAdditionalAttributes(AbstractTask task, Element element) {
// ignore
}
}
|