01: /* uDig - User Friendly Desktop Internet GIS client
02: * http://udig.refractions.net
03: * (C) 2004, Refractions Research Inc.
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation;
08: * version 2.1 of the License.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: */
15: package net.refractions.udig.ui;
16:
17: import org.eclipse.jface.viewers.ViewerDropAdapter;
18:
19: /**
20: * Enumerates the number of places that a element can be dropped on an element in a viewer.
21: *
22: * For example when dropping something on an item in a ListViewer the item can be BEFORE, ON or AFTER
23: * @author Jesse
24: * @since 1.1.0
25: */
26: public enum ViewerDropLocation {
27:
28: /**
29: * Indicates the dropped item was dropped before the item
30: */
31: BEFORE,
32: /**
33: * Indicates the dropped item was dropped on the item
34: */
35: ON,
36: /**
37: * Indicates the dropped item was dropped after the item
38: */
39: AFTER,
40: /**
41: * Indicates the dropped item was not dropped on an item
42: */
43: NONE;
44:
45: public static ViewerDropLocation valueOf(int location) {
46: switch (location) {
47: case ViewerDropAdapter.LOCATION_BEFORE:
48: return BEFORE;
49: case ViewerDropAdapter.LOCATION_AFTER:
50: return AFTER;
51: case ViewerDropAdapter.LOCATION_ON:
52: return ON;
53: default:
54: return NONE;
55: }
56: }
57:
58: }
|