01: /*
02: * Copyright (C) 2005 Jeff Tassin
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18:
19: package com.jeta.swingbuilder.gui.main;
20:
21: import java.awt.datatransfer.Transferable;
22:
23: import com.jeta.forms.components.panel.FormPanel;
24: import com.jeta.swingbuilder.gui.dnd.FormObjectFlavor;
25:
26: /**
27: * Displays paste special GUI
28: *
29: * @author Jeff Tassin
30: */
31: public class PasteSpecialView extends FormPanel {
32: private Transferable m_transferable;
33:
34: public PasteSpecialView(Transferable t) {
35: super ("com/jeta/swingbuilder/gui/main/pasteSpecial.jfrm");
36: m_transferable = t;
37: initialize(t);
38: }
39:
40: public void initialize(Transferable transferable) {
41: try {
42: enableComponent(PasteSpecialNames.ID_LINKED_AS_EMBEDDED,
43: false);
44: enableComponent(PasteSpecialNames.ID_COMPONENT, false);
45: enableComponent(PasteSpecialNames.ID_CELL_BACKGROUND, false);
46:
47: if (transferable
48: .isDataFlavorSupported(FormObjectFlavor.LINKED_FORM_SET)) {
49: enableComponent(
50: PasteSpecialNames.ID_LINKED_AS_EMBEDDED,
51: transferable
52: .isDataFlavorSupported(FormObjectFlavor.LINKED_FORM_SET));
53: } else {
54: enableComponent(
55: PasteSpecialNames.ID_COMPONENT,
56: transferable
57: .isDataFlavorSupported(FormObjectFlavor.COMPONENT_MEMENTO));
58: }
59: enableComponent(
60: PasteSpecialNames.ID_CELL_BACKGROUND,
61: transferable
62: .isDataFlavorSupported(FormObjectFlavor.CELL_BACKGROUND));
63: } catch (Exception e) {
64: e.printStackTrace();
65: }
66: }
67:
68: }
|