public class ActionComboBoxRenderer extends DefaultListCellRenderer { protected IExtensionHandler pluginHandler; /** * */ public ActionComboBoxRenderer() { super(); try { pluginHandler = PluginManager .getInstance().getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_MAIL_FILTERACTION); } catch (PluginHandlerNotFoundException ex) { ErrorDialog.createDialog(ex.getMessage(), ex); } } /* * (non-Javadoc) * * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, * java.lang.Object, int, boolean, boolean) */ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { if (cellHasFocus) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setBorder((cellHasFocus) ? UIManager .getBorder("List.focusCellHighlightBorder") : noFocusBorder); // id = org.columba.example.HelloWorld$HelloWorldPlugin String id = (String) value; //String userVisibleName = pluginHandler.getUserVisibleName(id); String userVisibleName = id; setText(userVisibleName); return this
public class CriteriaComboBoxRenderer extends DefaultListCellRenderer { protected IExtensionHandler pluginHandler; /** * */ public CriteriaComboBoxRenderer() { super(); try { pluginHandler = PluginManager.getInstance() .getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_MAIL_FILTER); } catch (PluginHandlerNotFoundException ex) { ErrorDialog.createDialog(ex.getMessage(), ex); } } /* * (non-Javadoc) * * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, * java.lang.Object, int, boolean, boolean) */ public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { if (isSelected) { setBackground(list.getSelectionBackground()); setForeground(list.getSelectionForeground()); } else { setBackground(list.getBackground()); setForeground(list.getForeground()); } setBorder((cellHasFocus) ? UIManager .getBorder("List.focusCellHighlightBorder") : noFocusBorder); // id = org.columba.example.HelloWorld$HelloWorldPlugin String id = (String) value; // String userVisibleName = pluginHandler.getUserVisibleName(id); String userVisibleName = id; setText(userVisibleName); return this
Clone fragments detected by clone detection tool
File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/filter/util/ActionComboBoxRenderer.java File path: /columba-1.4-src/mail/src/main/java/org/columba/mail/gui/config/filter/util/CriteriaComboBoxRenderer.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public class ActionComboBoxRenderer extends DefaultListCellRenderer {
1
public class CriteriaComboBoxRenderer extends DefaultListCellRenderer {
2
	protected IExtensionHandler pluginHandler;
2
	protected IExtensionHandler pluginHandler;
3
	/**
3
	/**
4
	 * 
4
	 * 
5
	 */
5
	 */
6
	public ActionComboBoxRenderer() {
6
	public CriteriaComboBoxRenderer() {
7
		super();
7
		super();
8
		try {
8
		try {
9
			pluginHandler = PluginManager
9
			pluginHandler = PluginManager
10
					.getInstance()
10
.getInstance()
11
.getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_MAIL_FILTERACTION);
11
					.getExtensionHandler(IExtensionHandlerKeys.ORG_COLUMBA_MAIL_FILTER);
12
		} catch (PluginHandlerNotFoundException ex) {
12
		} catch (PluginHandlerNotFoundException ex) {
13
			ErrorDialog.createDialog(ex.getMessage(), ex);
13
			ErrorDialog.createDialog(ex.getMessage(), ex);
14
		}
14
		}
15
	}
15
	}
16
	/*
16
	/*
17
	 * (non-Javadoc)
17
	 * (non-Javadoc)
18
	 * 
18
	 * 
19
	 * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList,
19
	 * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList,
20
	 *      java.lang.Object, int, boolean, boolean)
20
	 *      java.lang.Object, int, boolean, boolean)
21
	 */
21
	 */
22
	public Component getListCellRendererComponent(JList list, Object value,
22
	public Component getListCellRendererComponent(JList list, Object value,
23
			int index, boolean isSelected, boolean cellHasFocus) {
23
			int index, boolean isSelected, boolean cellHasFocus) {
24
		if (cellHasFocus) {
24
		if (isSelected) {
25
			setBackground(list.getSelectionBackground());
25
			setBackground(list.getSelectionBackground());
26
			setForeground(list.getSelectionForeground());
26
			setForeground(list.getSelectionForeground());
27
		} else {
27
		} else {
28
			setBackground(list.getBackground());
28
			setBackground(list.getBackground());
29
			setForeground(list.getForeground());
29
			setForeground(list.getForeground());
30
		}
30
		}
31
		setBorder((cellHasFocus) ? UIManager
31
		setBorder((cellHasFocus) ? UIManager
32
				.getBorder("List.focusCellHighlightBorder") : noFocusBorder);
32
				.getBorder("List.focusCellHighlightBorder") : noFocusBorder);
33
		// id = org.columba.example.HelloWorld$HelloWorldPlugin
33
		// id = org.columba.example.HelloWorld$HelloWorldPlugin
34
		String id = (String) value;
34
		String id = (String) value;
35
		//String userVisibleName = pluginHandler.getUserVisibleName(id);
35
		// String userVisibleName = pluginHandler.getUserVisibleName(id);
36
		String userVisibleName = id;
36
		String userVisibleName = id;
37
		setText(userVisibleName);
37
		setText(userVisibleName);
38
		return this
38
		return this
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