| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 64 | 2 | 5 | 0.975 | compilation_unit |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 64 | 12 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/ToggleOrientationAction.java |
| 2 | 64 | 11 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/ToggleOrientationAction.java |
| ||||
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Jesper Kamstrup Linnet (eclipse@kamstrup-linnet.dk) - initial API and implementation
* (report 36180: Callers/Callees view)
*******************************************************************************/
package org.eclipse.jdt.internal.ui.callhierarchy;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.PlatformUI;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
/**
* Toggles the orientationof the layout of the call hierarchy
*/
class ToggleOrientationAction extends Action {
private CallHierarchyViewPart fView;
private int fActionOrientation;
public ToggleOrientationAction(CallHierarchyViewPart v, int orientation) {
super("", AS_RADIO_BUTTON); //$NON-NLS-1$
if (orientation == CallHierarchyViewPart.VIEW_ORIENTATION_HORIZONTAL) {
setText(CallHierarchyMessages.ToggleOrientationAction_horizontal_label);
setDescription(CallHierarchyMessages.ToggleOrientationAction_horizontal_description);
setToolTipText(CallHierarchyMessages.ToggleOrientationAction_horizontal_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_horizontal.gif"); //$NON-NLS-1$
}
else if (orientation == CallHierarchyViewPart.VIEW_ORIENTATION_VERTICAL) {
setText(CallHierarchyMessages.ToggleOrientationAction_vertical_label);
setDescription(CallHierarchyMessages.ToggleOrientationAction_vertical_description);
setToolTipText(CallHierarchyMessages.ToggleOrientationAction_vertical_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_vertical.gif"); //$NON-NLS-1$
}
else if (orientation == CallHierarchyViewPart.VIEW_ORIENTATION_AUTOMATIC) {
setText(CallHierarchyMessages.ToggleOrientationAction_automatic_label);
setDescription(CallHierarchyMessages.ToggleOrientationAction_automatic_description);
setToolTipText(CallHierarchyMessages.ToggleOrientationAction_automatic_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_automatic.gif"); //$NON-NLS-1$
}
else
if (orientation == CallHierarchyViewPart.VIEW_ORIENTATION_SINGLE) {
setText(CallHierarchyMessages.ToggleOrientationAction_single_label);
setDescription(CallHierarchyMessages.ToggleOrientationAction_single_description);
setToolTipText(CallHierarchyMessages.ToggleOrientationAction_single_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_single.gif"); //$NON-NLS-1$
}
else {
Assert.isTrue(false);
}
fView = v;
fActionOrientation = orientation;
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CALL_HIERARCHY_TOGGLE_ORIENTATION_ACTION);
}
public int getOrientation() {
return fActionOrientation;
}
/*
* @see Action#actionPerformed
*/
public void run() {
if (isChecked()) {
fView.fOrientation = fActionOrientation;
fView.computeOrientation();
}
}
}
|
| ||||
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.jdt.internal.ui.typehierarchy;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.PlatformUI;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
/**
* Toggles the orientationof the layout of the type hierarchy
*/
public class ToggleOrientationAction extends Action {
private TypeHierarchyViewPart fView;
private int fActionOrientation;
public ToggleOrientationAction(TypeHierarchyViewPart v, int orientation) {
super("", AS_RADIO_BUTTON); //$NON-NLS-1$
if (orientation == TypeHierarchyViewPart.VIEW_ORIENTATION_HORIZONTAL) {
setText(TypeHierarchyMessages.ToggleOrientationAction_horizontal_label);
setDescription(TypeHierarchyMessages.ToggleOrientationAction_horizontal_description);
setToolTipText(TypeHierarchyMessages.ToggleOrientationAction_horizontal_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_horizontal.gif"); //$NON-NLS-1$
}
else if (orientation == TypeHierarchyViewPart.VIEW_ORIENTATION_VERTICAL) {
setText(TypeHierarchyMessages.ToggleOrientationAction_vertical_label);
setDescription(TypeHierarchyMessages.ToggleOrientationAction_vertical_description);
setToolTipText(TypeHierarchyMessages.ToggleOrientationAction_vertical_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_vertical.gif"); //$NON-NLS-1$
}
else
if (orientation == TypeHierarchyViewPart.VIEW_ORIENTATION_AUTOMATIC) {
setText(TypeHierarchyMessages.ToggleOrientationAction_automatic_label);
setDescription(TypeHierarchyMessages.ToggleOrientationAction_automatic_description);
setToolTipText(TypeHierarchyMessages.ToggleOrientationAction_automatic_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_automatic.gif"); //$NON-NLS-1$
}
else
if (orientation == TypeHierarchyViewPart.VIEW_ORIENTATION_SINGLE) {
setText(TypeHierarchyMessages.ToggleOrientationAction_single_label);
setDescription(TypeHierarchyMessages.ToggleOrientationAction_single_description);
setToolTipText(TypeHierarchyMessages.ToggleOrientationAction_single_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_single.gif"); //$NON-NLS-1$
}
else {
Assert.isTrue(false);
}
fView = v;
fActionOrientation = orientation;
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.TOGGLE_ORIENTATION_ACTION);
}
public int getOrientation() {
return fActionOrientation;
}
/*
* @see Action#actionPerformed
*/
public void run() {
if (isChecked()) {
fView.fOrientation = fActionOrientation;
fView.computeOrientation();
}
}
}
|
| |||
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
/*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Jesper Kamstrup Linnet (eclipse@kamstrup-linnet.dk) - initial API and implementation
* (report 36180: Callers/Callees view)
*******************************************************************************/
package org.eclipse.jdt.internal.ui. [[#variableb5883fc0]];
import org.eclipse.jface.action.Action;
import org.eclipse.jface.util.Assert;
import org.eclipse.ui.PlatformUI;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
[[#variableb5883f00]]
/**
* Toggles the orientationof the layout of the call hierarchy
*/
class ToggleOrientationAction extends Action {
private [[#variableb5883e80]] fView;
private int fActionOrientation;
public ToggleOrientationAction( [[#variableb5883e80]] v, int orientation) {
super("", AS_RADIO_BUTTON); //$NON-NLS-1$
if (orientation == [[#variableb5883e80]].VIEW_ORIENTATION_HORIZONTAL) {
setText( [[#variableb5883e00]].ToggleOrientationAction_horizontal_label);
setDescription( [[#variableb5883e00]].ToggleOrientationAction_horizontal_description);
setToolTipText( [[#variableb5883e00]].ToggleOrientationAction_horizontal_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_horizontal.gif"); //$NON-NLS-1$
}
else
if (orientation == [[#variableb5883e80]].VIEW_ORIENTATION_VERTICAL) {
setText( [[#variableb5883e00]].ToggleOrientationAction_vertical_label);
setDescription( [[#variableb5883e00]].ToggleOrientationAction_vertical_description);
setToolTipText( [[#variableb5883e00]].ToggleOrientationAction_vertical_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_vertical.gif"); //$NON-NLS-1$
}
else
if (orientation == [[#variableb5883e80]].VIEW_ORIENTATION_AUTOMATIC) {
setText( [[#variableb5883e00]].ToggleOrientationAction_automatic_label);
setDescription( [[#variableb5883e00]].ToggleOrientationAction_automatic_description);
setToolTipText( [[#variableb5883e00]].ToggleOrientationAction_automatic_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_automatic.gif"); //$NON-NLS-1$
}
else
if (orientation == [[#variableb5883e80]].VIEW_ORIENTATION_SINGLE) {
setText( [[#variableb5883e00]].ToggleOrientationAction_single_label);
setDescription( [[#variableb5883e00]].ToggleOrientationAction_single_description);
setToolTipText( [[#variableb5883e00]].ToggleOrientationAction_single_tooltip);
JavaPluginImages.setLocalImageDescriptors(this, "th_single.gif"); //$NON-NLS-1$
}
else {
Assert.isTrue(false);
}
fView = v;
fActionOrientation = orientation;
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds. [[#variableb5883d80]]);
}
public int getOrientation() {
return fActionOrientation;
}
/*
* @see Action#actionPerformed
*/
/*
* @see Action#actionPerformed
*/
public void run() {
if (isChecked()) {
fView.fOrientation = fActionOrientation;
fView.computeOrientation();
}
}
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#b5883fc0]] | typehierarchy |
| 1 | 2 | [[#b5883fc0]] | callhierarchy |
| 2 | 1 | [[#b5883f00]] | /** * Toggles the orientationof the layout of the type hierarchy */ public |
| 2 | 2 | [[#b5883f00]] | |
| 3 | 1 | [[#b5883e80]] | TypeHierarchyViewPart |
| 3 | 2 | [[#b5883e80]] | CallHierarchyViewPart |
| 4 | 1 | [[#b5883e00]] | TypeHierarchyMessages |
| 4 | 2 | [[#b5883e00]] | CallHierarchyMessages |
| 5 | 1 | [[#b5883d80]] | TOGGLE_ORIENTATION_ACTION |
| 5 | 2 | [[#b5883d80]] | CALL_HIERARCHY_TOGGLE_ORIENTATION_ACTION |