use of org.eclipse.mylyn.tasks.core.data.TaskAttribute in project linuxtools by eclipse.
the class OSIORestSearchQueryPage method restoreStateFromUrl.
private void restoreStateFromUrl(String queryUrl) throws UnsupportedEncodingException {
// $NON-NLS-1$
queryUrl = queryUrl.substring(queryUrl.indexOf("?") + 1);
// $NON-NLS-1$
String[] options = queryUrl.split("&");
for (String option : options) {
String key;
// $NON-NLS-1$
int endindex = option.indexOf("=");
if (endindex == -1) {
key = null;
} else {
// $NON-NLS-1$
key = option.substring(0, option.indexOf("="));
}
if (key == null || key.equals("order")) {
// $NON-NLS-1$
continue;
}
String value = // $NON-NLS-1$
URLDecoder.decode(// $NON-NLS-1$
option.substring(option.indexOf("=") + 1), getTaskRepository().getCharacterEncoding());
TaskAttribute attr = getTargetTaskData().getRoot().getAttribute(key);
if (attr != null) {
if (getTargetTaskData().getRoot().getAttribute(key).getValue().equals("")) {
// $NON-NLS-1$
getTargetTaskData().getRoot().getAttribute(key).setValue(value);
} else {
getTargetTaskData().getRoot().getAttribute(key).addValue(value);
}
}
}
}
Aggregations