public CalendarList() { super(); setCellRenderer(new MyListCellRenderer()); setBorder(null); setHighlighters(new HighlighterPipeline( new Highlighter[] { new RolloverHighlighter(new Color(248, 248, 248), Color.white) })); setRolloverEnabled(true); } public void addAll(List<IEventInfo> list) { Iterator<IEventInfo> it = list.iterator(); while (it.hasNext()) { addElement(it.next()); } } public void add(IEventInfo result) { addElement(result); } /** * ********************** filtering * ********************************************* */ /** * Associates filtering document listener to text component. */ public void installJTextField(JTextField input) { if (input != null) { FilteringModel model = (FilteringModel) getModel(); input.getDocument().addDocumentListener(model); } } /** * Disassociates filtering document listener from text component. */ public void uninstallJTextField(JTextField input) { if (input != null) { FilteringModel model = (FilteringModel) getModel(); input.getDocument().removeDocumentListener(model); } } /** * Doesn't let model change to non-filtering variety */ public void setModel(ListModel model) { if (!(model instanceof FilteringModel)) { throw new IllegalArgumentException(); } else { super.setModel(model); } } /** * Adds item to model of list */ public void addElement(IEventInfo element) { ((FilteringModel) getModel()).addElement(element);
public ContactList() { super(); setCellRenderer(new MyListCellRenderer()); setBorder(null); setHighlighters(new HighlighterPipeline( new Highlighter[] { new RolloverHighlighter(new Color(248, 248, 248), Color.white) })); setRolloverEnabled(true); } public void addAll(List<IContactModelPartial> list) { Iterator<IContactModelPartial> it = list.iterator(); while (it.hasNext()) { addElement(it.next()); } } public void add(IContactModelPartial result) { addElement(result); } /** * ********************** filtering * ********************************************* */ /** * Associates filtering document listener to text component. */ public void installJTextField(JTextField input) { if (input != null) { FilteringModel model = (FilteringModel) getModel(); input.getDocument().addDocumentListener(model); } } /** * Disassociates filtering document listener from text component. */ public void uninstallJTextField(JTextField input) { if (input != null) { FilteringModel model = (FilteringModel) getModel(); input.getDocument().removeDocumentListener(model); } } /** * Doesn't let model change to non-filtering variety */ public void setModel(ListModel model) { if (!(model instanceof FilteringModel)) { throw new IllegalArgumentException(); } else { super.setModel(model); } } /** * Adds item to model of list */ public void addElement(IContactModelPartial element) { ((FilteringModel) getModel()).addElement(element);
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/calendar/src/main/java/org/columba/calendar/ui/box/CalendarList.java File path: /columba-1.4-src/contact/src/main/java/org/columba/contact/gui/box/ContactList.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public CalendarList() {
1
public ContactList() {
2
		super();
2
		super();
3
		setCellRenderer(new MyListCellRenderer());
3
		setCellRenderer(new MyListCellRenderer());
4
		setBorder(null);
4
		setBorder(null);
5
		setHighlighters(new HighlighterPipeline(
5
		setHighlighters(new HighlighterPipeline(
6
				new Highlighter[] { new RolloverHighlighter(new Color(248, 248,
6
				new Highlighter[] { new RolloverHighlighter(new Color(248, 248,
7
						248), Color.white) }));
7
						248), Color.white) }));
8
		setRolloverEnabled(true);
8
		setRolloverEnabled(true);
9
	}
9
	}
10
	public void addAll(List<IEventInfo> list) {
10
	public void addAll(List<IContactModelPartial> list) {
11
		Iterator<IEventInfo> it = list.iterator();
11
		Iterator<IContactModelPartial> it = list.iterator();
12
		while (it.hasNext()) {
12
		while (it.hasNext()) {
13
			addElement(it.next());
13
			addElement(it.next());
14
		}
14
		}
15
	}
15
	}
16
	public void add(IEventInfo result) {
16
	public void add(IContactModelPartial result) {
17
		addElement(result);
17
		addElement(result);
18
	}
18
	}
19
	/**
19
	/**
20
	 * ********************** filtering
20
	 * ********************** filtering
21
	 * *********************************************
21
	 * *********************************************
22
	 */
22
	 */
23
	/**
23
	/**
24
	 * Associates filtering document listener to text component.
24
	 * Associates filtering document listener to text component.
25
	 */
25
	 */
26
	public void installJTextField(JTextField input) {
26
	public void installJTextField(JTextField input) {
27
		if (input != null) {
27
		if (input != null) {
28
			FilteringModel model = (FilteringModel) getModel();
28
			FilteringModel model = (FilteringModel) getModel();
29
			input.getDocument().addDocumentListener(model);
29
			input.getDocument().addDocumentListener(model);
30
		}
30
		}
31
	}
31
	}
32
	/**
32
	/**
33
	 * Disassociates filtering document listener from text component.
33
	 * Disassociates filtering document listener from text component.
34
	 */
34
	 */
35
	public void uninstallJTextField(JTextField input) {
35
	public void uninstallJTextField(JTextField input) {
36
		if (input != null) {
36
		if (input != null) {
37
			FilteringModel model = (FilteringModel) getModel();
37
			FilteringModel model = (FilteringModel) getModel();
38
			input.getDocument().removeDocumentListener(model);
38
			input.getDocument().removeDocumentListener(model);
39
		}
39
		}
40
	}
40
	}
41
	/**
41
	/**
42
	 * Doesn't let model change to non-filtering variety
42
	 * Doesn't let model change to non-filtering variety
43
	 */
43
	 */
44
	public void setModel(ListModel model) {
44
	public void setModel(ListModel model) {
45
		if (!(model instanceof FilteringModel)) {
45
		if (!(model instanceof FilteringModel)) {
46
			throw new IllegalArgumentException();
46
			throw new IllegalArgumentException();
47
		} else {
47
		} else {
48
			super.setModel(model);
48
			super.setModel(model);
49
		}
49
		}
50
	}
50
	}
51
	/**
51
	/**
52
	 * Adds item to model of list
52
	 * Adds item to model of list
53
	 */
53
	 */
54
	public void addElement(IEventInfo element) {
54
	public void addElement(IContactModelPartial element) {
55
		((FilteringModel) getModel()).addElement(element);
55
		((FilteringModel) getModel()).addElement(element);
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