1
/*******************************************************************************
2
* Copyright (c) 2002, 2008 QNX Software Systems 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
9
* QNX Software Systems - Initial API and implementation
10
*******************************************************************************/
12
package org.eclipse.cdt.internal.ui.cview;
14
import java.util.Iterator;
16
import org.eclipse.jface.viewers.ISelection;
17
import org.eclipse.jface.viewers.ISelectionProvider;
18
import org.eclipse.jface.viewers.IStructuredSelection;
20
import org.eclipse.cdt.core.model.ICElement;
21
import org.eclipse.cdt.core.model.ISourceReference;
23
import org.eclipse.cdt.internal.ui.dnd.BasicSelectionTransferDragAdapter;
25
public class SelectionTransferDragAdapter extends BasicSelectionTransferDragAdapter {
27
public SelectionTransferDragAdapter(ISelectionProvider provider) {
32
protected boolean isDragable(ISelection selection) {
33
if (selection instanceof IStructuredSelection) {
34
for (Iterator<?> iter= ((IStructuredSelection)selection).iterator(); iter.hasNext();) {
35
Object element= iter.next();
36
if (element instanceof ICElement) {
37
if (!(element instanceof ISourceReference)) {