@Override public void setActiveWorkbenchPart(IWorkbenchPart workbenchPart) { if (editingDomain != null) { editingDomain.getCommandStack().removeCommandStackListener(this); } super.setActiveWorkbenchPart(workbenchPart); if (editingDomain != null) { editingDomain.getCommandStack().addCommandStackListener(this); } } public void commandStackChanged(EventObject event) { selectionChanged(action, ((ISelectionProvider)workbenchPart).getSelection()); } @Override public void selectionChanged(IAction action, ISelection selection) { if (selection instanceof IComposedSelection) { super.selectionChanged(action,((IComposedSelection)selection).getCombinedSelection()); } else { super.selectionChanged(action, selection); } } /** * This returns the image that is used if the command does not provide an override. */ protected Object getDefaultImage() { return MappingPlugin.getPlugin().getImage("full/etool16/CreateOneToOneMapping");
@Override public void setActiveWorkbenchPart(IWorkbenchPart workbenchPart) { if (editingDomain != null) { editingDomain.getCommandStack().removeCommandStackListener(this); } super.setActiveWorkbenchPart(workbenchPart); if (editingDomain != null) { editingDomain.getCommandStack().addCommandStackListener(this); } } public void commandStackChanged(EventObject event) { selectionChanged(action, ((ISelectionProvider)workbenchPart).getSelection()); } @Override public void selectionChanged(IAction action, ISelection selection) { if (selection instanceof IComposedSelection) { super.selectionChanged(action,((IComposedSelection)selection).getCombinedSelection()); } else { super.selectionChanged(action, selection); } } /** * This returns the image that is used if the command does not provide an override. */ protected Object getDefaultImage() { return MappingPlugin.getPlugin().getImage("full/etool16/RemoveOneToOneMapping");
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/mapping/action/CreateMappingAction.java File path: /emf-2.4.1/src/org/eclipse/emf/mapping/action/RemoveMappingAction.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
@Override
1
@Override
2
  public void setActiveWorkbenchPart(IWorkbenchPart workbenchPart)
2
  public void setActiveWorkbenchPart(IWorkbenchPart workbenchPart)
3
  {
3
  {
4
    if (editingDomain != null)
4
    if (editingDomain != null)
5
    {
5
    {
6
      editingDomain.getCommandStack().removeCommandStackListener(this);
6
      editingDomain.getCommandStack().removeCommandStackListener(this);
7
    }
7
    }
8
    super.setActiveWorkbenchPart(workbenchPart);
8
    super.setActiveWorkbenchPart(workbenchPart);
9
    if (editingDomain != null)
9
    if (editingDomain != null)
10
    {
10
    {
11
      editingDomain.getCommandStack().addCommandStackListener(this);
11
      editingDomain.getCommandStack().addCommandStackListener(this);
12
    }
12
    }
13
  }
13
  }
14
  public void commandStackChanged(EventObject event)
14
  public void commandStackChanged(EventObject event)
15
  {
15
  {
16
    selectionChanged(action, ((ISelectionProvider)workbenchPart).getSelection());
16
    selectionChanged(action, ((ISelectionProvider)workbenchPart).getSelection());
17
  }
17
  }
18
  @Override
18
  @Override
19
  public void selectionChanged(IAction action, ISelection selection)
19
  public void selectionChanged(IAction action, ISelection selection)
20
  {
20
  {
21
    if (selection instanceof IComposedSelection)
21
    if (selection instanceof IComposedSelection)
22
    {
22
    {
23
      super.selectionChanged(action,((IComposedSelection)selection).getCombinedSelection());
23
      super.selectionChanged(action,((IComposedSelection)selection).getCombinedSelection());
24
    }
24
    }
25
    else
25
    else
26
    {
26
    {
27
      super.selectionChanged(action, selection);
27
      super.selectionChanged(action, selection);
28
    }
28
    }
29
  }
29
  }
30
  /**
30
  /**
31
   * This returns the image that is used if the command does not provide an override.
31
   * This returns the image that is used if the command does not provide an override.
32
   */
32
   */
33
  protected Object getDefaultImage()
33
  protected Object getDefaultImage()
34
  {
34
  {
35
    return MappingPlugin.getPlugin().getImage("full/etool16/CreateOneToOneMapping");
35
    return MappingPlugin.getPlugin().getImage("full/etool16/RemoveOneToOneMapping");
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