itrimble | 38bf0b9 | 2006-10-30 18:59:16 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2006 Sybase, Inc. and others. |
| 3 | * |
| 4 | * All rights reserved. This program and the accompanying materials |
| 5 | * are made available under the terms of the Eclipse Public License v1.0 |
| 6 | * which accompanies this distribution, and is available at |
| 7 | * http://www.eclipse.org/legal/epl-v10.html |
| 8 | * |
| 9 | * Contributors: |
| 10 | * Sybase, Inc. - initial API and implementation |
| 11 | *******************************************************************************/ |
| 12 | package org.eclipse.jst.pagedesigner.dnd; |
| 13 | |
| 14 | import org.eclipse.draw2d.geometry.Point; |
| 15 | import org.eclipse.gef.Request; |
| 16 | import org.eclipse.gef.requests.DropRequest; |
| 17 | |
| 18 | /** |
| 19 | * @author mengbo |
| 20 | */ |
| 21 | public class LocalDropRequest extends Request implements DropRequest { |
| 22 | // XXX: need move this constant to somewhere else. |
cbateman | 57f0d4f | 2007-10-10 00:05:16 +0000 | [diff] [blame] | 23 | /** |
| 24 | * the request name for local drops |
| 25 | */ |
gkessler | cfc5308 | 2008-11-18 22:25:04 +0000 | [diff] [blame] | 26 | public static final String REQ_LOCAL_DROP = "Local Drop"; //$NON-NLS-1$ |
itrimble | 38bf0b9 | 2006-10-30 18:59:16 +0000 | [diff] [blame] | 27 | |
| 28 | private Point _location; |
| 29 | |
| 30 | private Object _localObject; |
| 31 | |
| 32 | /** |
| 33 | * |
| 34 | */ |
| 35 | public LocalDropRequest() { |
| 36 | super(REQ_LOCAL_DROP); |
itrimble | 38bf0b9 | 2006-10-30 18:59:16 +0000 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | /** |
| 40 | * Returns the location of the object to be created. |
| 41 | * |
| 42 | * @return the location |
| 43 | */ |
| 44 | public Point getLocation() { |
| 45 | return _location; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Sets the location where the new object will be placed. |
| 50 | * |
| 51 | * @param location |
| 52 | * the location |
| 53 | */ |
| 54 | public void setLocation(Point location) { |
| 55 | this._location = location; |
| 56 | } |
| 57 | |
cbateman | 57f0d4f | 2007-10-10 00:05:16 +0000 | [diff] [blame] | 58 | /** |
| 59 | * @return the local object |
| 60 | */ |
itrimble | 38bf0b9 | 2006-10-30 18:59:16 +0000 | [diff] [blame] | 61 | public Object getLocalObject() { |
| 62 | return _localObject; |
| 63 | } |
| 64 | |
cbateman | 57f0d4f | 2007-10-10 00:05:16 +0000 | [diff] [blame] | 65 | /** |
| 66 | * @param local |
| 67 | */ |
itrimble | 38bf0b9 | 2006-10-30 18:59:16 +0000 | [diff] [blame] | 68 | public void setLocalObject(Object local) { |
| 69 | this._localObject = local; |
| 70 | } |
| 71 | } |