Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 5a7d18f232183c18eb0e6275bd6b4d5891765187 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*****************************************************************************
 * Copyright (c) 2009 Atos Origin.
 *
 *    
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Tristan Faure (Atos Origin) tristan.faure@atosorigin.com - Initial API and implementation
 *
  *****************************************************************************/
package org.eclipse.papyrus.diagramprofile.dnd;

import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.jface.util.LocalSelectionTransfer;
import org.eclipse.papyrus.diagram.common.listeners.DropTargetListener;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.dnd.TransferData;

public class ProfileDropTargetListener extends DropTargetListener {

	private final TransactionalEditingDomain domain;

	public ProfileDropTargetListener(EditPartViewer viewer, Transfer xfer, TransactionalEditingDomain domain) {
		super(viewer, xfer);
		this.domain = domain;
	}

	@Override
	protected Object getJavaObject(TransferData data) {
		return LocalSelectionTransfer.getTransfer().nativeToJava(data);
	}

	@Override
	protected TransactionalEditingDomain getTransactionalEditingDomain() {
		return domain;
	}

}

Back to the top