01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 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.jdt.internal.ui.packageview;
11:
12: import org.eclipse.swt.dnd.DropTargetEvent;
13: import org.eclipse.swt.dnd.Transfer;
14:
15: import org.eclipse.jface.util.TransferDropTargetListener;
16: import org.eclipse.jface.viewers.StructuredViewer;
17:
18: import org.eclipse.ui.part.PluginDropAdapter;
19: import org.eclipse.ui.part.PluginTransfer;
20:
21: public class PluginTransferDropAdapter extends PluginDropAdapter
22: implements TransferDropTargetListener {
23:
24: public PluginTransferDropAdapter(StructuredViewer viewer) {
25: super (viewer);
26: setFeedbackEnabled(false);
27: }
28:
29: /**
30: * {@inheritDoc}
31: */
32: public Transfer getTransfer() {
33: return PluginTransfer.getInstance();
34: }
35:
36: /**
37: * {@inheritDoc}
38: */
39: public boolean isEnabled(DropTargetEvent event) {
40: return PluginTransfer.getInstance().isSupportedType(
41: event.currentDataType);
42: }
43:
44: }
|