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

Quick Search    Search Deep

org.gjt.sp.jedit.gui
Class HistoryModel  view HistoryModel download HistoryModel.java

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byorg.gjt.sp.jedit.gui.HistoryModel
All Implemented Interfaces:
javax.swing.ListModel, java.io.Serializable

public class HistoryModel
extends javax.swing.AbstractListModel

A history list. One history list can be used by several history text fields. Note that the list model implementation is incomplete; no events are fired when the history model changes.

Version:
$Id: HistoryModel.java,v 1.16 2003/11/06 03:38:44 spestov Exp $

Field Summary
private  java.util.Vector data
           
private static java.io.File history
           
private static long historyModTime
           
private static int max
           
private static java.util.Hashtable models
           
private static boolean modified
           
private  java.lang.String name
           
private static java.lang.String TO_ESCAPE
           
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
HistoryModel(java.lang.String name)
          Creates a new history list.
 
Method Summary
 void addItem(java.lang.String text)
          Adds an item to the end of this history list, trimming the list to the maximum number of items if necessary.
 void clear()
          Removes all entries from this history model.
 java.lang.Object getElementAt(int index)
          Returns an item from the history list.
 java.lang.String getItem(int index)
          Returns an item from the history list.
static HistoryModel getModel(java.lang.String name)
          Returns a named model.
 java.lang.String getName()
          Returns the name of this history list.
 int getSize()
          Returns the number of elements in this history list.
static void loadHistory()
           
static void propertiesChanged()
           
static void saveHistory()
           
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TO_ESCAPE

private static final java.lang.String TO_ESCAPE
See Also:
Constant Field Values

max

private static int max

name

private java.lang.String name

data

private java.util.Vector data

models

private static java.util.Hashtable models

modified

private static boolean modified

history

private static java.io.File history

historyModTime

private static long historyModTime
Constructor Detail

HistoryModel

public HistoryModel(java.lang.String name)
Creates a new history list. Calling this is normally not necessary.

Method Detail

addItem

public void addItem(java.lang.String text)
Adds an item to the end of this history list, trimming the list to the maximum number of items if necessary.


getItem

public java.lang.String getItem(int index)
Returns an item from the history list.


getElementAt

public java.lang.Object getElementAt(int index)
Returns an item from the history list. This method returns the same thing as getItem(int) 55 and only exists so that HistoryModel instances can be used as list models.

Since:
jEdit 4.2pre2

clear

public void clear()
Removes all entries from this history model.

Since:
jEdit 4.2pre2

getSize

public int getSize()
Returns the number of elements in this history list.


getName

public java.lang.String getName()
Returns the name of this history list. This can be passed to the HistoryTextField constructor.


getModel

public static HistoryModel getModel(java.lang.String name)
Returns a named model. If the specified model does not already exist, it will be created.


loadHistory

public static void loadHistory()

saveHistory

public static void saveHistory()

propertiesChanged

public static void propertiesChanged()