Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.jface.util
Class LocalSelectionTransfer


java.lang.Object
  extended by 

org.eclipse.swt.dnd.Transfer
      extended by 

org.eclipse.swt.dnd.ByteArrayTransfer
          extended by 
org.eclipse.jface.util.LocalSelectionTransfer
Direct Known Subclasses:
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:
3.2

Constructor Summary
protected LocalSelectionTransfer ()
          Only the singleton instance of this class may be used.
 
Method Summary
  ISelection getSelection ()
          Returns the local transfer data.
 long getSelectionSetTime ()
          Returns the time when the selection operation this transfer is associated with was started.
static  LocalSelectionTransfer getTransfer ()
          Returns the singleton.
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.
 void setSelectionSetTime (long time)
          Sets the time when the selection operation this transfer is associated with was started.
 
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
 

Constructor Detail

LocalSelectionTransfer

protected LocalSelectionTransfer()
Only the singleton instance of this class may be used.

Method Detail

getTransfer

public static 
LocalSelectionTransfer getTransfer()
Returns the singleton.

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.

Specified by:
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.

Specified by:
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
Parameters:
object - a java byte[] containing the data to be converted
transferData - an empty TransferData object that will be filled in on return with the platform specific format of the data
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
Parameters:
transferData - the platform specific representation of the data to be converted
Returns:
a java byte[] containing the converted data if the conversion was successful; otherwise null
See Also:
ByteArrayTransfer.nativeToJava(TransferData)

setSelection

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

Parameters:
s - the transfer data

getSelectionSetTime

public long getSelectionSetTime()
Returns the time when the selection operation this transfer is associated with was started.

Returns:
the time when the selection operation has started
See Also:
TypedEvent.time

setSelectionSetTime

public void setSelectionSetTime(long time)
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)

Parameters:
time - the time when the selection operation was started
See Also:
TypedEvent.time

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire