01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.part;
11:
12: /**
13: * Record for transferring data during a drag and drop operation between
14: * different plug-ins. This object contains an extension identifier and a block
15: * of bytes. When the drop occurs, the data is interpreted by an action defined
16: * in the specified extension.
17: * <p>
18: * Clients using PluginTransfer should create an instance to contain the
19: * drop data.
20: * It is not intended to be subclassed by clients.
21: * </p>
22: */
23: public class PluginTransferData {
24: String extensionName;
25:
26: byte[] transferData;
27:
28: /**
29: * Creates a new record for the given extension id and data.
30: *
31: * @param extensionId the extension id
32: * @param data the data to transfer
33: */
34: public PluginTransferData(String extensionId, byte[] data) {
35: this .extensionName = extensionId;
36: this .transferData = data;
37: }
38:
39: /**
40: * Returns the data being transferred.
41: *
42: * @return the data
43: */
44: public byte[] getData() {
45: return transferData;
46: }
47:
48: /**
49: * Returns the id of the extension that will provide the drop action.
50: *
51: * @return the extension id
52: */
53: public String getExtensionId() {
54: return extensionName;
55: }
56: }
|