KillRing (jEdit API Documentation)

Package org.gjt.sp.jedit.buffer

## Class KillRing

- java.lang.Object
- - org.gjt.sp.jedit.buffer.KillRing

- All Implemented Interfaces:
    `javax.swing.ListModel<java.lang.String>`, `MutableListModel<java.lang.String>`

      public class KillRing
      extends java.lang.Object
      implements MutableListModel<java.lang.String>

  The kill ring retains deleted text. This class is a singleton -- only one kill ring is used for all of jEdit. Nothing prevents plugins from making their own kill rings for whatever reason, though.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `KillRing()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addListDataListener​(javax.swing.event.ListDataListener listener)` |
    `java.lang.String` | `getElementAt​(int index)` |
    `static KillRing` | `getInstance()` |
    `int` | `getSize()` |
    `void` | `insertElementAt​(java.lang.String value, int index)` |
    `void` | `load()` |
    `void` | `propertiesChanged​(int historySize)` |
    `boolean` | `removeElement​(java.lang.Object value)` |
    `void` | `removeListDataListener​(javax.swing.event.ListDataListener listener)` |
    `protected void` | `reset​(java.util.Collection<java.lang.String> source)` | This method is made to be used by implementation of load() method to initialize (or reset) the killring by a loaded sequence of objects.
    `void` | `save()` |
    `static void` | `setInstance​(KillRing killRing)` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### KillRing

          public KillRing()

  - ### Method Detail

    - #### getInstance

          public static KillRing getInstance()

    - #### setInstance

          public static void setInstance​(KillRing killRing)

    - #### propertiesChanged

          public void propertiesChanged​(int historySize)

    - #### load

          public void load()

    - #### save

          public void save()

    - #### reset

          protected void reset​(java.util.Collection<java.lang.String> source)

      This method is made to be used by implementation of load() method to initialize (or reset) the killring by a loaded sequence of objects. Each element is converted to an element of the killring as followings: - If it is a String, it is converted as if it is a result of getElementAt(n).toString(). - Otherwise, it is converted as if it is a Object which was obtained by getElementAt(n).
      Parameters:
        `source` - the loaded killring.
      Since:
        jEdit 4.3pre12

    - #### addListDataListener

          public void addListDataListener​(javax.swing.event.ListDataListener listener)

      Specified by:
        `addListDataListener` in interface `javax.swing.ListModel<java.lang.String>`

    - #### removeListDataListener

          public void removeListDataListener​(javax.swing.event.ListDataListener listener)

      Specified by:
        `removeListDataListener` in interface `javax.swing.ListModel<java.lang.String>`

    - #### getElementAt

          public java.lang.String getElementAt​(int index)

      Specified by:
        `getElementAt` in interface `javax.swing.ListModel<java.lang.String>`

    - #### getSize

          public int getSize()

      Specified by:
        `getSize` in interface `javax.swing.ListModel<java.lang.String>`

    - #### removeElement

          public boolean removeElement​(java.lang.Object value)

      Specified by:
        `removeElement` in interface `MutableListModel<java.lang.String>`

    - #### insertElementAt

          public void insertElementAt​(java.lang.String value,
                                      int index)

      Specified by:
        `insertElementAt` in interface `MutableListModel<java.lang.String>`