Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
57 | 2 | 5 | 0.989 | compilation_unit |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 57 | 11 | plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/OpenJavaBrowsingPerspectiveAction.java |
2 | 57 | 11 | 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 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); } } } |
| ||||
/******************************************************************************* * 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); } } } |
| |||
/******************************************************************************* * 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 Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#c1548440]] | OpenJavaBrowsingPerspectiveAction |
1 | 2 | [[#c1548440]] | OpenJavaPerspectiveAction |
2 | 1 | [[#c15483e0]] | OPEN_JAVA_BROWSING_PERSPECTIVE_ACTION |
2 | 2 | [[#c15483e0]] | OPEN_JAVA_PERSPECTIVE_ACTION |
3 | 1 | [[#c1548380]] | ID_BROWSING_PERSPECTIVE |
3 | 2 | [[#c1548380]] | ID_PERSPECTIVE |
4 | 1 | [[#c15482e0]] | OpenJavaBrowsingPerspectiveAction_dialog_title |
4 | 2 | [[#c15482e0]] | OpenJavaPerspectiveAction_dialog_title |
5 | 1 | [[#c1548060]] | OpenJavaBrowsingPerspectiveAction_error_open_failed |
5 | 2 | [[#c1548060]] | OpenJavaPerspectiveAction_error_open_failed |