@Override protected void firePropertyChange(int action) { super.firePropertyChange(action); } /** * This sets the selection into whichever viewer is active. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setSelectionToViewer(Collection<?> collection) { final Collection<?> theSelection = collection; // Make sure it's okay. // if (theSelection != null && !theSelection.isEmpty()) { // I don't know if this should be run this deferred // because we might have to give the editor a chance to process the viewer update events // and hence to update the views first. // // Runnable runnable = new Runnable() { public void run() { // Try to select the items in the current content viewer of the editor. // if (currentViewer != null) { currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); } } }; runnable.run(); } } /** * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EditingDomain getEditingDomain() { return editingDomain; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object [] getElements(Object object) { Object parent = super.getParent(object); return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object [] getChildren(Object object) { Object parent = super.getParent(object); return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean hasChildren(Object object) { Object parent = super.getParent(object); return parent != null; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getParent(Object object) { return null;
@Override protected void firePropertyChange(int action) { super.firePropertyChange(action); } /** * This sets the selection into whichever viewer is active. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public void setSelectionToViewer(Collection<?> collection) { final Collection<?> theSelection = collection; // Make sure it's okay. // if (theSelection != null && !theSelection.isEmpty()) { // I don't know if this should be run this deferred // because we might have to give the editor a chance to process the viewer update events // and hence to update the views first. // // Runnable runnable = new Runnable() { public void run() { // Try to select the items in the current content viewer of the editor. // if (currentViewer != null) { currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); } } }; runnable.run(); } } /** * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EditingDomain getEditingDomain() { return editingDomain; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { super(adapterFactory); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object [] getElements(Object object) { Object parent = super.getParent(object); return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object [] getChildren(Object object) { Object parent = super.getParent(object); return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public boolean hasChildren(Object object) { Object parent = super.getParent(object); return parent != null; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object getParent(Object object) { return null;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/presentation/EcoreEditor.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/presentation/Ecore2XMLEditor.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
@Override
1
@Override
2
  protected void firePropertyChange(int action)
2
  protected void firePropertyChange(int action)
3
  {
3
  {
4
    super.firePropertyChange(action);
4
    super.firePropertyChange(action);
5
  }
5
  }
6
  /**
6
  /**
7
   * This sets the selection into whichever viewer is active.
7
   * This sets the selection into whichever viewer is active.
8
   * <!-- begin-user-doc -->
8
   * <!-- begin-user-doc -->
9
   * <!-- end-user-doc -->
9
   * <!-- end-user-doc -->
10
   * @generated
10
   * @generated
11
   */
11
   */
12
  public void setSelectionToViewer(Collection<?> collection)
12
  public void setSelectionToViewer(Collection<?> collection)
13
  {
13
  {
14
    final Collection<?> theSelection = collection;
14
    final Collection<?> theSelection = collection;
15
    // Make sure it's okay.
15
    // Make sure it's okay.
16
    //
16
    //
17
    if (theSelection != null && !theSelection.isEmpty())
17
    if (theSelection != null && !theSelection.isEmpty())
18
    {
18
    {
19
      // I don't know if this should be run this deferred
19
      // I don't know if this should be run this deferred
20
      // because we might have to give the editor a chance to process the viewer update events
20
      // because we might have to give the editor a chance to process the viewer update events
21
      // and hence to update the views first.
21
      // and hence to update the views first.
22
      //
22
      //
23
      //
23
      //
24
      Runnable runnable =
24
      Runnable runnable =
25
        new Runnable()
25
        new Runnable()
26
        {
26
        {
27
          public void run()
27
          public void run()
28
          {
28
          {
29
            // Try to select the items in the current content viewer of the editor.
29
            // Try to select the items in the current content viewer of the editor.
30
            //
30
            //
31
            if (currentViewer != null)
31
            if (currentViewer != null)
32
            {
32
            {
33
              currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
33
              currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true);
34
            }
34
            }
35
          }
35
          }
36
        };
36
        };
37
      runnable.run();
37
      runnable.run();
38
    }
38
    }
39
  }
39
  }
40
  /**
40
  /**
41
   * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
41
   * This returns the editing domain as required by the {@link IEditingDomainProvider} interface.
42
   * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
42
   * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain}
43
   * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
43
   * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}.
44
   * <!-- begin-user-doc -->
44
   * <!-- begin-user-doc -->
45
   * <!-- end-user-doc -->
45
   * <!-- end-user-doc -->
46
   * @generated
46
   * @generated
47
   */
47
   */
48
  public EditingDomain getEditingDomain()
48
  public EditingDomain getEditingDomain()
49
  {
49
  {
50
    return editingDomain;
50
    return editingDomain;
51
  }
51
  }
52
  /**
52
  /**
53
   * <!-- begin-user-doc -->
53
   * <!-- begin-user-doc -->
54
   * <!-- end-user-doc -->
54
   * <!-- end-user-doc -->
55
   * @generated
55
   * @generated
56
   */
56
   */
57
  public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider
57
  public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider
58
  {
58
  {
59
    /**
59
    /**
60
     * <!-- begin-user-doc -->
60
     * <!-- begin-user-doc -->
61
     * <!-- end-user-doc -->
61
     * <!-- end-user-doc -->
62
     * @generated
62
     * @generated
63
     */
63
     */
64
    public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory)
64
    public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory)
65
    {
65
    {
66
      super(adapterFactory);
66
      super(adapterFactory);
67
    }
67
    }
68
    /**
68
    /**
69
     * <!-- begin-user-doc -->
69
     * <!-- begin-user-doc -->
70
     * <!-- end-user-doc -->
70
     * <!-- end-user-doc -->
71
     * @generated
71
     * @generated
72
     */
72
     */
73
    @Override
73
    @Override
74
    public Object [] getElements(Object object)
74
    public Object [] getElements(Object object)
75
    {
75
    {
76
      Object parent = super.getParent(object);
76
      Object parent = super.getParent(object);
77
      return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
77
      return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
78
    }
78
    }
79
    /**
79
    /**
80
     * <!-- begin-user-doc -->
80
     * <!-- begin-user-doc -->
81
     * <!-- end-user-doc -->
81
     * <!-- end-user-doc -->
82
     * @generated
82
     * @generated
83
     */
83
     */
84
    @Override
84
    @Override
85
    public Object [] getChildren(Object object)
85
    public Object [] getChildren(Object object)
86
    {
86
    {
87
      Object parent = super.getParent(object);
87
      Object parent = super.getParent(object);
88
      return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
88
      return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray();
89
    }
89
    }
90
    /**
90
    /**
91
     * <!-- begin-user-doc -->
91
     * <!-- begin-user-doc -->
92
     * <!-- end-user-doc -->
92
     * <!-- end-user-doc -->
93
     * @generated
93
     * @generated
94
     */
94
     */
95
    @Override
95
    @Override
96
    public boolean hasChildren(Object object)
96
    public boolean hasChildren(Object object)
97
    {
97
    {
98
      Object parent = super.getParent(object);
98
      Object parent = super.getParent(object);
99
      return parent != null;
99
      return parent != null;
100
    }
100
    }
101
    /**
101
    /**
102
     * <!-- begin-user-doc -->
102
     * <!-- begin-user-doc -->
103
     * <!-- end-user-doc -->
103
     * <!-- end-user-doc -->
104
     * @generated
104
     * @generated
105
     */
105
     */
106
    @Override
106
    @Override
107
    public Object getParent(Object object)
107
    public Object getParent(Object object)
108
    {
108
    {
109
      return null;
109
      return null;
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