Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
83 | 2 | 2 | 0.986 | class_body_declarations[4] |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 83 | 377 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/ListDialogField.java |
2 | 83 | 304 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/dialogfields/TreeListDialogField.java |
| ||||
protected Button createButton(Composite parent, String label, SelectionListener listener) { Button button = new Button(parent, SWT.PUSH); button.setFont(parent.getFont()); button.setText(label); button.addSelectionListener(listener); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.verticalAlignment = GridData.BEGINNING; gd.widthHint = SWTUtil.getButtonWidthHint(button); button.setLayoutData(gd); return button; } private Label createSeparator(Composite parent) { Label separator = new Label(parent, SWT.SEPARATOR| SWT.HORIZONTAL); separator.setFont(parent.getFont()); separator.setVisible(false); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.verticalAlignment = GridData.BEGINNING; gd.verticalIndent = 4; separator.setLayoutData(gd); return separator; } /** * Returns the composite containing the buttons. When called the first time, the control * will be created. * @param parent The parent composite when called the first time, or <code>null</code> * after. */ public Composite getButtonBox(Composite parent) { if (fButtonsControl == null) { assertCompositeNotNull(parent); SelectionListener listener = new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { doButtonSelected(e); } public void widgetSelected(SelectionEvent e) { doButtonSelected(e); } }; Composite contents = new Composite(parent, SWT.NONE); contents.setFont(parent.getFont()); GridLayout layout = new GridLayout(); layout.marginWidth = 0; layout.marginHeight = 0; contents.setLayout(layout); if (fButtonLabels != null) { fButtonControls = new Button[fButtonLabels.length]; for (int i = 0; i < fButtonLabels.length; i++) { String currLabel = fButtonLabels[i]; if (currLabel != null) { fButtonControls[i] = createButton(contents, currLabel, listener); fButtonControls[i].setEnabled(isEnabled() && fButtonsEnabled[i]); } else { fButtonControls[i] = null; createSeparator(contents); } } } fLastSeparator = createSeparator(contents); updateButtonState(); fButtonsControl = contents; } return fButtonsControl; } private void doButtonSelected(SelectionEvent e) { if (fButtonControls != null) { for (int i = 0; i < fButtonControls.length; i++) { if (e.widget == fButtonControls[i]) { buttonPressed(i); return; } } } } |
| ||||
protected Button createButton(Composite parent, String label, SelectionListener listener) { Button button = new Button(parent, SWT.PUSH); button.setFont(parent.getFont()); button.setText(label); button.addSelectionListener(listener); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.verticalAlignment = GridData.BEGINNING; gd.widthHint = SWTUtil.getButtonWidthHint(button); button.setLayoutData(gd); return button; } private Label createSeparator(Composite parent) { Label separator = new Label(parent, SWT.NONE); separator.setFont(parent.getFont()); separator.setVisible(false); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.verticalAlignment = GridData.BEGINNING; gd.heightHint = 4; separator.setLayoutData(gd); return separator; } /** * Returns the composite containing the buttons. When called the first time, the control * will be created. * @param parent The parent composite when called the first time, or <code>null</code> * after. */ public Composite getButtonBox(Composite parent) { if (fButtonsControl == null) { assertCompositeNotNull(parent); SelectionListener listener = new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { doButtonSelected(e); } public void widgetSelected(SelectionEvent e) { doButtonSelected(e); } }; Composite contents = new Composite(parent, SWT.NONE); contents.setFont(parent.getFont()); GridLayout layout = new GridLayout(); layout.marginWidth = 0; layout.marginHeight = 0; contents.setLayout(layout); if (fButtonLabels != null) { fButtonControls = new Button[fButtonLabels.length]; for (int i = 0; i < fButtonLabels.length; i++) { String currLabel = fButtonLabels[i]; if (currLabel != null) { fButtonControls[i] = createButton(contents, currLabel, listener); fButtonControls[i].setEnabled(isEnabled() && fButtonsEnabled[i]); } else { fButtonControls[i] = null; createSeparator(contents); } } } fLastSeparator = createSeparator(contents); updateButtonState(); fButtonsControl = contents; } return fButtonsControl; } private void doButtonSelected(SelectionEvent e) { if (fButtonControls != null) { for (int i = 0; i < fButtonControls.length; i++) { if (e.widget == fButtonControls[i]) { buttonPressed(i); return; } } } } |
| |||
protected Button createButton(Composite parent, String label, SelectionListener listener) { Button button = new Button(parent, SWT.PUSH); button.setFont(parent.getFont()); button.setText(label); button.addSelectionListener(listener); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.grabExcessHorizontalSpace = true; gd.verticalAlignment = GridData.BEGINNING; gd.widthHint = SWTUtil.getButtonWidthHint(button); button.setLayoutData(gd); return button; } private Label createSeparator(Composite parent) { Label separator = new Label(parent, [[#variable616de340]]); separator.setFont(parent.getFont()); separator.setVisible(false); GridData gd = new GridData(); gd.horizontalAlignment = GridData.FILL; gd.verticalAlignment = GridData.BEGINNING; gd. [[#variable616dfb20]]= 4; separator.setLayoutData(gd); return separator; } /** * Returns the composite containing the buttons. When called the first time, the control * will be created. * @param parent The parent composite when called the first time, or <code>null</code> * after. */ /** * Returns the composite containing the buttons. When called the first time, the control * will be created. * @param parent The parent composite when called the first time, or <code>null</code> * after. */ public Composite getButtonBox(Composite parent) { if (fButtonsControl == null) { assertCompositeNotNull(parent); SelectionListener listener = new SelectionListener() { public void widgetDefaultSelected(SelectionEvent e) { doButtonSelected(e); } public void widgetSelected(SelectionEvent e) { doButtonSelected(e); } }; Composite contents = new Composite(parent, SWT.NONE); contents.setFont(parent.getFont()); GridLayout layout = new GridLayout(); layout.marginWidth = 0; layout.marginHeight = 0; contents.setLayout(layout); if (fButtonLabels != null) { fButtonControls = new Button[fButtonLabels.length]; for (int i = 0; i < fButtonLabels.length; i++) { String currLabel = fButtonLabels[i]; if (currLabel != null) { fButtonControls[i] = createButton(contents, currLabel, listener); fButtonControls[i].setEnabled(isEnabled() && fButtonsEnabled[i]); } else { fButtonControls[i] = null; createSeparator(contents); } } } fLastSeparator = createSeparator(contents); updateButtonState(); fButtonsControl = contents; } return fButtonsControl; } private void doButtonSelected(SelectionEvent e) { if (fButtonControls != null) { for (int i = 0; i < fButtonControls.length; i++) { if (e.widget == fButtonControls[i]) { buttonPressed(i); return; } } } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#616de340]] | SWT.SEPARATOR|SWT.HORIZONTAL |
1 | 2 | [[#616de340]] | SWT.NONE |
2 | 1 | [[#616dfb20]] | verticalIndent |
2 | 2 | [[#616dfb20]] | heightHint |