|
org.netbeans.spi.palette/1 1.6.10 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.netbeans.spi.palette.DragAndDropHandler
public abstract class DragAndDropHandler
An abstract class implemented by palette clients to implement drag and drop of new items into the palette window and to customize the default Transferable instance of items being dragged from the palette window to editor area.
Client's can support multiple DataFlavors that may help to enable/disable the drop when dragging an item over different editor area parts that allow only certain item types to be dropped into them.
Constructor Summary | |
---|---|
DragAndDropHandler()
|
Method Summary | |
---|---|
boolean |
canDrop(Lookup targetCategory,
DataFlavor[] flavors,
int dndAction)
|
boolean |
canReorderCategories(Lookup paletteRoot)
|
abstract void |
customize(ExTransferable t,
Lookup item)
Add your own custom DataFlavor as need to suppor drag-over a different parts of editor area. |
boolean |
doDrop(Lookup targetCategory,
Transferable item,
int dndAction,
int dropIndex)
Perform the drop operation and add the dragged item into the given category. |
boolean |
moveCategory(Lookup category,
int moveToIndex)
Move the given category to a new position. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DragAndDropHandler()
Method Detail |
---|
public abstract void customize(ExTransferable t, Lookup item)
t
- Item's default Transferable.item
- Palette item's Lookup.public boolean canDrop(Lookup targetCategory, DataFlavor[] flavors, int dndAction)
targetCategory
- Lookup of the category under the drop cursor.flavors
- Supported DataFlavors.dndAction
- Drop action type.
public boolean doDrop(Lookup targetCategory, Transferable item, int dndAction, int dropIndex)
targetCategory
- Lookup of the category that accepts the drop.item
- Transferable holding the item being dragged.dndAction
- Drag'n'drop action type.dropIndex
- Zero-based position where the dragged item should be dropped.
public boolean canReorderCategories(Lookup paletteRoot)
paletteRoot
- Lookup of palette's root node.
public boolean moveCategory(Lookup category, int moveToIndex)
category
- The lookup of category that is being dragged.moveToIndex
- Zero-based index to palette's root children Nodes
where the category should move to.
|
org.netbeans.spi.palette/1 1.6.10 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |