|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JList
dsto.dfc.swing.undo.EditListView
public class EditListView
List view of an EditListModel
, with a custom renderer which
highlights not only the UndoableEdit
in the list,
but also the undo cursor of the MonitoredUndoManager
using the edit
list. Supports drop'n'drag of MonitoredEdit
s.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JList |
---|
JList.AccessibleJList, JList.DropLocation |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected boolean |
dragNDropEnabled
|
protected MonitoredUndoManager |
undoManager
|
Fields inherited from class javax.swing.JList |
---|
HORIZONTAL_WRAP, VERTICAL, VERTICAL_WRAP |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
EditListView()
For bean serialisation. |
|
EditListView(ListModel listModel,
MonitoredUndoManager undoManager)
Constructs an EditListView using the edits managed by the MonitoredUndoManager undoManager. |
|
EditListView(MonitoredUndoManager undoManager)
|
Method Summary | |
---|---|
List |
cloneSelectedEdits()
Returns a list of clones of the selected edits. |
void |
contentsChanged(ListDataEvent e)
|
void |
endDrag(DragSourceDropEvent e,
boolean moveData)
|
void |
executeDrop(DropTargetDropEvent dtde)
Execute a drop action. |
UndoableEdit |
getSelectedEdit()
Returns the currently selected edit or the MonitoredUndoManager.NULL_EDIT . |
List |
getSelectedEdits()
Returns an array of the currently selected edits. |
int |
getSupportedDragActions()
Return a mask of possible drag actions supported by this component eg DnDConstants.ACTION_COPY_OR_MOVE. |
int |
getSupportedDropActions()
Return a mask of actions supported by this component eg DnDConstants.ACTION_COPY_OR_MOVE. |
void |
hideDragUnderFeedback()
Remove any drag under feedback displayed by showDragUnderFeedback (). |
void |
intervalAdded(ListDataEvent e)
|
void |
intervalRemoved(ListDataEvent e)
|
boolean |
isDragNDropEnabled()
|
boolean |
isDragOK(DragGestureEvent e)
Return true if starting a drag in the given context is possible. |
boolean |
isDropOK(DropTargetDragEvent e)
Return true if a drop in the context in a DropTargetDragEvent is possible. |
void |
propertyChange(PropertyChangeEvent evt)
|
void |
setDragNDropEnabled(boolean enabled)
|
void |
setModel(ListModel listModel)
Changes the ListModel that the EditListView
uses. |
void |
setSelectedEdit(UndoableEdit edit)
For programmatically setting an edit as selected. |
void |
showDragUnderFeedback(boolean dropOK,
DropTargetDragEvent e)
Display any drag under (ie displayed under the mouse in the component) feedback. |
Transferable |
startDrag(DragGestureEvent e)
Start a drag operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected MonitoredUndoManager undoManager
protected boolean dragNDropEnabled
Constructor Detail |
---|
public EditListView()
public EditListView(MonitoredUndoManager undoManager)
public EditListView(ListModel listModel, MonitoredUndoManager undoManager)
EditListView
using the edits managed by the MonitoredUndoManager
undoManager.
Method Detail |
---|
public void setModel(ListModel listModel)
ListModel
that the EditListView
uses.
setModel
in class JList
public UndoableEdit getSelectedEdit()
MonitoredUndoManager.NULL_EDIT
.
public List getSelectedEdits()
public void setSelectedEdit(UndoableEdit edit)
public List cloneSelectedEdits()
public void propertyChange(PropertyChangeEvent evt)
propertyChange
in interface PropertyChangeListener
public void intervalAdded(ListDataEvent e)
intervalAdded
in interface ListDataListener
public void intervalRemoved(ListDataEvent e)
intervalRemoved
in interface ListDataListener
public void contentsChanged(ListDataEvent e)
contentsChanged
in interface ListDataListener
public void setDragNDropEnabled(boolean enabled)
public boolean isDragNDropEnabled()
public int getSupportedDragActions()
DragComponent
DragComponent.isDragOK(java.awt.dnd.DragGestureEvent)
.
getSupportedDragActions
in interface DragComponent
public boolean isDragOK(DragGestureEvent e)
DragComponent
isDragOK
in interface DragComponent
e
- The drag context.public Transferable startDrag(DragGestureEvent e)
DragComponent
startDrag
in interface DragComponent
e
- The gesture that started the drag.
public void endDrag(DragSourceDropEvent e, boolean moveData)
endDrag
in interface DragComponent
public int getSupportedDropActions()
DropComponent
DropComponent.isDropOK(java.awt.dnd.DropTargetDragEvent)
.
getSupportedDropActions
in interface DropComponent
public boolean isDropOK(DropTargetDragEvent e)
DropComponent
isDropOK
in interface DropComponent
e
- The drop context.public void showDragUnderFeedback(boolean dropOK, DropTargetDragEvent e)
DropComponent
showDragUnderFeedback
in interface DropComponent
dropOK
- The value of isDropOK () when the mouse first
entered the component.e
- The drop context.public void hideDragUnderFeedback()
DropComponent
hideDragUnderFeedback
in interface DropComponent
public void executeDrop(DropTargetDropEvent dtde)
DropComponent
executeDrop
in interface DropComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |