Home | History | Annotate | Download | only in gle2
      1 /*
      2  * Copyright (C) 2010 The Android Open Source Project
      3  *
      4  * Licensed under the Eclipse Public License, Version 1.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.eclipse.org/org/documents/epl-v10.php
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.ide.eclipse.adt.internal.editors.layout.gle2;
     18 
     19 import org.eclipse.swt.dnd.DropTargetEvent;
     20 import org.eclipse.swt.dnd.DropTargetListener;
     21 
     22 /**
     23  * A {@link DropGesture} is a {@link Gesture} which deals with drag and drop, so
     24  * it has additional hooks for indicating whether the current position is
     25  * "valid", and in general gets access to the system drag and drop data
     26  * structures. See the {@link Gesture} documentation for more details on whether
     27  * you should choose a plain {@link Gesture} or a {@link DropGesture}.
     28  */
     29 public abstract class DropGesture extends Gesture {
     30     /**
     31      * The cursor has entered the drop target boundaries.
     32      *
     33      * @param event The {@link DropTargetEvent} for this drag and drop event
     34      * @see DropTargetListener#dragEnter(DropTargetEvent)
     35      */
     36     public void dragEnter(DropTargetEvent event) {
     37     }
     38 
     39     /**
     40      * The cursor is moving over the drop target.
     41      *
     42      * @param event The {@link DropTargetEvent} for this drag and drop event
     43      * @see DropTargetListener#dragOver(DropTargetEvent)
     44      */
     45     public void dragOver(DropTargetEvent event) {
     46     }
     47 
     48     /**
     49      * The operation being performed has changed (usually due to the user
     50      * changing the selected modifier key(s) while dragging).
     51      *
     52      * @param event The {@link DropTargetEvent} for this drag and drop event
     53      * @see DropTargetListener#dragOperationChanged(DropTargetEvent)
     54      */
     55     public void dragOperationChanged(DropTargetEvent event) {
     56     }
     57 
     58     /**
     59      * The cursor has left the drop target boundaries OR the drop has been
     60      * canceled OR the data is about to be dropped.
     61      *
     62      * @param event The {@link DropTargetEvent} for this drag and drop event
     63      * @see DropTargetListener#dragLeave(DropTargetEvent)
     64      */
     65     public void dragLeave(DropTargetEvent event) {
     66     }
     67 
     68     /**
     69      * The drop is about to be performed. The drop target is given a last chance
     70      * to change the nature of the drop.
     71      *
     72      * @param event The {@link DropTargetEvent} for this drag and drop event
     73      * @see DropTargetListener#dropAccept(DropTargetEvent)
     74      */
     75     public void dropAccept(DropTargetEvent event) {
     76     }
     77 
     78     /**
     79      * The data is being dropped. The data field contains java format of the
     80      * data being dropped.
     81      *
     82      * @param event The {@link DropTargetEvent} for this drag and drop event
     83      * @see DropTargetListener#drop(DropTargetEvent)
     84      */
     85     public void drop(final DropTargetEvent event) {
     86     }
     87 }
     88