CloneSet90


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
112210.964class_body_declarations[13]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
1115202
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExclusionInclusionDialog.java
2112221
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SetFilterWizardPage.java
Clone Instance
1
Line Count
115
Source Line
202
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ExclusionInclusionDialog.java

        protected void doSelectionChanged(ListDialogField field) {
                List selected = field.getSelectedElements();
                field.enableButton(IDX_EDIT, canEdit(selected));
        }

        private boolean canEdit(List selected) {
                return selected.size() == 1;
        }

        private void editEntry(ListDialogField field) {
                List selElements = field.getSelectedElements();
                if (selElements.size() != 1) {
                        return;
                }
                List existing = field.getElements();
                String entry = (String) selElements.get(0);
                ExclusionInclusionEntryDialog dialog = new ExclusionInclusionEntryDialog(getShell(), isExclusion(field), entry, existing, fCurrElement);
                if (dialog.open() == Window.OK) {
                        field.replaceElement(entry, dialog.getExclusionPattern());
                }
        }

        private boolean isExclusion(ListDialogField field) {
                return field == fExclusionPatternList;
        }


        private void addEntry(ListDialogField field) {
                List existing = field.getElements();
                ExclusionInclusionEntryDialog dialog = new ExclusionInclusionEntryDialog(getShell(), isExclusion(field), null, existing, fCurrElement);
                if (dialog.open() == Window.OK) {
                        field.addElement(dialog.getExclusionPattern());
                }
        }



        // -------- ExclusionPatternAdapter --------

        private class ExclusionPatternAdapter implements IListAdapter, IDialogFieldListener {
                /**
                 * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#customButtonPressed(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField, int)
                 */
                public void customButtonPressed(ListDialogField field, int index) {
                        doCustomButtonPressed(field, index);
                }

                /**
                 * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#selectionChanged(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField)
                 */
                public void selectionChanged(ListDialogField field) {
                        doSelectionChanged(field);
                }

                /**
                 * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#doubleClicked(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField)
                 */
                public void doubleClicked(ListDialogField field) {
                        doDoubleClicked(field);
                }

                /**
                 * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener#dialogFieldChanged(org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField)
                 */
                public void dialogFieldChanged(DialogField field) {
                }
        }

        protected void doStatusLineUpdate() {
        }

        protected void checkIfPatternValid() {
        }


        private IPath[] getPattern(ListDialogField field) {
                Object[] arr = field.getElements().toArray();
                Arrays.sort(arr);
                IPath[] res = new IPath[arr.length];
                for (int i = 0; i < res.length; i++) {
                        res[i] = new Path((String) arr[i]);
                }
                return res;
        }

        public IPath[] getExclusionPattern() {
                return getPattern(fExclusionPatternList);
        }

        public IPath[] getInclusionPattern() {
                return getPattern(fInclusionPatternList);
        }

        /*
         * @see org.eclipse.jface.window.Window#configureShell(Shell)
         */
        protected void configureShell(Shell newShell) {
                super.configureShell(newShell);
                PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.EXCLUSION_PATTERN_DIALOG);
        }

        private void addMultipleEntries(ListDialogField field) {
                String title, message;
                if (isExclusion(field)) {
                        title = NewWizardMessages.ExclusionInclusionDialog_ChooseExclusionPattern_title;
                        message = NewWizardMessages.ExclusionInclusionDialog_ChooseExclusionPattern_description;
                }
                else   {
                        title = NewWizardMessages.ExclusionInclusionDialog_ChooseInclusionPattern_title;
                        message = NewWizardMessages.ExclusionInclusionDialog_ChooseInclusionPattern_description;
                }
                IPath[] res = ExclusionInclusionEntryDialog.chooseExclusionPattern(getShell(), fCurrSourceFolder, title, message, null, true);
                if (res != null) {
                        for (int i = 0; i < res.length; i++) {
                                field.addElement(res[i].toString());
                        }
                }
        }


Clone Instance
2
Line Count
112
Source Line
221
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SetFilterWizardPage.java

        protected void doSelectionChanged(ListDialogField field) {
                List selected = field.getSelectedElements();
                field.enableButton(IDX_EDIT, canEdit(selected));
        }

        private boolean canEdit(List selected) {
                return selected.size() == 1;
        }

        private void editEntry(ListDialogField field) {
                List selElements = field.getSelectedElements();
                if (selElements.size() != 1) {
                        return;
                }
                List existing = field.getElements();
                String entry = (String) selElements.get(0);
                ExclusionInclusionEntryDialog dialog = new ExclusionInclusionEntryDialog(getShell(), isExclusion(field), entry, existing, fCurrElement);
                if (dialog.open() == Window.OK) {
                        field.replaceElement(entry, dialog.getExclusionPattern());
                }
        }

        private boolean isExclusion(ListDialogField field) {
                return field == fExclusionPatternList;
        }


        private void addEntry(ListDialogField field) {
                List existing = field.getElements();
                ExclusionInclusionEntryDialog dialog = new ExclusionInclusionEntryDialog(getShell(), isExclusion(field), null, existing, fCurrElement);
                if (dialog.open() == Window.OK) {
                        field.addElement(dialog.getExclusionPattern());
                }
        }

        // -------- ExclusionPatternAdapter --------

        private class ExclusionPatternAdapter implements IListAdapter, IDialogFieldListener {
                /**
                 * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#customButtonPressed(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField, int)
                 */
                public void customButtonPressed(ListDialogField field, int index) {
                        doCustomButtonPressed(field, index);
                }

                /**
                 * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#selectionChanged(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField)
                 */
                public void selectionChanged(ListDialogField field) {
                        doSelectionChanged(field);
                }

                /**
                 * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#doubleClicked(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField)
                 */
                public void doubleClicked(ListDialogField field) {
                        doDoubleClicked(field);
                }

                /**
                 * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener#dialogFieldChanged(org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField)
                 */
                public void dialogFieldChanged(DialogField field) {
                }
        }

        protected void doStatusLineUpdate() {
        }

        protected void checkIfPatternValid() {
        }


        private IPath[] getPattern(ListDialogField field) {
                Object[] arr = field.getElements().toArray();
                Arrays.sort(arr);
                IPath[] res = new IPath[arr.length];
                for (int i = 0; i < res.length; i++) {
                        res[i] = new Path((String) arr[i]);
                }
                return res;
        }

        public IPath[] getExclusionPattern() {
                return getPattern(fExclusionPatternList);
        }

        public IPath[] getInclusionPattern() {
                return getPattern(fInclusionPatternList);
        }

        /*
         * @see org.eclipse.jface.window.Window#configureShell(Shell)
         */
        protected void configureShell(Shell newShell) {
                PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.EXCLUSION_PATTERN_DIALOG);
        }

        private void addMultipleEntries(ListDialogField field) {
                String title, message;
                if (isExclusion(field)) {
                        title = NewWizardMessages.ExclusionInclusionDialog_ChooseExclusionPattern_title;
                        message = NewWizardMessages.ExclusionInclusionDialog_ChooseExclusionPattern_description;
                }
                else   {
                        title = NewWizardMessages.ExclusionInclusionDialog_ChooseInclusionPattern_title;
                        message = NewWizardMessages.ExclusionInclusionDialog_ChooseInclusionPattern_description;
                }
                IPath[] res = ExclusionInclusionEntryDialog.chooseExclusionPattern(getShell(), fCurrSourceFolder, title, message, null, true);
                if (res != null) {
                        for (int i = 0; i < res.length; i++) {
                                field.addElement(res[i].toString());
                        }
                }
        }


Clone AbstractionParameter Count: 1Parameter Bindings

protected void doSelectionChanged(ListDialogField field) {
  List selected = field.getSelectedElements();
  field.enableButton(IDX_EDIT, canEdit(selected));
}

private boolean canEdit(List selected) {
  return selected.size() == 1;
}

private void editEntry(ListDialogField field) {
  List selElements = field.getSelectedElements();
  if (selElements.size() != 1) {
    return;
  }
  List existing = field.getElements();
  String entry = (String) selElements.get(0);
  ExclusionInclusionEntryDialog dialog = new ExclusionInclusionEntryDialog(getShell(), isExclusion(field), entry, existing, fCurrElement);
  if (dialog.open() == Window.OK) {
    field.replaceElement(entry, dialog.getExclusionPattern());
  }
}

private boolean isExclusion(ListDialogField field) {
  return field == fExclusionPatternList;
}

private void addEntry(ListDialogField field) {
  List existing = field.getElements();
  ExclusionInclusionEntryDialog dialog = new ExclusionInclusionEntryDialog(getShell(), isExclusion(field), null, existing, fCurrElement);
  if (dialog.open() == Window.OK) {
    field.addElement(dialog.getExclusionPattern());
  }
}

// -------- ExclusionPatternAdapter --------
private class ExclusionPatternAdapter implements IListAdapter, IDialogFieldListener {
  /**
                   * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#customButtonPressed(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField, int)
                   */
  public void customButtonPressed(ListDialogField field, int index) {
    doCustomButtonPressed(field, index);
  }

  /**
                   * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#selectionChanged(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField)
                   */
  public void selectionChanged(ListDialogField field) {
    doSelectionChanged(field);
  }

  /**
                   * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IListAdapter#doubleClicked(org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField)
                   */
  public void doubleClicked(ListDialogField field) {
    doDoubleClicked(field);
  }

  /**
                   * @see org.eclipse.jdt.internal.ui.wizards.dialogfields.IDialogFieldListener#dialogFieldChanged(org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField)
                   */
  public void dialogFieldChanged(DialogField field) {
  }
}

protected void doStatusLineUpdate() {
}

protected void checkIfPatternValid() {
}

private IPath[] getPattern(ListDialogField field) {
  Object[] arr = field.getElements().toArray();
  Arrays.sort(arr);
  IPath[] res = new IPath[arr.length];
  for (int i = 0; i < res.length; i++) {
    res[i] = new Path((String) arr[i]);
  }
  return res;
}

public IPath[] getExclusionPattern() {
  return getPattern(fExclusionPatternList);
}

public IPath[] getInclusionPattern() {
  return getPattern(fInclusionPatternList);
}

/*
         * @see org.eclipse.jface.window.Window#configureShell(Shell)
         */
protected void configureShell(Shell newShell) {
   [[#variablebd6a5a20]]
}

private void addMultipleEntries(ListDialogField field) {
  String title, message;
  if (isExclusion(field)) {
    title = NewWizardMessages.ExclusionInclusionDialog_ChooseExclusionPattern_title;
    message = NewWizardMessages.ExclusionInclusionDialog_ChooseExclusionPattern_description;
  }
  else {
    title = NewWizardMessages.ExclusionInclusionDialog_ChooseInclusionPattern_title;
    message = NewWizardMessages.ExclusionInclusionDialog_ChooseInclusionPattern_description;
  }
  IPath[] res = ExclusionInclusionEntryDialog.chooseExclusionPattern(getShell(), fCurrSourceFolder, title, message, null, true);
  if (res != null) {
    for (int i = 0; i < res.length; i++) {
      field.addElement(res[i].toString());
    }
  }
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#bd6a5a20]]
PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.EXCLUSION_PATTERN_DIALOG); 
12[[#bd6a5a20]]
super.configureShell(newShell);
PlatformUI.getWorkbench().getHelpSystem().setHelp(newShell, IJavaHelpContextIds.EXCLUSION_PATTERN_DIALOG);