Eclipse Platform
2.1

org.eclipse.ui.views.navigator
Class LocalSelectionTransfer

java.lang.Object
  |
  +--org.eclipse.swt.dnd.Transfer
        |
        +--org.eclipse.swt.dnd.ByteArrayTransfer
              |
              +--org.eclipse.ui.views.navigator.LocalSelectionTransfer

public class LocalSelectionTransfer
extends ByteArrayTransfer

A LocalSelectionTransfer may be used for drag and drop operations within the same instance of Eclipse. The selection is made available directly for use in the DropTargetListener. dropAccept method. The DropTargetEvent passed to dropAccept does not contain the drop data. The selection may be used for validation purposes so that the drop can be aborted if appropriate. This class is not intended to be subclassed.

Since:
2.1

Method Summary
static LocalSelectionTransfer getInstance()
          Returns the singleton.
 ISelection getSelection()
          Returns the local transfer data.
protected  int[] getTypeIds()
          Returns the type id used to identify this transfer.
protected  String[] getTypeNames()
          Returns the type name used to identify this transfer.
 void javaToNative(Object object, TransferData transferData)
          Overrides org.eclipse.swt.dnd.ByteArrayTransfer#javaToNative(Object, TransferData).
 Object nativeToJava(TransferData transferData)
          Overrides org.eclipse.swt.dnd.ByteArrayTransfer#nativeToJava(TransferData).
 void setSelection(ISelection s)
          Sets the transfer data for local use.
 
Methods inherited from class org.eclipse.swt.dnd.ByteArrayTransfer
getSupportedTypes, isSupportedType
 
Methods inherited from class org.eclipse.swt.dnd.Transfer
registerType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static LocalSelectionTransfer getInstance()
Returns the singleton.

getSelection

public ISelection getSelection()
Returns the local transfer data.
Returns:
the local transfer data

getTypeIds

protected int[] getTypeIds()
Returns the type id used to identify this transfer.
Overrides:
getTypeIds in class Transfer
Returns:
the type id used to identify this transfer.

getTypeNames

protected String[] getTypeNames()
Returns the type name used to identify this transfer.
Overrides:
getTypeNames in class Transfer
Returns:
the type name used to identify this transfer.

javaToNative

public void javaToNative(Object object,
                         TransferData transferData)
Overrides org.eclipse.swt.dnd.ByteArrayTransfer#javaToNative(Object, TransferData). Only encode the transfer type name since the selection is read and written in the same process.
Overrides:
javaToNative in class ByteArrayTransfer
See Also:
ByteArrayTransfer.javaToNative(java.lang.Object, org.eclipse.swt.dnd.TransferData)

nativeToJava

public Object nativeToJava(TransferData transferData)
Overrides org.eclipse.swt.dnd.ByteArrayTransfer#nativeToJava(TransferData). Test if the native drop data matches this transfer type.
Overrides:
nativeToJava in class ByteArrayTransfer
See Also:
ByteArrayTransfer.nativeToJava(TransferData)

setSelection

public void setSelection(ISelection s)
Sets the transfer data for local use.
Parameters:
s - the transfer data

Eclipse Platform
2.1

Copyright (c) IBM Corp. and others 2000, 2003. All Rights Reserved.