/*
 * Created on 2004-11-08
 *
 * Part of the Symbian development plug-in for Eclipse
 * Copyright (C) Mikołaj Zalewski, 2004
 */
package pl.zalewski.mikolaj.symbdev.ui.mmpedit;

import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.editors.text.TextEditor;

import pl.zalewski.mikolaj.symbdev.core.mmpmodel.BldInfModel;

/**
 * @author mikolaj
 *
 * Handles the edition of MMP files through the text editor with syntax
 * highlighting etc.  
 */
public class MMPTextEditor extends TextEditor {

    /**
     * Creates the text editor
     */
    public MMPTextEditor() {
        super();
		fColorManager = new ColorManager();
		setSourceViewerConfiguration(new MMPSourceViewerConfiguration(fColorManager));
		setDocumentProvider(BldInfModel.getDocumentProvider());
    }    
    
	public void dispose() {
	    IEditorInput input=getEditorInput();
		fColorManager.dispose();
		super.dispose();
		if (input!=null)
		    BldInfModel.editorDisconnected(input, getEditorSite().getShell());
	}    
    
    ColorManager fColorManager;
}
