CloneSet320


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
64250.975compilation_unit
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
16412
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/ToggleOrientationAction.java
26411
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/typehierarchy/ToggleOrientationAction.java
Clone Instance
1
Line Count
64
Source Line
12
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/callhierarchy/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();
                }
    }
}




Clone Instance
2
Line Count
64
Source Line
11
Source File
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:
 *     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();
                }
        }
}




Clone AbstractionParameter Count: 5Parameter Bindings

/*******************************************************************************
 * 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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b5883fc0]]
typehierarchy 
12[[#b5883fc0]]
callhierarchy 
21[[#b5883f00]]
/**
 * Toggles the orientationof the layout of the type hierarchy
 */
public 
22[[#b5883f00]]
31[[#b5883e80]]
TypeHierarchyViewPart 
32[[#b5883e80]]
CallHierarchyViewPart 
41[[#b5883e00]]
TypeHierarchyMessages 
42[[#b5883e00]]
CallHierarchyMessages 
51[[#b5883d80]]
TOGGLE_ORIENTATION_ACTION 
52[[#b5883d80]]
CALL_HIERARCHY_TOGGLE_ORIENTATION_ACTION