CloneSet447


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
54220.990class_body_declarations[5]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
154690
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java
253631
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/TreeListDialogField.java
Clone Instance
1
Line Count
54
Source Line
690
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java

        /**
         * Removes an element from the list.
         */
        public void removeElement(Object element) throws IllegalArgumentException {
                if (fElements.remove(element)) {
                        if (isOkToUse(fTableControl)) {
                                fTable.remove(element);
                        }
                        dialogFieldChanged();
                }
                else   {
                        throw new IllegalArgumentException();
                }
        }

        /**
         * Removes elements from the list.
         */
        public void removeElements(List elements) {
                if (elements.size() > 0) {
                        fElements.removeAll(elements);
                        if (isOkToUse(fTableControl)) {
                                fTable.remove(elements.toArray());
                        }
                        dialogFieldChanged();
                }
        }

        /**
         * Gets the number of elements
         */
        public int getSize() {
                return fElements.size();
        }

        public void selectElements(ISelection selection) {
                fSelectionWhenEnabled = selection;
                if (isOkToUse(fTableControl)) {
                        fTable.setSelection(selection, true);
                }
        }

        public void selectFirstElement() {
                Object element = null;
                if (fViewerSorter != null) {
                        Object[] arr = fElements.toArray();
                        fViewerSorter.sort(fTable, arr);
                        if (arr.length > 0) {
                                element = arr[0];
                        }
                }
                else   {
                        if (fElements.size() > 0) {
                                element = fElements.get(0);
                        }
                }
                if (element != null) {
                        selectElements(new StructuredSelection(element));
                }
        }


Clone Instance
2
Line Count
53
Source Line
631
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/TreeListDialogField.java

        /**
        * Removes an element from the list.
        */
        public void removeElement(Object element) throws IllegalArgumentException {
                if (fElements.remove(element)) {
                        if (isOkToUse(fTreeControl)) {
                                fTree.remove(element);
                        }
                        dialogFieldChanged();
                }
                else   {
                        throw new IllegalArgumentException();
                }
        }

        /**
        * Removes elements from the list.
        */
        public void removeElements(List elements) {
                if (elements.size() > 0) {
                        fElements.removeAll(elements);
                        if (isOkToUse(fTreeControl)) {
                                fTree.remove(elements.toArray());
                        }
                        dialogFieldChanged();
                }
        }

        /**
        * Gets the number of elements
        */
        public int getSize() {
                return fElements.size();
        }

        public void selectElements(ISelection selection) {
                fSelectionWhenEnabled = selection;
                if (isOkToUse(fTreeControl)) {
                        fTree.setSelection(selection, true);
                }
        }

        public void selectFirstElement() {
                Object element = null;
                if (fViewerSorter != null) {
                        Object[] arr = fElements.toArray();
                        fViewerSorter.sort(fTree, arr);
                        if (arr.length > 0) {
                                element = arr[0];
                        }
                }
                else   {
                        if (fElements.size() > 0) {
                                element = fElements.get(0);
                        }
                }
                if (element != null) {
                        selectElements(new StructuredSelection(element));
                }
        }


Clone AbstractionParameter Count: 2Parameter Bindings

/**
         * Removes an element from the list.
         */
/**
        * Removes an element from the list.
        */
public void removeElement(Object element) throws IllegalArgumentException {
  if (fElements.remove(element)) {
    if (isOkToUse( [[#variableb7adc780]])) {
       [[#variableb7adc760]].remove(element);
    }
    dialogFieldChanged();
  }
  else {
    throw new IllegalArgumentException();
  }
}

/**
         * Removes elements from the list.
         */
/**
        * Removes elements from the list.
        */
public void removeElements(List elements) {
  if (elements.size() > 0) {
    fElements.removeAll(elements);
    if (isOkToUse( [[#variableb7adc780]])) {
       [[#variableb7adc760]].remove(elements.toArray());
    }
    dialogFieldChanged();
  }
}

/**
         * Gets the number of elements
         */
/**
        * Gets the number of elements
        */
public int getSize() {
  return fElements.size();
}

public void selectElements(ISelection selection) {
  fSelectionWhenEnabled = selection;
  if (isOkToUse( [[#variableb7adc780]])) {
     [[#variableb7adc760]].setSelection(selection, true);
  }
}

public void selectFirstElement() {
  Object element = null;
  if (fViewerSorter != null) {
    Object[] arr = fElements.toArray();
    fViewerSorter.sort( [[#variableb7adc760]], arr);
    if (arr.length > 0) {
      element = arr[0];
    }
  }
  else {
    if (fElements.size() > 0) {
      element = fElements.get(0);
    }
  }
  if (element != null) {
    selectElements(new StructuredSelection(element));
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b7adc780]]
fTableControl 
12[[#b7adc780]]
fTreeControl 
21[[#b7adc760]]
fTable 
22[[#b7adc760]]
fTree