blob: 18cbe5b76018d207e80664cb3abf567d342dc5c5 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2000, 2003 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.ui.examples.jspeditor;
import org.eclipse.jface.text.source.IAnnotationAccess;
import org.eclipse.ui.editors.text.FileDocumentProvider;
import org.eclipse.ui.editors.text.TextEditor;
import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess;
import org.eclipse.ui.texteditor.MarkerAnnotationPreferences;
/**
* A simple JSP Editor.
*
* @since 3.0
*/
public class JspEditor extends TextEditor {
/**
* The annotation preferences.
* @since 2.1
*/
private MarkerAnnotationPreferences fAnnotationPreferences;
/**
* Creates a new JSP editor.
*/
public JspEditor() {
super();
setSourceViewerConfiguration(new JspSourceViewerConfiguration(this));
setDocumentProvider(new FileDocumentProvider());
fAnnotationPreferences= new MarkerAnnotationPreferences();
/*
* FIXME:
* This would be the right thing to do. Currently
* we share the preferences with the text editor.
*/
// setPreferenceStore(JspUIPlugin.getDefault().getPreferenceStore());
}
/*
* @see TextEditor#createAnnotationAccess()
*/
protected IAnnotationAccess createAnnotationAccess() {
return new DefaultMarkerAnnotationAccess(fAnnotationPreferences);
}
/*
* @see org.eclipse.ui.editors.text.TextEditor#dispose()
*/
public void dispose() {
super.dispose();
fAnnotationPreferences= null;
}
}