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) { } /** * a drop has occurred * */ public void drop(DropTargetDropEvent event) { if (acceptDrop == false) { event.rejectDrop(); clearSelection(); return; } IHeaderItem[] items = HeaderItemDNDManager.getInstance() .getHeaderItemList(); for (int i = 0; i < items.length; i++
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) { } /** * a drop has occurred * */ public void drop(DropTargetDropEvent event) { if (acceptDrop == false) { event.rejectDrop(); clearSelection(); return; } IBasicModelPartial[] items = HeaderItemDNDManager.getInstance() .getHeaderItemList(); for (int i = 0; i < items.length; i++
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/contact/list/ContactDNDListView.java File path: /columba-1.4-src/contact/src/main/java/org/columba/addressbook/gui/list/AddressbookDNDListView.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
ContactDNDListView() {
1
AddressbookDNDListView() {
2
		super();
2
		super();
3
		addListSelectionListener(this);
3
		addListSelectionListener(this);
4
		dropTarget = new DropTarget(this, this);
4
		dropTarget = new DropTarget(this, this);
5
		dragSource = DragSource.getDefaultDragSource();
5
		dragSource = DragSource.getDefaultDragSource();
6
		if (acceptDrop == true) {
6
		if (acceptDrop == true) {
7
			dragSource.createDefaultDragGestureRecognizer(this,
7
			dragSource.createDefaultDragGestureRecognizer(this,
8
					DnDConstants.ACTION_COPY_OR_MOVE, this);
8
					DnDConstants.ACTION_COPY_OR_MOVE, this);
9
		} else {
9
		} else {
10
			dragSource.createDefaultDragGestureRecognizer(this,
10
			dragSource.createDefaultDragGestureRecognizer(this,
11
					DnDConstants.ACTION_COPY, this);
11
					DnDConstants.ACTION_COPY, this);
12
		}
12
		}
13
	}
13
	}
14
	public ContactDNDListView(ContactListModel model) {
14
	public AddressbookDNDListView(AddressbookListModel model) {
15
		super(model);
15
		super(model);
16
		addListSelectionListener(this);
16
		addListSelectionListener(this);
17
		dropTarget = new DropTarget(this, this);
17
		dropTarget = new DropTarget(this, this);
18
		dragSource = new DragSource();
18
		dragSource = new DragSource();
19
		if (acceptDrop == true) {
19
		if (acceptDrop == true) {
20
			dragSource.createDefaultDragGestureRecognizer(this,
20
			dragSource.createDefaultDragGestureRecognizer(this,
21
					DnDConstants.ACTION_COPY_OR_MOVE, this);
21
					DnDConstants.ACTION_COPY_OR_MOVE, this);
22
		} else {
22
		} else {
23
			dragSource.createDefaultDragGestureRecognizer(this,
23
			dragSource.createDefaultDragGestureRecognizer(this,
24
					DnDConstants.ACTION_COPY, this);
24
					DnDConstants.ACTION_COPY, this);
25
		}
25
		}
26
	}
26
	}
27
	public void setAcceptDrop(boolean b) {
27
	public void setAcceptDrop(boolean b) {
28
		acceptDrop = b;
28
		acceptDrop = b;
29
	}
29
	}
30
	/**
30
	/**
31
	 * is invoked when you are dragging over the DropSite
31
	 * is invoked when you are dragging over the DropSite
32
	 * 
32
	 * 
33
	 */
33
	 */
34
	public void dragEnter(DropTargetDragEvent event) {
34
	public void dragEnter(DropTargetDragEvent event) {
35
		// debug messages for diagnostics
35
		// debug messages for diagnostics
36
		if (acceptDrop == true) {
36
		if (acceptDrop == true) {
37
			event.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
37
			event.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE);
38
		} else {
38
		} else {
39
			event.acceptDrag(DnDConstants.ACTION_COPY);
39
			event.acceptDrag(DnDConstants.ACTION_COPY);
40
		}
40
		}
41
	}
41
	}
42
	/**
42
	/**
43
	 * is invoked when you are exit the DropSite without dropping
43
	 * is invoked when you are exit the DropSite without dropping
44
	 * 
44
	 * 
45
	 */
45
	 */
46
	public void dragExit(DropTargetEvent event) {
46
	public void dragExit(DropTargetEvent event) {
47
	}
47
	}
48
	/**
48
	/**
49
	 * is invoked when a drag operation is going on
49
	 * is invoked when a drag operation is going on
50
	 * 
50
	 * 
51
	 */
51
	 */
52
	public void dragOver(DropTargetDragEvent event) {
52
	public void dragOver(DropTargetDragEvent event) {
53
	}
53
	}
54
	/**
54
	/**
55
	 * a drop has occurred
55
	 * a drop has occurred
56
	 * 
56
	 * 
57
	 */
57
	 */
58
	public void drop(DropTargetDropEvent event) {
58
	public void drop(DropTargetDropEvent event) {
59
		if (acceptDrop == false) {
59
		if (acceptDrop == false) {
60
			event.rejectDrop();
60
			event.rejectDrop();
61
			clearSelection();
61
			clearSelection();
62
			return;
62
			return;
63
		}
63
		}
64
		IHeaderItem[] items = HeaderItemDNDManager.getInstance()
64
		IBasicModelPartial[] items = HeaderItemDNDManager.getInstance()
65
				.getHeaderItemList();
65
				.getHeaderItemList();
66
		for (int i = 0; i < items.length; i++
66
		for (int i = 0; i < items.length; i++
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