|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface MutableListModel
Specifies the requirements for a mutable list model.
The mutable list model adds suport for the following operations
to the javax.swing.ListModel interface:
javax.swing.Action's
for a group of elementsjava.awt.transfer.Transferable.
| Method Summary | |
|---|---|
void |
create(int index,
java.lang.Object type)
Creates the specified element type at the specified position in this list Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices). |
java.awt.datatransfer.Transferable |
exportTransferable(int[] indices)
Creates a Transferable to use as the source for a data transfer of the specified elements. |
javax.swing.Action[] |
getActions(int[] indices)
Gets actions for the specified elements. |
java.lang.Object |
getCreatableType(int index)
Returns the default type of elements that can be created at the specified index of the list. |
java.lang.Object[] |
getCreatableTypes(int index)
Returns the types of elements that can be created at the specified index of the list. |
int |
importTransferable(java.awt.datatransfer.Transferable t,
int action,
int index,
boolean asChild)
Causes a transfer to the model from the specified transferable. |
boolean |
isAddable(int index)
Returns true if an element can be added. |
boolean |
isEditable(int index)
Returns true if the value of the specified element may be changed using setElementAt(Object,int). |
boolean |
isImportable(java.awt.datatransfer.DataFlavor[] transferFlavors,
int action,
int index,
boolean asChild)
Indicates whether the model would accept an import of the given set of data flavors prior to actually attempting to import it. |
boolean |
isRemovable(int index)
Returns true if the specified element can be removed. |
java.lang.Object |
remove(int index)
Removes an element from the model. |
void |
setElementAt(java.lang.Object value,
int index)
Sets the value of an element at the given index. |
| Methods inherited from interface javax.swing.ListModel |
|---|
addListDataListener, getElementAt, getSize, removeListDataListener |
| Method Detail |
|---|
java.lang.Object[] getCreatableTypes(int index)
index - The insertion point. 0 <= index <= getSize()
java.lang.Object getCreatableType(int index)
index - The insertion point. 0 <= index <= getSize()
void create(int index,
java.lang.Object type)
index - index at which the specified element is to be inserted.type - element type to be inserted.
java.lang.IllegalArgumentException - if the type is not contained in
the array returned by getInsertableTypes(int).
java.lang.IndexOutOfBoundsException - if the index is out of range
(index < 0 || index > size()).boolean isAddable(int index)
index - index of the element. 0 <= index <= getSize()remove(int)boolean isRemovable(int index)
index - index of the element. 0 <= index <= getSize()remove(int)
java.lang.Object remove(int index)
throws java.lang.IllegalStateException
index - index of the element. 0 <= index <= getSize()
java.lang.IllegalStateException - if the element may not be removed.isRemovable(int)boolean isEditable(int index)
setElementAt(Object,int).
index - index of the element. 0 <= index <= getSize()setElementAt(Object, int)
void setElementAt(java.lang.Object value,
int index)
throws java.lang.IllegalStateException
value - - the new valueindex - - the index whose value is to be changed. 0 <= index < getSize()
java.lang.IllegalStateException - if the element is not editable.isEditable(int)javax.swing.Action[] getActions(int[] indices)
indices - The elements.java.awt.datatransfer.Transferable exportTransferable(int[] indices)
indices - Element indices.
boolean isImportable(java.awt.datatransfer.DataFlavor[] transferFlavors,
int action,
int index,
boolean asChild)
transferFlavors - the data formats availableaction - The action DnDConstants.ACTION_COPY, .ACTION_MOVE or
.ACTION_LINK.index - The insertion point. 0 <= index <= getSize()asChild - True if the Transferable is dropped as a child of
the element.
DnDConstants
int importTransferable(java.awt.datatransfer.Transferable t,
int action,
int index,
boolean asChild)
throws java.awt.datatransfer.UnsupportedFlavorException,
java.io.IOException
t - The transfer data.action - The action DnDConstants.ACTION_COPY, .ACTION_MOVE or
.ACTION_LINK.index - The insertion point. 0 <= index <= getSize()asChild - True if the Transferable is dropped as a child of
the element.
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
|
Copyright 2012-02-25 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||