public static class DateFormatTypeCombo extends JComboBox { private static final long serialVersionUID = 1L; public DateFormatTypeCombo() { // i18n[dataTypeDate.full=Full ({0})] addItem(s_stringMgr.getString("dataTypeDate.full", DateFormat.getDateInstance(DateFormat.FULL).format(new java.util.Date()))); // i18n[dataTypeDate.long=Long ({0})] addItem(s_stringMgr.getString("dataTypeDate.long", DateFormat.getDateInstance(DateFormat.LONG).format(new java.util.Date()))); // i18n[dataTypeDate.medium=Medium ({0})] addItem(s_stringMgr.getString("dataTypeDate.medium", DateFormat.getDateInstance(DateFormat.MEDIUM).format(new java.util.Date()))); // i18n[dataTypeDate.short=Short ({0})] addItem(s_stringMgr.getString("dataTypeDate.short", DateFormat.getDateInstance(DateFormat.SHORT).format(new java.util.Date()))); } public void setSelectedIndex(int option) { if (option == DateFormat.SHORT) super.setSelectedIndex(3); else if (option == DateFormat.MEDIUM) super.setSelectedIndex(2); else if (option == DateFormat.LONG) super.setSelectedIndex(1); else super.setSelectedIndex(0); } public int getValue() { if (getSelectedIndex() == 3) return DateFormat.SHORT; else if (getSelectedIndex() == 2) return DateFormat.MEDIUM; else if (getSelectedIndex() == 1) return DateFormat.LONG; else return DateFormat.FULL
public static class DateFormatTypeCombo extends JComboBox { private static final long serialVersionUID = 1L; public DateFormatTypeCombo() { // i18n[dataTypeTime.full=Full ({0})] addItem(s_stringMgr.getString("dataTypeTime.full", DateFormat.getTimeInstance(DateFormat.FULL).format(new java.util.Date()))); // i18n[dataTypeTime.long=Long ({0})] addItem(s_stringMgr.getString("dataTypeTime.long", DateFormat.getTimeInstance(DateFormat.LONG).format(new java.util.Date()))); // i18n[dataTypeTime.medium=Medium ({0})] addItem(s_stringMgr.getString("dataTypeTime.medium", DateFormat.getTimeInstance(DateFormat.MEDIUM).format(new java.util.Date()))); // i18n[dataTypeTime.short=Short ({0})] addItem(s_stringMgr.getString("dataTypeTime.short", DateFormat.getTimeInstance(DateFormat.SHORT).format(new java.util.Date()))); } public void setSelectedIndex(int option) { if (option == DateFormat.SHORT) super.setSelectedIndex(3); else if (option == DateFormat.MEDIUM) super.setSelectedIndex(2); else if (option == DateFormat.LONG) super.setSelectedIndex(1); else super.setSelectedIndex(0); } public int getValue() { if (getSelectedIndex() == 3) return DateFormat.SHORT; else if (getSelectedIndex() == 2) return DateFormat.MEDIUM; else if (getSelectedIndex() == 1) return DateFormat.LONG; else return DateFormat.FULL
Clone fragments detected by clone detection tool
File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeDate.java File path: /sql12/fw/src/net/sourceforge/squirrel_sql/fw/datasetviewer/cellcomponent/DataTypeTime.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public static class DateFormatTypeCombo extends JComboBox
1
public static class DateFormatTypeCombo extends JComboBox
2
	{
3
    
2
   {
4
    private static final long serialVersionUID = 1L;
3
    private static final long serialVersionUID = 1L;
5
        public DateFormatTypeCombo()
4
    public DateFormatTypeCombo()
6
		{
7
			
5
      {
8
// i18n[dataTypeDate.full=Full ({0})]
6
         // i18n[dataTypeTime.full=Full ({0})]
9
			addItem(s_stringMgr.getString("dataTypeDate.full", DateFormat.getDateInstance(DateFormat.FULL).format(new java.util.Date())));
7
         addItem(s_stringMgr.getString("dataTypeTime.full", DateFormat.getTimeInstance(DateFormat.FULL).format(new java.util.Date())));
10
			// i18n[dataTypeDate.long=Long ({0})]
8
         // i18n[dataTypeTime.long=Long ({0})]
11
			addItem(s_stringMgr.getString("dataTypeDate.long", DateFormat.getDateInstance(DateFormat.LONG).format(new java.util.Date())));
9
         addItem(s_stringMgr.getString("dataTypeTime.long", DateFormat.getTimeInstance(DateFormat.LONG).format(new java.util.Date())));
12
			// i18n[dataTypeDate.medium=Medium ({0})]
10
         // i18n[dataTypeTime.medium=Medium ({0})]
13
			addItem(s_stringMgr.getString("dataTypeDate.medium", DateFormat.getDateInstance(DateFormat.MEDIUM).format(new java.util.Date())));
11
         addItem(s_stringMgr.getString("dataTypeTime.medium", DateFormat.getTimeInstance(DateFormat.MEDIUM).format(new java.util.Date())));
14
			// i18n[dataTypeDate.short=Short ({0})]
12
         // i18n[dataTypeTime.short=Short ({0})]
15
			addItem(s_stringMgr.getString("dataTypeDate.short", DateFormat.getDateInstance(DateFormat.SHORT).format(new java.util.Date())));
13
         addItem(s_stringMgr.getString("dataTypeTime.short", DateFormat.getTimeInstance(DateFormat.SHORT).format(new java.util.Date())));
16
		}
17
		
14
      }
18
public void setSelectedIndex(int option) {
15
      public void setSelectedIndex(int option) {
19
			if (option == DateFormat.SHORT)
16
         if (option == DateFormat.SHORT)
20
				super.setSelectedIndex(3);
17
            super.setSelectedIndex(3);
21
			else if (option == DateFormat.MEDIUM)
18
         else if (option == DateFormat.MEDIUM)
22
				super.setSelectedIndex(2);
19
            super.setSelectedIndex(2);
23
			else if (option == DateFormat.LONG)
20
         else if (option == DateFormat.LONG)
24
				super.setSelectedIndex(1);
21
            super.setSelectedIndex(1);
25
			else super.setSelectedIndex(0);
22
         else super.setSelectedIndex(0);
26
		}
27
		
23
      }
28
public int getValue() {
24
      public int getValue() {
29
			if (getSelectedIndex() == 3)
25
         if (getSelectedIndex() == 3)
30
				return DateFormat.SHORT;
26
            return DateFormat.SHORT;
31
			else if (getSelectedIndex() == 2)
27
         else if (getSelectedIndex() == 2)
32
				return DateFormat.MEDIUM;
28
            return DateFormat.MEDIUM;
33
			else if (getSelectedIndex() == 1)
29
         else if (getSelectedIndex() == 1)
34
				return DateFormat.LONG;
30
            return DateFormat.LONG;
35
			else return DateFormat.FULL
31
         else return DateFormat.FULL
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