blob: a7366bda6f2ca1b1d9a3b1483ada9b8b550a421f [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2005, 2016 IBM Corporation 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
*
*******************************************************************************/
package org.eclipse.dltk.python.internal.ui.text;
import org.eclipse.dltk.python.ui.text.IPythonPartitions;
import org.eclipse.dltk.ui.text.ScriptSourceViewerConfiguration;
import org.eclipse.dltk.ui.text.ScriptTextTools;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.rules.IPartitionTokenScanner;
import org.eclipse.ui.texteditor.ITextEditor;
public class PythonTextTools extends ScriptTextTools {
private final static String[] LEGAL_CONTENT_TYPES = new String[] {
IPythonPartitions.PYTHON_STRING, IPythonPartitions.PYTHON_COMMENT };
public PythonTextTools(boolean autoDisposeOnDisplayDispose) {
super(IPythonPartitions.PYTHON_PARTITIONING, LEGAL_CONTENT_TYPES,
autoDisposeOnDisplayDispose);
}
@Override
public ScriptSourceViewerConfiguration createSourceViewerConfiguraton(
IPreferenceStore preferenceStore, ITextEditor editor,
String partitioning) {
return new PythonSourceViewerConfiguration(getColorManager(),
preferenceStore, editor, partitioning);
}
@Override
public IPartitionTokenScanner getPartitionScanner() {
return new PythonPartitionScanner();
}
}