01: /*
02: * SalomeTMF is a Test Management Framework
03: * Copyright (C) 2005 France Telecom R&D
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: *
19: * @author Mikael MARCHE, Fayçal SOUGRATI, Vincent PAUTRET
20: *
21: * Contact: mikael.marche@rd.francetelecom.com
22: */
23:
24: package org.objectweb.salome_tmf.ihm.models;
25:
26: import java.awt.datatransfer.DataFlavor;
27: import java.awt.datatransfer.Transferable;
28: import java.awt.datatransfer.UnsupportedFlavorException;
29: import java.io.IOException;
30: import java.util.ArrayList;
31:
32: /**
33: * @author teaml039
34: * @version : 0.1
35: */
36: public class RowTransferable implements Transferable {
37:
38: DataFlavor dataFlavor;
39: ArrayList actionList;
40:
41: public RowTransferable(ArrayList list) {
42: actionList = list;
43: dataFlavor = new DataFlavor(ArrayList.class, "ArrayList");
44: }
45:
46: /* (non-Javadoc)
47: * @see java.awt.datatransfer.Transferable#getTransferDataFlavors()
48: */
49: public DataFlavor[] getTransferDataFlavors() {
50: return new DataFlavor[] { dataFlavor };
51: }
52:
53: /* (non-Javadoc)
54: * @see java.awt.datatransfer.Transferable#isDataFlavorSupported(java.awt.datatransfer.DataFlavor)
55: */
56: public boolean isDataFlavorSupported(DataFlavor flavor) {
57: return dataFlavor.equals(flavor);
58: }
59:
60: /* (non-Javadoc)
61: * @see java.awt.datatransfer.Transferable#getTransferData(java.awt.datatransfer.DataFlavor)
62: */
63: public Object getTransferData(DataFlavor flavor)
64: throws UnsupportedFlavorException, IOException {
65: if (!isDataFlavorSupported(flavor)) {
66: throw new UnsupportedFlavorException(flavor);
67: }
68: return actionList;
69: }
70:
71: }
|