JIDE 3.5.15

com.jidesoft.list
Class AbstractUndoableListModel

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by com.jidesoft.list.AbstractUndoableListModel
All Implemented Interfaces:
EventFireListModel, ListUndoableSupport, UndoableSupport, Serializable, ListModel

public abstract class AbstractUndoableListModel
extends AbstractListModel
implements ListUndoableSupport

Abstract undoable list model that extends AbstractListModel.

Since:
3.3.5
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
AbstractUndoableListModel()
          The Constructor.
 
Method Summary
 void beginCompoundEdit(boolean isUndoRedo)
          Begins the edit of the model.
 void endCompoundEdit()
          Ends the edit of the model.
 void fireListDataEvent(ListDataEvent event)
          Fires a ListDataEvent.
 UndoableEditSupport getUndoableEditSupport()
          Gets the UndoableEditSupport instance to add UndoableListener.
 UndoManager getUndoManager()
          Gets the UndoManager.
abstract  boolean insertElementAtImpl(Object content, int index)
          Inserts an element in this list model.
abstract  boolean removeElementAtImpl(int index)
          Removes an element in this list model.
abstract  boolean setElementAtImpl(Object content, int index)
          Updates an element in this list model.
 void undoableInsertElementAt(Object content, int index)
          Inserts a row at the designated row index.
 void undoableRemoveElementAt(int index)
          Removes a row at the designated row index.
 void undoableSetElementAt(Object newContent, int index)
          Updates a row at the designated row index with the new row content .
 
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
 
Methods inherited from interface javax.swing.ListModel
getElementAt, getSize
 

Constructor Detail

AbstractUndoableListModel

public AbstractUndoableListModel()
The Constructor.

Method Detail

undoableInsertElementAt

public void undoableInsertElementAt(Object content,
                                    int index)
Description copied from interface: ListUndoableSupport
Inserts a row at the designated row index.

Invoking this method will be able to insert a row, then adds an UndoableEdit or fires an event if necessary.

Specified by:
undoableInsertElementAt in interface ListUndoableSupport
Parameters:
content - the row content
index - the row index

undoableRemoveElementAt

public void undoableRemoveElementAt(int index)
Description copied from interface: ListUndoableSupport
Removes a row at the designated row index.

Invoking this method will be able to remove a row, then adds an UndoableEdit or fires an event if necessary.

Specified by:
undoableRemoveElementAt in interface ListUndoableSupport
Parameters:
index - the row index

undoableSetElementAt

public void undoableSetElementAt(Object newContent,
                                 int index)
Description copied from interface: ListUndoableSupport
Updates a row at the designated row index with the new row content .

Invoking this method will be able to update a row, then adds an UndoableEdit or fires an event if necessary.

Specified by:
undoableSetElementAt in interface ListUndoableSupport
Parameters:
newContent - the row content
index - the row index

getUndoManager

public UndoManager getUndoManager()
Description copied from interface: UndoableSupport
Gets the UndoManager.

Specified by:
getUndoManager in interface UndoableSupport
Returns:
the UndoManager.

getUndoableEditSupport

public UndoableEditSupport getUndoableEditSupport()
Description copied from interface: UndoableSupport
Gets the UndoableEditSupport instance to add UndoableListener.

Specified by:
getUndoableEditSupport in interface UndoableSupport
Returns:
the UndoableEditSupport instance.

beginCompoundEdit

public void beginCompoundEdit(boolean isUndoRedo)
Description copied from interface: UndoableSupport
Begins the edit of the model.

Specified by:
beginCompoundEdit in interface UndoableSupport
Parameters:
isUndoRedo - the flag to indicate if this operation is triggered by undo/redo

endCompoundEdit

public void endCompoundEdit()
Description copied from interface: UndoableSupport
Ends the edit of the model.

Specified by:
endCompoundEdit in interface UndoableSupport

fireListDataEvent

public void fireListDataEvent(ListDataEvent event)
Description copied from interface: EventFireListModel
Fires a ListDataEvent.

Specified by:
fireListDataEvent in interface EventFireListModel
Parameters:
event - the event

insertElementAtImpl

public abstract boolean insertElementAtImpl(Object content,
                                            int index)
Inserts an element in this list model. Data operation only. It should not fire any event or add any UndoableEdit.

Parameters:
content - the content of the element
index - the element index
Returns:
true if the implementation succeeds. Otherwise false.

removeElementAtImpl

public abstract boolean removeElementAtImpl(int index)
Removes an element in this list model. Data operation only. It should not fire any event or add any UndoableEdit.

Parameters:
index - the element index
Returns:
true if the implementation succeeds. Otherwise false.

setElementAtImpl

public abstract boolean setElementAtImpl(Object content,
                                         int index)
Updates an element in this list model. Data operation only. It should not fire any event or add any UndoableEdit.

Parameters:
content - the content of the element
index - the element index
Returns:
true if the implementation succeeds. Otherwise false.

JIDE 3.5.15