KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > part > PluginTransferData


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.part;
12
13 /**
14  * Record for transferring data during a drag and drop operation between
15  * different plug-ins. This object contains an extension identifier and a block
16  * of bytes. When the drop occurs, the data is interpreted by an action defined
17  * in the specified extension.
18  * <p>
19  * Clients using PluginTransfer should create an instance to contain the
20  * drop data.
21  * It is not intended to be subclassed by clients.
22  * </p>
23  */

24 public class PluginTransferData {
25     String JavaDoc extensionName;
26
27     byte[] transferData;
28
29     /**
30      * Creates a new record for the given extension id and data.
31      *
32      * @param extensionId the extension id
33      * @param data the data to transfer
34      */

35     public PluginTransferData(String JavaDoc extensionId, byte[] data) {
36         this.extensionName = extensionId;
37         this.transferData = data;
38     }
39
40     /**
41      * Returns the data being transferred.
42      *
43      * @return the data
44      */

45     public byte[] getData() {
46         return transferData;
47     }
48
49     /**
50      * Returns the id of the extension that will provide the drop action.
51      *
52      * @return the extension id
53      */

54     public String JavaDoc getExtensionId() {
55         return extensionName;
56     }
57 }
58
Popular Tags