Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ByteArrayTransfer.java28
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java73
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java142
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java133
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java59
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/RTFTransfer.java69
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragUnderEffect.java52
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java68
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Transfer.java57
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TransferData.java35
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragUnderEffect.java92
11 files changed, 0 insertions, 808 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ByteArrayTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ByteArrayTransfer.java
deleted file mode 100644
index c8c5e4a05a..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/ByteArrayTransfer.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.internal.gtk.*;
-
-/**
- * The class <code>ByteArrayTransfer</code> provides a platform specific mechanism for transforming
- * a Java array of bytes into a format that can be passed around in a Drag and Drop operation and vice
- * versa.
- *
- * <p>This abstract class can be subclassed to provided utilities for transforming Java data types
- * into the byte array based platform specific drag and drop data types. See TextTransfer and
- * FileTransfer for examples. If the data you are transferring <b>does not</b> map to a byte array,
- * you should sub-class Transfer directly and do your own mapping to the platform data types.</p>
- */
-public abstract class ByteArrayTransfer extends Transfer {
-public TransferData[] getSupportedTypes(){
- return null;
-}
-public boolean isSupportedType(TransferData transferData){
- return false;
-}
-
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java
deleted file mode 100644
index b368acb214..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Clipboard.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.internal.*;
-import org.eclipse.swt.widgets.*;
-
-/**
- * IMPORTANT: This class is <em>not</em> intended to be subclassed.
- */
-public class Clipboard {
-
- private Display display;
-
-public Clipboard(Display display) {
- checkSubclass ();
- if (display == null) {
- display = Display.getCurrent();
- if (display == null) {
- display = Display.getDefault();
- }
- }
- if (display.getThread() != Thread.currentThread()) {
- SWT.error(SWT.ERROR_THREAD_INVALID_ACCESS);
- }
- this.display = display;
-}
-protected void checkSubclass () {
- String name = getClass().getName ();
- String validName = Clipboard.class.getName();
- if (!validName.equals(name)) {
- DND.error (SWT.ERROR_INVALID_SUBCLASS);
- }
-}
-public void dispose () {
- display = null;
-}
-public Object getContents(Transfer transfer) {
- if (display.isDisposed() || !(transfer instanceof TextTransfer)) return null;
- return display.getData("TextTransfer");
-}
-public void setContents(Object[] data, Transfer[] transferAgents){
-
- if (data == null) {
- DND.error(SWT.ERROR_NOT_IMPLEMENTED);
- }
- if (transferAgents == null || data.length != transferAgents.length) {
- DND.error(SWT.ERROR_INVALID_ARGUMENT);
- }
-
- if (display.isDisposed() )
- DND.error(DND.ERROR_CANNOT_SET_CLIPBOARD);
-
- for (int i = 0; i < transferAgents.length; i++) {
- if (transferAgents[i] instanceof TextTransfer && data[i] instanceof String){
- display.setData("TextTransfer", data[i]);
- return;
- }
- }
-}
-/*
- * Note: getAvailableTypeNames is a tool for writing a Transfer sub-class only. It should
- * NOT be used within an application because it provides platform specfic
- * information.
- */
-public String[] getAvailableTypeNames() {
- return null;
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java
deleted file mode 100644
index 1c41d9e326..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DragSource.java
+++ /dev/null
@@ -1,142 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.internal.*;
-import org.eclipse.swt.internal.gtk.*;
-
-/**
- *
- * Class <code>DragSource</code> defines the source object for a drag and drop transfer.
- *
- * IMPORTANT: This class is <em>not</em> intended to be subclassed.
- *
- * <p>This class defines the following items:<ul>
- * <li>the <code>Control</code> that the user clicks on to intiate a drag;
- * <li>the data that will be transferred on a successful drop;
- * <li>and the modes (move, copy, link) of transfer that are allowed.
- * </ul></p>
- *
- * <p>You may have several DragSources in an application but you can only have one DragSource
- * per Control. Data dragged from this DragSource can be dropped on a site within this application
- * but it can also be dropped on another application such as an external Text editor.</p>
- *
- * <p>The application supplies the content of the data being transferred by implementing the interface
- * <code>DragSourceListener</code> which uses the class <code>DragSourceEvent</code>.
- * The application is required to take the appropriate action to remove the data from the drag source
- * when a successful move operation occurs.</p>
- *
- * <code><pre>
- * // Enable a label as a Drag Source
- * Label label = new Label(shell, SWT.NONE);
- * // This example will allow text to be dragged
- * Transfer[] types = new Transfer[] {TextTransfer.getInstance()};
- * // This example will allow the text to be copied or moved to the drop target
- * int operations = DND.DROP_MOVE | DND.DROP_COPY;
- *
- * DragSource source = new DragSource (label, operations);
- * source.setTransfer(types);
- * source.addDragListener (new DragSourceListener() {
- * public void dragStart(DragSourceEvent e) {
- * // Only start the drag if there is actually text in the
- * // label - this text will be what is dropped on the target.
- * if (label.getText().length() == 0) {
- * event.doit = false;
- * }
- * };
- * public void dragSetData (DragSourceEvent event) {
- * // A drop has been performed, so provide the data of the
- * // requested type.
- * // (Checking the type of the requested data is only
- * // necessary if the drag source supports more than
- * // one data type but is shown here as an example).
- * if (TextTransfer.getInstance().isSupportedType(event.dataType)){
- * event.data = label.getText();
- * }
- * }
- * public void dragFinished(DragSourceEvent event) {
- * // A Move operation has been performed so remove the data
- * // from the source
- * if (event.detail == DND.DROP_MOVE)
- * label.setText("");
- * }
- * });
- * </pre></code>
- *
- *
- * <dl>
- * <dt><b>Styles</b> <dd>DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK
- * <dt><b>Events</b> <dd>DND.DragEnd, DND.DragSetData
- * </dl>
- */
-public final class DragSource extends Widget {
-
-/**
- * Creates a new <code>DragSource</code> to handle dragging from the specified <code>Control</code>.
- *
- * @param control the <code>Control</code> that the user clicks on to initiate the drag
- *
- * @param style the bitwise OR'ing of allowed operations; this may be a combination of any of
- * DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK
- *
- */
-public DragSource(Control control, int style) {
- super (control, style);
-}
-/**
- * Adds the listener to receive events.
- *
- * @param listener the listener
- *
- * @exception SWTError
- * <ul><li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * <li>ERROR_NULL_ARGUMENT when listener is null</li></ul>
- */
-public void addDragListener(DragSourceListener listener) {
-
-}
-
-public Display getDisplay () {
- return null;
-}
-/**
- * Returns the list of data types that can be transferred by this DragSource.
- *
- * @return the list of data types that can be transferred by this DragSource
- */
-public Transfer[] getTransfer(){
- return null;
-}
-
-/**
- * Removes the listener.
- *
- * @param listener the listener
- *
- * @exception SWTError
- * <ul><li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * <li>ERROR_NULL_ARGUMENT when listener is null</li></ul>
- */
-public void removeDragListener(DragSourceListener listener) {
-}
-/**
- * Specifies the list of data types that can be transferred by this DragSource.
- * The application must be able to provide data to match each of these types when
- * a successful drop has occurred.
- */
-public void setTransfer(Transfer[] transferAgents){
-}
-/**
- * @deprecated - use DragSourceListener.dragStart
- */
-public void startDrag() {
-}
-
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java
deleted file mode 100644
index 1be0fe0207..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/DropTarget.java
+++ /dev/null
@@ -1,133 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.internal.*;
-import org.eclipse.swt.internal.gtk.*;
-
-/**
- *
- * Class <code>DropTarget</code> defines the target object for a drag and drop transfer.
- *
- * IMPORTANT: This class is <em>not</em> intended to be subclassed.
- *
- * <p>This class identifies the <code>Control</code> over which the user must position the cursor
- * in order to drop the data being transferred. It also specifies what data types can be dropped on
- * this control and what operations can be performed. You may have several DropTragets in an
- * application but there can only be a one to one mapping between a <code>Control</code> and a <code>DropTarget</code>.
- * The DropTarget can receive data from within the same application or from other applications
- * (such as text dragged from a text editor like Word).</p>
- *
- * <code><pre>
- * int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK;
- * Transfer[] types = new Transfer[] {TextTransfer.getInstance()};
- * DropTarget target = new DropTarget(label, operations);
- * target.setTransfer(types);
- * </code></pre>
- *
- * <p>The application is notified of data being dragged over this control and of when a drop occurs by
- * implementing the interface <code>DropTargetListener</code> which uses the class
- * <code>DropTargetEvent</code>. The application can modify the type of drag being performed
- * on this Control at any stage of the drag by modifying the <code>event.detail</code> field or the
- * <code>event.currentDataType</code> field. When the data is dropped, it is the responsibility of
- * the application to copy this data for its own purposes.
- *
- * <code><pre>
- * target.addDropListener (new DropTargetListener() {
- * public void dragEnter(DropTargetEvent event) {};
- * public void dragOver(DropTargetEvent event) {};
- * public void dragLeave(DropTargetEvent event) {};
- * public void dragOperationChanged(DropTargetEvent event) {};
- * public void dropAccept(DropTargetEvent event) {}
- * public void drop(DropTargetEvent event) {
- * // A drop has occurred, copy over the data
- * if (event.data == null) { // no data to copy, indicate failure in event.detail
- * event.detail = DND.DROP_NONE;
- * return;
- * }
- * label.setText ((String) event.data); // data copied to label text
- * }
- * });
- * </pre></code>
- *
- * <dl>
- * <dt><b>Styles</b> <dd>DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK
- * <dt><b>Events</b> <dd>DND.DragEnter, DND.DragLeave, DND.DragOver, DND.DragOperationChanged,
- * DND.Drop, DND.DropAccept
- * </dl>
- */
-public final class DropTarget extends Widget {
-
-/**
- * Creates a new <code>DropTarget</code> to handle dropping on the specified <code>Control</code>.
- *
- * @param control the <code>Control</code> over which the user positions the cursor to drop data
- *
- * @param style the bitwise OR'ing of allowed operations; this may be a combination of any of
- * DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINK
- *
- */
-public DropTarget(Control control, int style) {
- super(control, style);
-}
-
-/**
- * Adds the listener to receive events.
- *
- * @param listener the listener
- *
- * @exception SWTError
- * <ul><li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * <li>ERROR_NULL_ARGUMENT when listener is null</li></ul>
- */
-public void addDropListener(DropTargetListener listener) {
-}
-
-/**
- * Returns the Control which is registered for this DropTarget. This is the control over which the
- * user positions the cursor to drop the data.
- *
- * @return the Control which is registered for this DropTarget
- *
- */
-public Control getControl () {
- return null;
-}
-public Display getDisplay () {
- return null;
-}
-/**
- * Returns the list of data types that can be transferred to this DropTarget.
- *
- * @return the list of data types that can be transferred to this DropTarget
- *
- */
-public Transfer[] getTransfer() { return null; }
-public void notifyListener (int eventType, Event event) {}
-/**
- * Removes the listener.
- *
- * @param listener the listener
- *
- * @exception SWTError
- * <ul><li>ERROR_THREAD_INVALID_ACCESS when called from the wrong thread</li>
- * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li>
- * <li>ERROR_NULL_ARGUMENT when listener is null</li></ul>
- */
-public void removeDropListener(DropTargetListener listener) {}
-/**
- * Specifies the list of data types that can be transferred to this DropTarget.
- *
- * @param transferAgents a list of Transfer objects which define the types of data that can be
- * dropped on this target
- */
-public void setTransfer(Transfer[] transferAgents){}
-
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java
deleted file mode 100644
index a3f240b7a6..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/FileTransfer.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-/**
- * The <code>FileTransfer</code> class is used to transfer files in a drag and drop operation.
- */
-public class FileTransfer extends ByteArrayTransfer {
-
-private FileTransfer() {}
-/**
- * Returns the singleton instance of the FileTransfer class.
- *
- * @return the singleton instance of the FileTransfer class
- */
-public static FileTransfer getInstance () {
- return null;
-}
-/**
- * Converts a list of filenames to a platform specific representation.
- * <p>
- * On a successful conversion, the transferData.result field will be set as follows:
- * <ul>
- * <li>Windows: OLE.S_OK
- * <li>Motif: 0
- * </ul>
- * If this transfer agent is unable to perform the conversion,
- * the transferData.result field will be set to a failure value as follows:
- * <ul>
- * <li>Windows: OLE.DV_E_TYMED
- * <li>Motif: 1
- * </ul></p>
- *
- * @param object a list of file names
- * @param transferData an empty TransferData object; this object will be filled in on return
- * with the platform specific format of the data
- */
-public void javaToNative(Object object, TransferData transferData) {
-}
-/**
- * Converts a platform specific representation of a list of file names to a Java array of String.
- *
- * @param transferData the platform specific representation of the data that has been transferred
- * @return a Java array of String containing a list of file names if the conversion was successful;
- * otherwise null
- */
-public Object nativeToJava(TransferData transferData) {
- return null;
-}
-protected String[] getTypeNames(){
- return null;
-}
-protected int[] getTypeIds(){
- return null;
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/RTFTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/RTFTransfer.java
deleted file mode 100644
index 490afaebc7..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/RTFTransfer.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-/**
- * The <code>RTFTransfer</code> class is used to transfer text with the RTF format
- * in a drag and drop operation.
- */
-public class RTFTransfer extends ByteArrayTransfer {
-
- private static RTFTransfer _instance = new RTFTransfer();
- private static final String TYPENAME1 = "text/rtf\0";
- private static final int TYPEID1 = registerType(TYPENAME1);
- private static final String TYPENAME2 = "TEXT/RTF\0";
- private static final int TYPEID2 = registerType(TYPENAME2);
- private static final String TYPENAME3 = "application/rtf\0";
- private static final int TYPEID3 = registerType(TYPENAME3);
-
-private RTFTransfer() {
-}
-/**
- * Returns the singleton instance of the RTFTransfer class.
- *
- * @return the singleton instance of the RTFTransfer class
- */
-public static RTFTransfer getInstance () {
- return _instance;
-}
-/**
- * Converts a RTF-formatted Java String to a platform specific representation.
- * <p>
- * On a successful conversion, the transferData.result field will be set as follows:
- * <ul>
- * <li>Windows: OLE.S_OK
- * <li>Motif: 0
- * </ul>
- * If this transfer agent is unable to perform the conversion,
- * the transferData.result field will be set to a failure value as follows:
- * <ul>
- * <li>Windows: OLE.DV_E_TYMED
- * <li>Motif: 1
- * </ul></p>
- *
- * @param object a Java String containing the data to be transferred
- * @param transferData an empty TransferData object; this object will be filled in on return
- * with the platform specific format of the data
- */
-public void javaToNative (Object object, TransferData transferData){
-}
-/**
- * Converts a platform specific representation of a string to a Java String.
- *
- * @param transferData the platform specific representation of the data that has been transferred
- * @return a Java String containing the transferred data if the conversion was successful;
- * otherwise null
- */
-public Object nativeToJava(TransferData transferData){
- return null;
-}
-protected String[] getTypeNames(){
- return new String[]{TYPENAME1, TYPENAME2, TYPENAME3};
-}
-protected int[] getTypeIds(){
- return new int[]{TYPEID1, TYPEID2, TYPEID3};
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragUnderEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragUnderEffect.java
deleted file mode 100644
index 6862a2ea48..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TableDragUnderEffect.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-
-class TableDragUnderEffect extends DragUnderEffect {
- private Table table;
- private TableItem currentItem;
- private TableItem[] selection = new TableItem[0];
- private int currentEffect = DND.FEEDBACK_NONE;
-
-TableDragUnderEffect(Table table) {
- this.table = table;
-}
-void show(int effect, int x, int y) {
- TableItem item = null;
- if (effect != DND.FEEDBACK_NONE) item = findItem(x, y);
- if (item == null) effect = DND.FEEDBACK_NONE;
- if (currentEffect != effect && currentEffect == DND.FEEDBACK_NONE) {
- selection = table.getSelection();
- table.setSelection(new TableItem[0]);
- }
- boolean restoreSelection = currentEffect != effect && effect == DND.FEEDBACK_NONE;
- setDragUnderEffect(effect, item);
- if (restoreSelection) {
- table.setSelection(selection);
- selection = new TableItem[0];
- }
-}
-private TableItem findItem(int x, int y){
- if (table == null) return null;
- Point coordinates = new Point(x, y);
- coordinates = table.toControl(coordinates);
- return table.getItem(coordinates);
-}
-private void setDragUnderEffect(int effect, TableItem item) {
- if (currentItem != item) {
- if (item == null) {
- table.setSelection(new TableItem[0]);
- } else {
- table.setSelection(new TableItem[] {item});
- }
- currentItem = item;
- }
- currentEffect = effect;
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
deleted file mode 100644
index d84cbfe40a..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TextTransfer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-/**
- * The <code>TextTransfer</code> class is used to transfer text in a drag and drop operation.
- */
-public class TextTransfer extends ByteArrayTransfer {
-
- private static TextTransfer _instance = new TextTransfer();
- private static final String TYPENAME1 = "STRING\0";
- private static final int TYPEID1 = registerType(TYPENAME1);
- private static final String TYPENAME2 = "text/plain\0";
- private static final int TYPEID2 = registerType(TYPENAME2);
- private static final String TYPENAME3 = "text/text\0";
- private static final int TYPEID3 = registerType(TYPENAME3);
-
-private TextTransfer() {
-}
-/**
- * Returns the singleton instance of the TextTransfer class.
- *
- * @return the singleton instance of the TextTransfer class
- */
-public static TextTransfer getInstance () {
- return _instance;
-}
-/**
- * Converts a plain text Java String to a platform specific representation.
- * <p>
- * On a successful conversion, the transferData.result field will be set as follows:
- * <ul>
- * <li>Windows: OLE.S_OK
- * <li>Motif: 0
- * </ul>
- * If this transfer agent is unable to perform the conversion,
- * the transferData.result field will be set to a failure value as follows:
- * <ul>
- * <li>Windows: OLE.DV_E_TYMED
- * <li>Motif: 1
- * </ul></p>
- *
- * @param object a Java String containing the data to be transferred
- * @param transferData an empty TransferData object; this object will be filled in on return
- * with the platform specific format of the data
- */
-public void javaToNative (Object object, TransferData transferData){
-}
-/**
- * Converts a platform specific representation of a string to a Java String.
- *
- * @param transferData the platform specific representation of the data that has been transferred
- * @return a Java String containing the transferred data if the conversion was successful;
- * otherwise null
- */
-public Object nativeToJava(TransferData transferData){
- return null;
-}
-protected String[] getTypeNames(){
- return new String[]{TYPENAME1, TYPENAME2, TYPENAME3};
-}
-protected int[] getTypeIds(){
- return new int[]{TYPEID1, TYPEID2, TYPEID3};
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Transfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Transfer.java
deleted file mode 100644
index 9dcf84ff27..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/Transfer.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.internal.Converter;
-import org.eclipse.swt.internal.gtk.OS;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * The class <code>Transfer</code> provides a mechanism for converting a Java object to a
- * platform specific format that can be passed around in a Drag and Drop operation and vice versa.
- *
- * <p>You should only need to become familiar with this class if you are implementing
- * a Transfer subclass and you are unable to subclass the ByteArrayTransfer class.</p>
- */
-public abstract class Transfer {
-/**
- * Returns a list of the data types that can be transferred using this Transfer agent.
- *
- * <p>Only the data type fields of the TransferData Object are filled in.</p>
- *
- * @return a list of the data types that can be transferred using this Transfer agent
- */
-abstract public TransferData[] getSupportedTypes();
-/**
- * Returns true if the transferData data type can be transferred using this Transfer agent.
- *
- * @param transferData a platform specific description of a data type; only the data type fields
- * of the TransferData Object need to be filled in
- *
- * @return true if the transferData data type can be transferred using this Transfer agent
- */
-abstract public boolean isSupportedType(TransferData transferData);
-abstract protected String[] getTypeNames();
-abstract protected int[] getTypeIds();
-abstract protected void javaToNative (Object object, TransferData transferData);
-abstract protected Object nativeToJava(TransferData transferData);
-/**
- * Registers a name for a data type and returns the associated unique identifier.
- *
- * <p>You may register the same type more than once, the same unique identifier will be returned if the
- * type has been previously registered.</p>
- *
- * <p>Note: Do <b>not</b> call this method with pre-defined Clipboard Format types such as CF_TEXT
- * or CF_BITMAP because the pre-defined value will not be returned</p>
- *
- * @param formatName the name of a data type
- *
- * @return the unique identifier associated with htis data type
- */
-public static int registerType(String formatName){
- return 0;
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TransferData.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TransferData.java
deleted file mode 100644
index bade8baef0..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TransferData.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-/**
- * The <code>TransferData</code> class is a platform specific data structure for describing the type and the
- * contents of data being transferred in a Drag and Drop operation.
- *
- * <p>As an application writer, you do not need to know anything about the specifics of TransferData. You
- * should just pass the TransferData instances to subclass of Transfer and let the Transfer objects deal
- * with the platform specific issues. You can ask a Transfer subclass if it can handle this data by calling
- * TextTransfer.isSupportedType(transferData). You can get a list of the types of TransferData supported by a
- * Transfer object by calling TextTransfer.getSupportedTypes().</p>
- *
- * <p>You should only need to become familiar with the fields in this class if you are implementing
- * a Transfer subclass and you are unable to subclass the ByteArrayTransfer class.</p>
- */
-public class TransferData {
- /**
- * Data Type - a pre-defined clipboard format <b>or</b> the unique identifier of a user defined format
- * (Warning: This field is platform dependent)
- */
- public int type;
-
- // attributes specific to set/get
- int length;
- int format;
- int pValue;
-
- int result;
-
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragUnderEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragUnderEffect.java
deleted file mode 100644
index 54ff723827..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/TreeDragUnderEffect.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.eclipse.swt.dnd;
-
-/*
- * (c) Copyright IBM Corp. 2000, 2001.
- * All Rights Reserved
- */
-
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-
-class TreeDragUnderEffect extends DragUnderEffect {
-
- private Tree tree;
- private TreeItem currentItem = null;
- private int currentEffect = DND.FEEDBACK_NONE;
- private TreeItem[] selection = new TreeItem[0];
-
-TreeDragUnderEffect(Tree tree) {
- this.tree = tree;
-}
-void show(int effect, int x, int y) {
- TreeItem item = null;
- if (effect != DND.FEEDBACK_NONE) item = findItem(x, y);
- if (item == null) effect = DND.FEEDBACK_NONE;
- if (currentEffect != effect && currentEffect == DND.FEEDBACK_NONE) {
- selection = tree.getSelection();
- tree.setSelection(new TreeItem[0]);
- }
- boolean restoreSelection = currentEffect != effect && effect == DND.FEEDBACK_NONE;
- setDragUnderEffect(effect, item);
- if (restoreSelection) {
- tree.setSelection(selection);
- selection = new TreeItem[0];
- }
-}
-private TreeItem findItem(int x , int y){
- Point coordinates = new Point(x, y);
- coordinates = tree.toControl(coordinates);
- return tree.getItem(coordinates);
-}
-private void setDragUnderEffect(int effect, TreeItem item) {
- switch (effect) {
- case DND.FEEDBACK_SELECT:
- if (currentEffect == DND.FEEDBACK_INSERT_AFTER ||
- currentEffect == DND.FEEDBACK_INSERT_BEFORE) {
- setInsertMark(null, false);
- currentEffect = DND.FEEDBACK_NONE;
- currentItem = null;
- }
- if (currentEffect != effect || currentItem != item) {
- setDropSelection(item);
- currentEffect = DND.FEEDBACK_SELECT;
- currentItem = item;
- }
- break;
- case DND.FEEDBACK_INSERT_AFTER:
- case DND.FEEDBACK_INSERT_BEFORE:
- if (currentEffect == DND.FEEDBACK_SELECT) {
- setDropSelection(null);
- currentEffect = DND.FEEDBACK_NONE;
- currentItem = null;
- }
- if (currentEffect != effect || currentItem != item) {
- setInsertMark(item, effect == DND.FEEDBACK_INSERT_AFTER);
- currentEffect = effect;
- currentItem = item;
- }
- break;
- default :
- if (currentEffect == DND.FEEDBACK_INSERT_AFTER ||
- currentEffect == DND.FEEDBACK_INSERT_BEFORE) {
- setInsertMark(null, false);
- }
- if (currentEffect == DND.FEEDBACK_SELECT) {
- setDropSelection(null);
- }
- currentEffect = DND.FEEDBACK_NONE;
- currentItem = null;
- break;
- }
-}
-private void setDropSelection (TreeItem item) {
- if (item == null) {
- tree.setSelection(new TreeItem[0]);
- } else {
- tree.setSelection(new TreeItem[]{item});
- }
-}
-private void setInsertMark (TreeItem item, boolean after) {
- // not currently implemented
-}
-}

Back to the top