All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.fife.ui.rsyntaxtextarea.spell.DefaultSpellCheckableTokenIdentifier Maven / Gradle / Ivy

Go to download

A simple spell checker add-on for RSyntaxTextArea. It will spell-check comments in source code, or the entire file if you are editing plain text. Spelling errors are squiggle-underlined with the color of your choice, and tooltips are available offering any spelling suggestions.

There is a newer version: 3.3.1
Show newest version
/*
 * 03/19/2014
 *
 * DefaultSpellCheckableTokenIdentifier.java - Identifies comment tokens to
 * be spell checked.
 * 
 * This library is distributed under the LGPL.  See the included
 * SpellChecker.License.txt file for details.
 */
package org.fife.ui.rsyntaxtextarea.spell;

import org.fife.ui.rsyntaxtextarea.Token;


/**
 * The spell-checkable token identifier used by {@link SpellingParser} if
 * none is explicitly identified.  It causes all comment tokens to be
 * spell checked.
 *
 * @author Robert Futrell
 * @version 1.0
 */
public class DefaultSpellCheckableTokenIdentifier
		implements SpellCheckableTokenIdentifier {


	/**
	 * The default implementation of this method does nothing; this token
	 * identifier does not have state.
	 */
	@Override
	public void begin() {
	}


	/**
	 * The default implementation of this method does nothing; this token
	 * identifier does not have state.
	 */
	@Override
	public void end() {
	}


	/**
	 * Returns true if the token is a comment.
	 *
	 * @return true only if the token is a comment.
	 */
	@Override
	public boolean isSpellCheckable(Token t) {
		return t.isComment();
	}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy