CloneSet667


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
57250.989compilation_unit
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
15711
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenJavaBrowsingPerspectiveAction.java
25711
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenJavaPerspectiveAction.java
Clone Instance
1
Line Count
57
Source Line
11
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenJavaBrowsingPerspectiveAction.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.ui.actions;

import org.eclipse.jface.action.Action;

import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;

import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.PlatformUI;

import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.ActionMessages;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;

import org.eclipse.jdt.ui.JavaUI;

/**
 * Action to programmatically open a Java perspective.
 * 
 * <p>
 * This class may be instantiated; it is not intended to be subclassed.
 * </p>
 * 
 * @since 2.0
 */
public class OpenJavaBrowsingPerspectiveAction extends Action {

        /**
         * Create a new <code>OpenJavaBrowsingPerspectiveAction</code>.
         */
        public OpenJavaBrowsingPerspectiveAction() {
                PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.OPEN_JAVA_BROWSING_PERSPECTIVE_ACTION);
        }

        public void run() {
                IWorkbench workbench = JavaPlugin.getDefault().getWorkbench();
                IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
                IWorkbenchPage page = window.getActivePage();
                IAdaptable input;
                if (page != null)
                        input = page.getInput();
                else
                        input = ResourcesPlugin.getWorkspace().getRoot();
                try {
                        workbench.showPerspective(JavaUI.ID_BROWSING_PERSPECTIVE, window, input);
                } catch (WorkbenchException e) {
                        ExceptionHandler.handle(e, window.getShell(), 
                                ActionMessages.OpenJavaBrowsingPerspectiveAction_dialog_title, 
                                ActionMessages.OpenJavaBrowsingPerspectiveAction_error_open_failed);
                  }
        }
}




Clone Instance
2
Line Count
57
Source Line
11
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenJavaPerspectiveAction.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.ui.actions;

import org.eclipse.jface.action.Action;

import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;

import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.PlatformUI;

import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.ActionMessages;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;

import org.eclipse.jdt.ui.JavaUI;

/**
 * Action to programmatically open a Java perspective.
 * 
 * <p>
 * This class may be instantiated; it is not intended to be subclassed.
 * </p>
 * 
 * @since 2.0
 */
public class OpenJavaPerspectiveAction extends Action {

        /**
         * Create a new <code>OpenJavaPerspectiveAction</code>.
         */
        public OpenJavaPerspectiveAction() {
                PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.OPEN_JAVA_PERSPECTIVE_ACTION);
        }

        public void run() {
                IWorkbench workbench = JavaPlugin.getDefault().getWorkbench();
                IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
                IWorkbenchPage page = window.getActivePage();
                IAdaptable input;
                if (page != null)
                        input = page.getInput();
                else
                        input = ResourcesPlugin.getWorkspace().getRoot();
                try {
                        workbench.showPerspective(JavaUI.ID_PERSPECTIVE, window, input);
                } catch (WorkbenchException e) {
                        ExceptionHandler.handle(e, window.getShell(), 
                                ActionMessages.OpenJavaPerspectiveAction_dialog_title, 
                                ActionMessages.OpenJavaPerspectiveAction_error_open_failed);
                  }
        }
}




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
 *******************************************************************************/
package org.eclipse.jdt.ui.actions;

import org.eclipse.jface.action.Action;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.actions.ActionMessages;
import org.eclipse.jdt.internal.ui.util.ExceptionHandler;
import org.eclipse.jdt.ui.JavaUI;

/**
 * Action to programmatically open a Java perspective.
 * 
 * <p>
 * This class may be instantiated; it is not intended to be subclassed.
 * </p>
 * 
 * @since 2.0
 */
public class [[#variablec1548440]]extends Action {
  /**
           * Create a new <code>OpenJavaBrowsingPerspectiveAction</code>.
           */
  /**
           * Create a new <code>OpenJavaPerspectiveAction</code>.
           */
  public [[#variablec1548440]]() {
    PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds. [[#variablec15483e0]]);
  }

  public void run() {
    IWorkbench workbench = JavaPlugin.getDefault().getWorkbench();
    IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
    IWorkbenchPage page = window.getActivePage();
    IAdaptable input;
    if (page != null)
      input = page.getInput();
    else
      input = ResourcesPlugin.getWorkspace().getRoot();
    try {
      workbench.showPerspective(JavaUI. [[#variablec1548380]], window, input);
    }
    catch (WorkbenchException e) {
      ExceptionHandler.handle(e, window.getShell(), ActionMessages. [[#variablec15482e0]], ActionMessages. [[#variablec1548060]]);
    }
  }
}


 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#c1548440]]
OpenJavaBrowsingPerspectiveAction 
12[[#c1548440]]
OpenJavaPerspectiveAction 
21[[#c15483e0]]
OPEN_JAVA_BROWSING_PERSPECTIVE_ACTION 
22[[#c15483e0]]
OPEN_JAVA_PERSPECTIVE_ACTION 
31[[#c1548380]]
ID_BROWSING_PERSPECTIVE 
32[[#c1548380]]
ID_PERSPECTIVE 
41[[#c15482e0]]
OpenJavaBrowsingPerspectiveAction_dialog_title 
42[[#c15482e0]]
OpenJavaPerspectiveAction_dialog_title 
51[[#c1548060]]
OpenJavaBrowsingPerspectiveAction_error_open_failed 
52[[#c1548060]]
OpenJavaPerspectiveAction_error_open_failed