/*
* SyntaxEditorKit.java - jEdit's own editor kit
* Copyright (C) 1998, 1999 Slava Pestov
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
package org.gjt.sp.jedit.syntax;
import javax.swing.text.*;
import javax.swing.*;
/**
* An implementation of EditorKit used for syntax colorizing.
* It implements a view factory that maps elements to syntax colorizing
* views.
*
* This editor kit can be plugged into text components to give them
* colorization features. It can be used in other applications, not
* just jEdit. The syntax colorizing package doesn't depend on any
* jEdit classes.
*
* @author Slava Pestov
* @version $Id: SyntaxEditorKit.java,v 1.2 2002/03/26 18:21:01 tonyj Exp $
*
* @see org.gjt.sp.jedit.syntax.SyntaxView
*/
public class SyntaxEditorKit extends DefaultEditorKit implements ViewFactory
{
/**
* Returns an instance of a view factory that can be used for
* creating views from elements. This implementation returns
* the current instance, because this class already implements
* ViewFactory.
*/
public ViewFactory getViewFactory()
{
return this;
}
/**
* Creates a view from an element that can be used for painting that
* element. This implementation returns a new SyntaxView
* instance.
* @param elem The element
*/
public View create(Element elem)
{
return new SyntaxView(elem);
}
/**
* Creates a new instance of the default document for this
* editor kit. This returns a new instance of
* DefaultSyntaxDocument.
*/
public Document createDefaultDocument()
{
return new DefaultSyntaxDocument();
}
}
/*
* ChangeLog:
* $Log: SyntaxEditorKit.java,v $
* Revision 1.2 2002/03/26 18:21:01 tonyj
* Remove spurious carriage returns
*
* Revision 1.1.1.1 1999/10/21 01:48:13 tonyj
* Initial import from SourceSafe
*
* Revision 1.8 1999/03/24 05:45:27 sp
* Juha Lidfors' backup directory patch, removed debugging messages from various locations, documentation updates
*
* Revision 1.7 1999/03/13 09:11:46 sp
* Syntax code updates, code cleanups
*
* Revision 1.6 1999/03/13 08:50:39 sp
* Syntax colorizing updates and cleanups, general code reorganizations
*
* Revision 1.5 1999/03/12 23:51:00 sp
* Console updates, uncomment removed cos it's too buggy, cvs log tags added
*
*/
Ads help maintain this website.