Eclipse Platform
Release 3.3

org.eclipse.ui.views.navigator
Class LocalSelectionTransfer

java.lang.Object
  extended byorg.eclipse.swt.dnd.Transfer
      extended byorg.eclipse.swt.dnd.ByteArrayTransfer
          extended byorg.eclipse.jface.util.LocalSelectionTransfer
              extended byorg.eclipse.ui.views.navigator.LocalSelectionTransfer

public class LocalSelectionTransfer
extends LocalSelectionTransfer

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.
 long getSelectionSetTime()
          Returns the time when the selection operation this transfer is associated with was started.
 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.
 void setSelectionSetTime(long time)
          Sets the time when the selection operation this transfer is associated with was started.
 
Methods inherited from class org.eclipse.jface.util.LocalSelectionTransfer
getTransfer, getTypeIds, getTypeNames
 
Methods inherited from class org.eclipse.swt.dnd.ByteArrayTransfer
getSupportedTypes, isSupportedType
 
Methods inherited from class org.eclipse.swt.dnd.Transfer
registerType, validate
 
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.

Returns:
the singleton

getSelection

public ISelection getSelection()
Description copied from class: LocalSelectionTransfer
Returns the local transfer data.

Overrides:
getSelection in class LocalSelectionTransfer
Returns:
the local transfer data

getSelectionSetTime

public long getSelectionSetTime()
Description copied from class: LocalSelectionTransfer
Returns the time when the selection operation this transfer is associated with was started.

Overrides:
getSelectionSetTime in class LocalSelectionTransfer
Returns:
the time when the selection operation has started
See Also:
TypedEvent.time

setSelection

public void setSelection(ISelection s)
Description copied from class: LocalSelectionTransfer
Sets the transfer data for local use.

Overrides:
setSelection in class LocalSelectionTransfer
Parameters:
s - the transfer data

setSelectionSetTime

public void setSelectionSetTime(long time)
Description copied from class: LocalSelectionTransfer
Sets the time when the selection operation this transfer is associated with was started. If assigning this from an SWT event, be sure to use setSelectionTime(event.time & 0xFFFF)

Overrides:
setSelectionSetTime in class LocalSelectionTransfer
Parameters:
time - the time when the selection operation was started
See Also:
TypedEvent.time

javaToNative

public void javaToNative(Object object,
                         TransferData transferData)
Description copied from class: LocalSelectionTransfer
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 LocalSelectionTransfer
See Also:
ByteArrayTransfer.javaToNative(java.lang.Object, org.eclipse.swt.dnd.TransferData)

nativeToJava

public Object nativeToJava(TransferData transferData)
Description copied from class: LocalSelectionTransfer
Overrides org.eclipse.swt.dnd.ByteArrayTransfer#nativeToJava(TransferData). Test if the native drop data matches this transfer type.

Overrides:
nativeToJava in class LocalSelectionTransfer
See Also:
ByteArrayTransfer.nativeToJava(TransferData)

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.