org.fife.rsta.ac.AbstractLanguageSupport Maven / Gradle / Ivy
/*
* 04/23/2010
*
* Copyright (C) 2010 Robert Futrell
* robert_futrell at users.sourceforge.net
* http://fifesoft.com/rsyntaxtextarea
*
* This library is distributed under a modified BSD license. See the included
* LICENSE.md file for details.
*/
package org.fife.rsta.ac;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import javax.swing.DefaultListCellRenderer;
import javax.swing.ListCellRenderer;
import javax.swing.UIManager;
import org.fife.ui.autocomplete.AutoCompletion;
import org.fife.ui.autocomplete.CompletionCellRenderer;
import org.fife.ui.autocomplete.CompletionProvider;
import org.fife.ui.autocomplete.Util;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
/**
* A base class for language support implementations.
*
* @author Robert Futrell
* @version 1.0
*/
public abstract class AbstractLanguageSupport implements LanguageSupport {
/**
* Map of all text areas using this language support to their installed
* {@link AutoCompletion} instances. This should be maintained by
* subclasses by adding to, and removing from, it in their
* {@link #install(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea)} and
* {@link #uninstall(org.fife.ui.rsyntaxtextarea.RSyntaxTextArea)} methods.
*/
private Map textAreaToAutoCompletion;
/**
* Whether auto-completion is enabled for this language.
*/
private boolean autoCompleteEnabled;
/**
* Whether auto-activation for completion choices is enabled for this
* language. Note that this parameter only matters if
* {@link #autoCompleteEnabled} is true
.
*/
private boolean autoActivationEnabled;
/**
* The delay for auto-activation, in milliseconds. This parameter is only
* honored if both {@link #autoCompleteEnabled} and
* {@link #autoActivationEnabled} are true
.
*/
private int autoActivationDelay;
/**
* Whether parameter assistance should be enabled for this language.
*/
private boolean parameterAssistanceEnabled;
/**
* Whether the description window is displayed when the completion list
* window is displayed.
*/
private boolean showDescWindow;
/**
* The default renderer for the completion list.
*/
private ListCellRenderer