comparison dwt/dnd/TextTransfer.d @ 246:fd9c62a2998e

Updater SWT 3.4M7 to 3.4
author Frank Benoit <benoit@tionex.de>
date Tue, 01 Jul 2008 10:15:59 +0200
parents e2affbeb686d
children da968414c383
comparison
equal deleted inserted replaced
245:d8c3d4a4f2b0 246:fd9c62a2998e
1 /******************************************************************************* 1 /*******************************************************************************
2 * Copyright (c) 2000, 2005 IBM Corporation and others. 2 * Copyright (c) 2000, 2008 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials 3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0 4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
67 /** 67 /**
68 * This implementation of <code>javaToNative</code> converts plain text 68 * This implementation of <code>javaToNative</code> converts plain text
69 * represented by a java <code>String</code> to a platform specific representation. 69 * represented by a java <code>String</code> to a platform specific representation.
70 * 70 *
71 * @param object a java <code>String</code> containing text 71 * @param object a java <code>String</code> containing text
72 * @param transferData an empty <code>TransferData</code> object; this object 72 * @param transferData an empty <code>TransferData</code> object that will
73 * will be filled in on return with the platform specific format of the data 73 * be filled in on return with the platform specific format of the data
74 * 74 *
75 * @see Transfer#javaToNative 75 * @see Transfer#nativeToJava
76 */ 76 */
77 public void javaToNative (Object object, TransferData transferData){ 77 public void javaToNative (Object object, TransferData transferData){
78 if (!checkText(object) || !isSupportedType(transferData)) { 78 if (!checkText(object) || !isSupportedType(transferData)) {
79 DND.error(DND.ERROR_INVALID_DATA); 79 DND.error(DND.ERROR_INVALID_DATA);
80 } 80 }
123 * representation of plain text to a java <code>String</code>. 123 * representation of plain text to a java <code>String</code>.
124 * 124 *
125 * @param transferData the platform specific representation of the data to be converted 125 * @param transferData the platform specific representation of the data to be converted
126 * @return a java <code>String</code> containing text if the conversion was successful; otherwise null 126 * @return a java <code>String</code> containing text if the conversion was successful; otherwise null
127 * 127 *
128 * @see Transfer#nativeToJava 128 * @see Transfer#javaToNative
129 */ 129 */
130 public Object nativeToJava(TransferData transferData){ 130 public Object nativeToJava(TransferData transferData){
131 if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null; 131 if (!isSupportedType(transferData) || transferData.pIDataObject is null) return null;
132 132
133 IDataObject data = transferData.pIDataObject; 133 IDataObject data = transferData.pIDataObject;