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

org.fife.ui.rsyntaxtextarea.parser.AbstractParser Maven / Gradle / Ivy

There is a newer version: 2.2.18
Show newest version
/*
 * 07/31/2009
 *
 * AbstractParser.java - A base implementation for parsers.
 * 
 * This library is distributed under a modified BSD license.  See the included
 * RSyntaxTextArea.License.txt file for details.
 */
package org.fife.ui.rsyntaxtextarea.parser;

import java.net.URL;


/**
 * A base class for {@link Parser} implementations.
 *
 * @author Robert Futrell
 * @version 1.0
 */
public abstract class AbstractParser implements Parser {

	/**
	 * Whether this parser is enabled.  If this is false, then
	 * this parser will not be run.
	 */
	private boolean enabled;

	/**
	 * Constructor.
	 */
	protected AbstractParser() {
		setEnabled(true);
	}

	/**
	 * Returns null.  Parsers that wish to show images in their
	 * tool tips should override this method to return the image base URL.
	 *
	 * @return null always.
	 */
	public URL getImageBase() {
		return null;
	}


	/**
	 * {@inheritDoc}
	 */
	public boolean isEnabled() {
		return enabled;
	}


	/**
	 * Toggles whether this parser is enabled.
	 *
	 * @param enabled Whether this parser is enabled.
	 * @see #isEnabled()
	 */
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy