| /******************************************************************************* |
| * 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 (Sam Faktorovich) |
| *******************************************************************************/ |
| package org.eclipse.dltk.ui.tests.text; |
| |
| import org.eclipse.dltk.internal.ui.text.DLTKColorManager; |
| import org.eclipse.dltk.ui.DLTKUIPlugin; |
| import org.eclipse.dltk.ui.text.ScriptCommentScanner; |
| import org.eclipse.jface.text.Document; |
| import org.eclipse.jface.text.rules.IRule; |
| import org.eclipse.jface.text.rules.Token; |
| |
| class TestScriptCommentScanner extends ScriptCommentScanner { |
| |
| public TestScriptCommentScanner(String[] tags, String commentKey, |
| String todoKey, boolean caseSensitive) { |
| super(new DLTKColorManager(true), DLTKUIPlugin.getDefault() |
| .getPreferenceStore(), commentKey, todoKey, |
| new TestTodoTaskPreferences(tags, caseSensitive)); |
| } |
| |
| public void setText(String text) { |
| setRange(new Document(text), 0, text.length()); |
| } |
| |
| public String getText() { |
| return fDocument.get(); |
| } |
| |
| /* |
| * increase visibility |
| */ |
| @Override |
| public Token getToken(String key) { |
| return super.getToken(key); |
| } |
| |
| /* |
| * increase visibility |
| */ |
| @Override |
| public IRule createTodoRule() { |
| return super.createTodoRule(); |
| } |
| } |