blob: 9ccb427b740e25e19fd37c4defc0ca2cbeadb166 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2005, 2007 IBM Corporation 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
*
*******************************************************************************/
package org.eclipse.dltk.ruby.internal.ui.templates;
import org.eclipse.dltk.ruby.internal.ui.RubyUI;
import org.eclipse.dltk.ruby.internal.ui.preferences.SimpleRubySourceViewerConfiguration;
import org.eclipse.dltk.ruby.internal.ui.text.RubyPartitions;
import org.eclipse.dltk.ruby.internal.ui.text.RubyTextTools;
import org.eclipse.dltk.ui.templates.ScriptTemplatePreferencePage;
import org.eclipse.dltk.ui.text.ScriptSourceViewerConfiguration;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.IWorkbenchPreferencePage;
public class RubyCodeTemplatesPreferencePage extends
ScriptTemplatePreferencePage implements IWorkbenchPreferencePage {
public RubyCodeTemplatesPreferencePage() {
setPreferenceStore(RubyUI.getDefault().getPreferenceStore());
setTemplateStore(RubyTemplateAccess.getInstance().getTemplateStore());
setContextTypeRegistry(RubyTemplateAccess.getInstance()
.getContextTypeRegistry());
}
protected ScriptSourceViewerConfiguration createSourceViewerConfiguration() {
IPreferenceStore store = RubyUI.getDefault().getPreferenceStore();
RubyTextTools textTools = RubyUI.getDefault().getTextTools();
return new SimpleRubySourceViewerConfiguration(textTools
.getColorManager(), store, null,
RubyPartitions.RUBY_PARTITIONING, false);
}
protected void setDocumentParticioner(IDocument document) {
RubyTextTools textTools = RubyUI.getDefault().getTextTools();
textTools.setupDocumentPartitioner(document,
RubyPartitions.RUBY_PARTITIONING);
}
}