Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.maddyhome.idea.vim.option
Class Option  view Option download Option.java

java.lang.Object
  extended bycom.maddyhome.idea.vim.option.Option
Direct Known Subclasses:
TextOption, ToggleOption

public abstract class Option
extends java.lang.Object

Represents an VIM options that can be set with the :set command. Listeners can be set that are interested in knowing when the value of the option changes.


Nested Class Summary
(package private) static class Option.NameSorter
          Helper method used to sort lists of options by their name
 
Field Summary
protected  java.lang.String abbrev
           
protected  java.util.ArrayList listeners
           
protected  java.lang.String name
           
 
Constructor Summary
protected Option(java.lang.String name, java.lang.String abbrev)
          Create the option
 
Method Summary
 void addOptionChangeListener(OptionChangeListener listener)
          Registers an option change listener.
protected  void fireOptionChangeEvent()
          Lets all listeners know that the value has changed.
 java.lang.String getAbbreviation()
          The short name of the option
 java.lang.String getName()
          The name of the option
abstract  boolean isDefault()
          Checks to see if the option's current value equals the default value
 void removeOptionChangeListener(OptionChangeListener listener)
          Removes the listener from the list.
abstract  void resetDefault()
          Sets the option to its default value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

abbrev

protected java.lang.String abbrev

listeners

protected java.util.ArrayList listeners
Constructor Detail

Option

protected Option(java.lang.String name,
                 java.lang.String abbrev)
Create the option

Method Detail

addOptionChangeListener

public void addOptionChangeListener(OptionChangeListener listener)
Registers an option change listener. The listener will receive an OptionChangeEvent whenever the value of this option changes.


removeOptionChangeListener

public void removeOptionChangeListener(OptionChangeListener listener)
Removes the listener from the list.


getName

public java.lang.String getName()
The name of the option


getAbbreviation

public java.lang.String getAbbreviation()
The short name of the option


isDefault

public abstract boolean isDefault()
Checks to see if the option's current value equals the default value


resetDefault

public abstract void resetDefault()
Sets the option to its default value.


fireOptionChangeEvent

protected void fireOptionChangeEvent()
Lets all listeners know that the value has changed. Subclasses are responsible for calling this when their value changes.