Skip to main content
summaryrefslogtreecommitdiffstats
blob: 5c23ef3a630b0b372d31e80a252d7ab432572009 (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
/*******************************************************************************
 * Copyright (c) 2001, 2006 IBM Corporation and others.
 * 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.wsdl.ui.internal.asd.design.editpolicies;

import org.eclipse.gef.EditPartViewer;
import org.eclipse.gef.Request;
import org.eclipse.gef.requests.ChangeBoundsRequest;

public class ASDDragAndDropEditPolicy extends org.eclipse.gef.editpolicies.GraphicalEditPolicy {
	protected EditPartViewer viewer;
	protected ASDSelectionEditPolicy selectionHandlesEditPolicy;
	
	public ASDDragAndDropEditPolicy(EditPartViewer viewer, ASDSelectionEditPolicy selectionHandlesEditPolicy) {
		this.viewer = viewer;
		this.selectionHandlesEditPolicy = selectionHandlesEditPolicy;
	}

	public boolean understandsRequest(Request req) {
		return true;
	}                           

	public org.eclipse.gef.commands.Command getCommand(Request request) {             
		ASDDragAndDropCommand command = null;
		if (request instanceof ChangeBoundsRequest) {
			command = new ASDDragAndDropCommand(viewer, (ChangeBoundsRequest)request);
			selectionHandlesEditPolicy.setDragAndDropCommand(command);
		} 
		return command;             
	}                                                     
}

Back to the top