blob: 66041e948e46fa096d9297f5f4105c97f9639b89 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2008, 2017 xored software, Inc. and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* xored software, Inc. - initial API and Implementation (Alex Panchenko)
*******************************************************************************/
package org.eclipse.dltk.ui.tests.text;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.dltk.compiler.task.ITodoTaskPreferences;
import org.eclipse.dltk.compiler.task.TodoTask;
class TestTodoTaskPreferences implements ITodoTaskPreferences {
private final String[] tags;
private final boolean caseSensitive;
/**
* @param tags
* @param caseSensitive
*/
public TestTodoTaskPreferences(String[] tags, boolean caseSensitive) {
this.tags = new String[tags.length];
System.arraycopy(tags, 0, this.tags, 0, tags.length);
this.caseSensitive = caseSensitive;
}
@Override
public String[] getTagNames() {
return tags;
}
@Override
public List<TodoTask> getTaskTags() {
final List<TodoTask> taskTags = new ArrayList<>();
for (int i = 0; i < tags.length; ++i) {
taskTags.add(new TodoTask(tags[i], TodoTask.PRIORITY_NORMAL));
}
return taskTags;
}
@Override
public boolean isCaseSensitive() {
return caseSensitive;
}
@Override
public boolean isEnabled() {
return true;
}
}