public class JideTableTransferHandler extends TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
Constructor and Description |
---|
JideTableTransferHandler() |
JideTableTransferHandler(String property) |
Modifier and Type | Method and Description |
---|---|
boolean |
canImport(JComponent c,
DataFlavor[] flavors) |
protected String |
convertElementToString(JTable table,
int rowIndex,
int columnIndex,
Object value)
Converts the element to string.
|
protected Object |
convertStringToElement(JTable table,
int rowIndex,
int columnIndex,
String text)
Converts the string to element.
|
protected Transferable |
createTransferable(JComponent c)
Create a Transferable to use as the source for a data transfer.
|
protected void |
exportDone(JComponent c,
Transferable data,
int action) |
int |
getSourceActions(JComponent c) |
boolean |
importData(JComponent comp,
Transferable t) |
protected boolean |
importString(JComponent c,
String str,
boolean isLocal)
Imports from the string.
|
protected boolean |
insertRow(JTable table,
int rowIndex,
Vector<Object> rowData)
Deprecated.
no longer get invoked.
|
boolean |
isAcceptImport()
Gets the flag indicating if importing data is accepted in this TransferHandler.
|
protected boolean |
removeRow(JTable table,
int rowIndex)
Deprecated.
no longer get invoked
|
void |
setAcceptImport(boolean acceptImport)
Sets the flag indicating if importing data is accepted in this TransferHandler.
|
canImport, exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getVisualRepresentation, importData, setDragImage, setDragImageOffset
public JideTableTransferHandler(String property)
public JideTableTransferHandler()
protected Transferable createTransferable(JComponent c)
createTransferable
in class TransferHandler
c
- The component holding the data to be transferred. This argument is provided to enable sharing of
TransferHandlers by multiple components.public boolean importData(JComponent comp, Transferable t)
importData
in class TransferHandler
public boolean canImport(JComponent c, DataFlavor[] flavors)
canImport
in class TransferHandler
protected boolean importString(JComponent c, String str, boolean isLocal)
c
- the componentstr
- the stringisLocal
- the flag indicating if it's imported from inside or outside of the same window/frame/dialog of the table@Deprecated protected boolean insertRow(JTable table, int rowIndex, Vector<Object> rowData)
importString(javax.swing.JComponent, String, boolean)
relies on this method to insert a new row if
necessary.
To implement DnD behavior for a non-DefaultTableModel, please implement this method to insert a row.table
- the tablerowIndex
- the row indexrowData
- the row data@Deprecated protected boolean removeRow(JTable table, int rowIndex)
table
- the tablerowIndex
- the row indexprotected String convertElementToString(JTable table, int rowIndex, int columnIndex, Object value)
table
- the tablerowIndex
- the row indexcolumnIndex
- the column indexvalue
- the value to convertprotected Object convertStringToElement(JTable table, int rowIndex, int columnIndex, String text)
table
- the tablerowIndex
- the row indexcolumnIndex
- the column indextext
- the string to convertpublic int getSourceActions(JComponent c)
getSourceActions
in class TransferHandler
protected void exportDone(JComponent c, Transferable data, int action)
exportDone
in class TransferHandler
public boolean isAcceptImport()
setAcceptImport(boolean)
public void setAcceptImport(boolean acceptImport)
acceptImport
- the flag