public abstract class AbstractAcceptAction<DROPPED extends cz.cuni.amis.pogamut.sposh.elements.PoshElement,TARGET extends cz.cuni.amis.pogamut.sposh.elements.PoshElement> extends Object implements org.netbeans.api.visual.action.AcceptProvider
| Modifier and Type | Field and Description |
|---|---|
protected DataFlavor |
dataFlavor |
protected TARGET |
dataNode |
protected static Logger |
log |
protected PoshWidget |
widget |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractAcceptAction(DataFlavor dataFlavor,
TARGET dataNode)
same as other constructor, but we don't require widget.
|
protected |
AbstractAcceptAction(DataFlavor dataFlavor,
TARGET dataNode,
PoshWidget widget)
Create an abstract action in the widget widget that will do something to
data node dataNode when transferable of same data flavor as dataFlavor
is dropped onto widget.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(org.netbeans.api.visual.widget.Widget widget,
Point point,
Transferable transferable) |
protected void |
displayMessage(String message,
int messageType)
Display message using
NotifyDescriptor. |
DataFlavor |
getDataFlavor()
Get data flavor this accept provider accepts.
|
protected int |
getIndexInList(List list,
Object o)
Get index of object in the list.
|
org.netbeans.api.visual.action.ConnectorState |
isAcceptable(org.netbeans.api.visual.widget.Widget arg0,
Point arg1,
Transferable transferable) |
protected abstract void |
performAction(DROPPED droppedData)
When deriving from this widget, implement what should actually be done
in this function.
|
protected DataFlavor dataFlavor
protected TARGET extends cz.cuni.amis.pogamut.sposh.elements.PoshElement dataNode
protected PoshWidget widget
protected static final Logger log
protected AbstractAcceptAction(DataFlavor dataFlavor, TARGET dataNode, PoshWidget widget)
dataFlavor - data flavor we are accepting, no multiple flavors accepteddataNode - data node that will be used somehow when accept action happens.widget - widget transferable is dropped onto for this accept provider to work.protected AbstractAcceptAction(DataFlavor dataFlavor, TARGET dataNode)
dataFlavor - dataNode - public final org.netbeans.api.visual.action.ConnectorState isAcceptable(org.netbeans.api.visual.widget.Widget arg0,
Point arg1,
Transferable transferable)
isAcceptable in interface org.netbeans.api.visual.action.AcceptProviderpublic final void accept(org.netbeans.api.visual.widget.Widget widget,
Point point,
Transferable transferable)
accept in interface org.netbeans.api.visual.action.AcceptProviderpublic final DataFlavor getDataFlavor()
protected abstract void performAction(DROPPED droppedData)
droppedData - Object that was stored in the Transferable, basically object that was dropped.protected final int getIndexInList(List list, Object o)
list - list of object where this function will look for object o.o - object whos index we are looking forprotected final void displayMessage(String message, int messageType)
NotifyDescriptor.messgae - messageType - Type of message, from NotifyDescriptor.*_MESSAGECopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.