@Deprecated public static class IntegerCellEditor extends TextCellEditor { public IntegerCellEditor(Composite composite) { super(composite); setValidator (new ICellEditorValidator() { public String isValid(Object object) { if (object instanceof Integer) { return null; } else { String string = (String)object; try { Integer.parseInt(string); return null; } catch (NumberFormatException exception) { return exception.getMessage(); } } } }); } @Override public Object doGetValue() { return new Integer(Integer.parseInt((String)super.doGetValue())); } @Override public void doSetValue(Object value) { super.doSetValue(value.toString());
@Deprecated public static class FloatCellEditor extends TextCellEditor { public FloatCellEditor(Composite composite) { super(composite); setValidator (new ICellEditorValidator() { public String isValid(Object object) { if (object instanceof Float) { return null; } else { String string = (String)object; try { Float.parseFloat(string); return null; } catch (NumberFormatException exception) { return exception.getMessage(); } } } }); } @Override public Object doGetValue() { return new Float(Float.parseFloat((String)super.doGetValue())); } @Override public void doSetValue(Object value) { super.doSetValue(value.toString());
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/provider/PropertyDescriptor.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/provider/PropertyDescriptor.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
@Deprecated
1
@Deprecated
2
  public static class IntegerCellEditor extends TextCellEditor
2
  public static class FloatCellEditor extends TextCellEditor
3
  {
3
  {
4
    public IntegerCellEditor(Composite composite)
4
    public FloatCellEditor(Composite composite)
5
    {
5
    {
6
      super(composite);
6
      super(composite);
7
      setValidator
7
      setValidator
8
        (new ICellEditorValidator()
8
        (new ICellEditorValidator()
9
         {
9
         {
10
           public String isValid(Object object)
10
           public String isValid(Object object)
11
           {
11
           {
12
             if (object instanceof Integer)
12
             if (object instanceof Float)
13
             {
13
             {
14
               return null;
14
               return null;
15
             }
15
             }
16
             else
16
             else
17
             {
17
             {
18
               String string = (String)object;
18
               String string = (String)object;
19
               try
19
               try
20
               {
20
               {
21
                 Integer.parseInt(string);
21
                 Float.parseFloat(string);
22
                 return null;
22
                 return null;
23
               }
23
               }
24
               catch (NumberFormatException exception)
24
               catch (NumberFormatException exception)
25
               {
25
               {
26
                 return exception.getMessage();
26
                 return exception.getMessage();
27
               }
27
               }
28
             }
28
             }
29
           }
29
           }
30
         });
30
         });
31
    }
31
    }
32
    @Override
32
    @Override
33
    public Object doGetValue()
33
    public Object doGetValue()
34
    {
34
    {
35
      return new Integer(Integer.parseInt((String)super.doGetValue()));
35
      return new Float(Float.parseFloat((String)super.doGetValue()));
36
    }
36
    }
37
    @Override
37
    @Override
38
    public void doSetValue(Object value)
38
    public void doSetValue(Object value)
39
    {
39
    {
40
      super.doSetValue(value.toString());
40
      super.doSetValue(value.toString());
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