CloneSet35


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
103210.996class_body_declarations[5]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1103767
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/presentation/EcoreActionBarContributor.java
2103380
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/presentation/Ecore2XMLActionBarContributor.java
Next
Last
Clone Instance
1
Line Count
103
Source Line
767
Source File
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/ecore/presentation/EcoreActionBarContributor.java

/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
  if (actions != null) {
    for (IAction action: actions) {
      if (contributionID != null) {
        manager.insertBefore(contributionID, action);
      }
      else {
        manager.add(action);
      }
    }
  }
}

/**
 * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
  if (actions != null) {
    IContributionItem[] items = manager.getItems();
    for (int i = 0; i < items.length; i++) {
      // Look into SubContributionItems
      //
      IContributionItem contributionItem = items[i];
      while (contributionItem instanceof SubContributionItem) {
        contributionItem = ((SubContributionItem) contributionItem).getInnerItem();
      }
      // Delete the ActionContributionItems with matching action.
      //
      if (contributionItem instanceof ActionContributionItem) {
        IAction action = ((ActionContributionItem) contributionItem).getAction();
        if (actions.contains(action)) {
          manager.remove(contributionItem);
        }
      }
    }
  }
}

/**
 * This populates the pop-up menu before it appears.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override public void menuAboutToShow(IMenuManager menuManager) {
  super.menuAboutToShow(menuManager);
  MenuManager submenuManager = null;
  submenuManager = new MenuManager(EcoreEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
  populateManager(submenuManager, createChildActions, null);
  menuManager.insertBefore("edit", submenuManager);
  submenuManager = new MenuManager(EcoreEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
  populateManager(submenuManager, createSiblingActions, null);
  menuManager.insertBefore("edit", submenuManager);
}

/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override protected void addGlobalActions(IMenuManager menuManager) {
  menuManager.insertAfter("additions-end", new Separator("ui-actions"));
  menuManager.insertAfter("ui-actions", showPropertiesViewAction);
  refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
  menuManager.insertAfter("ui-actions", refreshViewerAction);
  super.addGlobalActions(menuManager);
}

/**
 * This ensures that a delete action will clean up all references to deleted objects.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override protected boolean removeAllReferencesOnDelete() {
  return true;
}


First
Previous
Clone Instance
2
Line Count
103
Source Line
380
Source File
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/mapping/ecore2xml/presentation/Ecore2XMLActionBarContributor.java

/**
 * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
 * by inserting them before the specified contribution item <code>contributionID</code>.
 * If <code>contributionID</code> is <code>null</code>, they are simply added.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
  if (actions != null) {
    for (IAction action: actions) {
      if (contributionID != null) {
        manager.insertBefore(contributionID, action);
      }
      else {
        manager.add(action);
      }
    }
  }
}

/**
 * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
 * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
  if (actions != null) {
    IContributionItem[] items = manager.getItems();
    for (int i = 0; i < items.length; i++) {
      // Look into SubContributionItems
      //
      IContributionItem contributionItem = items[i];
      while (contributionItem instanceof SubContributionItem) {
        contributionItem = ((SubContributionItem) contributionItem).getInnerItem();
      }
      // Delete the ActionContributionItems with matching action.
      //
      if (contributionItem instanceof ActionContributionItem) {
        IAction action = ((ActionContributionItem) contributionItem).getAction();
        if (actions.contains(action)) {
          manager.remove(contributionItem);
        }
      }
    }
  }
}

/**
 * This populates the pop-up menu before it appears.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override public void menuAboutToShow(IMenuManager menuManager) {
  super.menuAboutToShow(menuManager);
  MenuManager submenuManager = null;
  submenuManager = new MenuManager(Ecore2XMLUIPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); //$NON-NLS-1$
  populateManager(submenuManager, createChildActions, null);
  menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$
  submenuManager = new MenuManager(Ecore2XMLUIPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); //$NON-NLS-1$
  populateManager(submenuManager, createSiblingActions, null);
  menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$
}

/**
 * This inserts global actions before the "additions-end" separator.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override protected void addGlobalActions(IMenuManager menuManager) {
  menuManager.insertAfter("additions-end", new Separator("ui-actions")); //$NON-NLS-1$ //$NON-NLS-2$
  menuManager.insertAfter("ui-actions", showPropertiesViewAction); //$NON-NLS-1$
  refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
  menuManager.insertAfter("ui-actions", refreshViewerAction); //$NON-NLS-1$
  super.addGlobalActions(menuManager);
}

/**
 * This ensures that a delete action will clean up all references to deleted objects.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
@Override protected boolean removeAllReferencesOnDelete() {
  return true;
}


Clone AbstractionParameter Count: 1Parameter Bindings

/**
   * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
   * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
   * by inserting them before the specified contribution item <code>contributionID</code>.
   * If <code>contributionID</code> is <code>null</code>, they are simply added.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
  if (actions != null) {
    for (IAction action: actions) {
      if (contributionID != null) {
        manager.insertBefore(contributionID, action);
      }
      else {
        manager.add(action);
      }
    }
  }
}

/**
   * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
   * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
  if (actions != null) {
    IContributionItem[] items = manager.getItems();
    for (int i = 0; i < items.length; i++) {
      // Look into SubContributionItems
      //
      IContributionItem contributionItem = items[i];
      while (contributionItem instanceof SubContributionItem) {
        contributionItem = ((SubContributionItem) contributionItem).getInnerItem();
      }
      // Delete the ActionContributionItems with matching action.
      //
      if (contributionItem instanceof ActionContributionItem) {
        IAction action = ((ActionContributionItem) contributionItem).getAction();
        if (actions.contains(action)) {
          manager.remove(contributionItem);
        }
      }
    }
  }
}

/**
   * This populates the pop-up menu before it appears.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
@Override public void menuAboutToShow(IMenuManager menuManager) {
  super.menuAboutToShow(menuManager);
  MenuManager submenuManager = null;
  submenuManager = new MenuManager( [[#variable146ba000]].INSTANCE.getString("_UI_CreateChild_menu_item")); //$NON-NLS-1$
  populateManager(submenuManager, createChildActions, null);
  menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$
  submenuManager = new MenuManager( [[#variable146ba000]].INSTANCE.getString("_UI_CreateSibling_menu_item")); //$NON-NLS-1$
  populateManager(submenuManager, createSiblingActions, null);
  menuManager.insertBefore("edit", submenuManager); //$NON-NLS-1$
}

/**
   * This inserts global actions before the "additions-end" separator.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
@Override protected void addGlobalActions(IMenuManager menuManager) {
  menuManager.insertAfter("additions-end", new Separator("ui-actions")); //$NON-NLS-1$ //$NON-NLS-2$
  menuManager.insertAfter("ui-actions", showPropertiesViewAction); //$NON-NLS-1$
  refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
  menuManager.insertAfter("ui-actions", refreshViewerAction); //$NON-NLS-1$
  super.addGlobalActions(menuManager);
}

/**
   * This ensures that a delete action will clean up all references to deleted objects.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
@Override protected boolean removeAllReferencesOnDelete() {
  return true;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#146ba000]]
EcoreEditorPlugin 
12[[#146ba000]]
Ecore2XMLUIPlugin