DropTarget dropTarget = null; /** * enables this component to be a Drag Source */ DragSource dragSource = null; boolean acceptDrop = true; private IBasicModelPartial[] selection1; private IBasicModelPartial[] selection2; int index = -1; private boolean dndAction = false; // Where, in the drag image, the mouse was clicked public AddressbookDNDListView() { super(); addListSelectionListener(this); dropTarget = new DropTarget(this, this); dragSource = DragSource.getDefaultDragSource(); if (acceptDrop == true) { dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this); } else { dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); } } public AddressbookDNDListView(AddressbookListModel model) { super(model); addListSelectionListener(this); dropTarget = new DropTarget(this, this); dragSource = new DragSource(); if (acceptDrop == true) { dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this); } else { dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); } } public void setAcceptDrop(boolean b) { acceptDrop = b; } /** * is invoked when you are dragging over the DropSite * */ public void dragEnter(DropTargetDragEvent event) { // debug messages for diagnostics if (acceptDrop == true) { event.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE); } else { event.acceptDrag(DnDConstants.ACTION_COPY); } } /** * is invoked when you are exit the DropSite without dropping * */ public void dragExit(DropTargetEvent event) { } /** * is invoked when a drag operation is going on * */ public void dragOver(DropTargetDragEvent event)
DropTarget dropTarget = null; /** * enables this component to be a Drag Source */ DragSource dragSource = null; boolean acceptDrop = true; private IHeaderItem[] selection1; private IHeaderItem[] selection2; int index = -1; private boolean dndAction = false; // Where, in the drag image, the mouse was clicked public ContactDNDListView() { super(); addListSelectionListener(this); dropTarget = new DropTarget(this, this); dragSource = DragSource.getDefaultDragSource(); if (acceptDrop == true) { dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this); } else { dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); } } public ContactDNDListView(ContactListModel model) { super(model); addListSelectionListener(this); dropTarget = new DropTarget(this, this); dragSource = new DragSource(); if (acceptDrop == true) { dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY_OR_MOVE, this); } else { dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_COPY, this); } } public void setAcceptDrop(boolean b) { acceptDrop = b; } /** * is invoked when you are dragging over the DropSite * */ public void dragEnter(DropTargetDragEvent event) { // debug messages for diagnostics if (acceptDrop == true) { event.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE); } else { event.acceptDrag(DnDConstants.ACTION_COPY); } } /** * is invoked when you are exit the DropSite without dropping * */ public void dragExit(DropTargetEvent event) { } /** * is invoked when a drag operation is going on * */ public void dragOver(DropTargetDragEvent event)
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/list/AddressbookDNDListView.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/contact/list/ContactDNDListView.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
DropTarget dropTarget = null;
1
DropTarget dropTarget = null;
2
	/**
2
	/**
3
	 * enables this component to be a Drag Source
3
	 * enables this component to be a Drag Source
4
	 */
4
	 */
5
	DragSource dragSource = null;
5
	DragSource dragSource = null;
6
	boolean acceptDrop = true;
6
	boolean acceptDrop = true;
7
	private IBasicModelPartial[] selection1;
7
	private IHeaderItem[] selection1;
8
	private IBasicModelPartial[] selection2;
8
	private IHeaderItem[] selection2;
9
	int index = -1;
9
	int index = -1;
10
	private boolean dndAction = false;
10
	private boolean dndAction = false;
11
	// Where, in the drag image, the mouse was clicked
11
	// Where, in the drag image, the mouse was clicked
12
	public AddressbookDNDListView() {
12
	public ContactDNDListView() {
13
		super();
13
		super();
14
		addListSelectionListener(this);
14
		addListSelectionListener(this);
15
		dropTarget = new DropTarget(this, this);
15
		dropTarget = new DropTarget(this, this);
16
		dragSource = DragSource.getDefaultDragSource();
16
		dragSource = DragSource.getDefaultDragSource();
17
		if (acceptDrop == true) {
17
		if (acceptDrop == true) {
18
			dragSource.createDefaultDragGestureRecognizer(this,
18
			dragSource.createDefaultDragGestureRecognizer(this,
19
					DnDConstants.ACTION_COPY_OR_MOVE, this);
19
					DnDConstants.ACTION_COPY_OR_MOVE, this);
20
		} else {
20
		} else {
21
			dragSource.createDefaultDragGestureRecognizer(this,
21
			dragSource.createDefaultDragGestureRecognizer(this,
22
					DnDConstants.ACTION_COPY, this);
22
					DnDConstants.ACTION_COPY, this);
23
		}
23
		}
24
	}
24
	}
25
	public AddressbookDNDListView(AddressbookListModel model) {
25
	public ContactDNDListView(ContactListModel model) {
26
		super(model);
26
		super(model);
27
		addListSelectionListener(this);
27
		addListSelectionListener(this);
28
		dropTarget = new DropTarget(this, this);
28
		dropTarget = new DropTarget(this, this);
29
		dragSource = new DragSource();
29
		dragSource = new DragSource();
30
		if (acceptDrop == true) {
30
		if (acceptDrop == true) {
31
			dragSource.createDefaultDragGestureRecognizer(this,
31
			dragSource.createDefaultDragGestureRecognizer(this,
32
					DnDConstants.ACTION_COPY_OR_MOVE, this);
32
					DnDConstants.ACTION_COPY_OR_MOVE, this);
33
		} else {
33
		} else {
34
			dragSource.createDefaultDragGestureRecognizer(this,
34
			dragSource.createDefaultDragGestureRecognizer(this,
35
					DnDConstants.ACTION_COPY, this);
35
					DnDConstants.ACTION_COPY, this);
36
		}
36
		}
37
	}
37
	}
38
	public void setAcceptDrop(boolean b) {
38
	public void setAcceptDrop(boolean b) {
39
		acceptDrop = b;
39
		acceptDrop = b;
40
	}
40
	}
41
	/**
41
	/**
42
	 * is invoked when you are dragging over the DropSite
42
	 * is invoked when you are dragging over the DropSite
43
	 * 
43
	 * 
44
	 */
44
	 */
45
	public void dragEnter(DropTargetDragEvent event) {
45
	public void dragEnter(DropTargetDragEvent event) {
46
		// debug messages for diagnostics
46
		// debug messages for diagnostics
47
		if (acceptDrop == true) {
47
		if (acceptDrop == true) {
48
			event.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
48
			event.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
49
		} else {
49
		} else {
50
			event.acceptDrag(DnDConstants.ACTION_COPY);
50
			event.acceptDrag(DnDConstants.ACTION_COPY);
51
		}
51
		}
52
	}
52
	}
53
	/**
53
	/**
54
	 * is invoked when you are exit the DropSite without dropping
54
	 * is invoked when you are exit the DropSite without dropping
55
	 * 
55
	 * 
56
	 */
56
	 */
57
	public void dragExit(DropTargetEvent event) {
57
	public void dragExit(DropTargetEvent event) {
58
	}
58
	}
59
	/**
59
	/**
60
	 * is invoked when a drag operation is going on
60
	 * is invoked when a drag operation is going on
61
	 * 
61
	 * 
62
	 */
62
	 */
63
	public void dragOver(DropTargetDragEvent event) 
63
	public void dragOver(DropTargetDragEvent event) 
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0