KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > DebugWorkingCopyManager


1 /*******************************************************************************
2  * Copyright (c) 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM - Initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui;
12
13 import org.eclipse.jdt.core.ICompilationUnit;
14 import org.eclipse.jdt.internal.ui.javaeditor.WorkingCopyManager;
15 import org.eclipse.jdt.ui.JavaUI;
16 import org.eclipse.ui.IEditorInput;
17
18 /**
19  * Controls access to the java working copy. Isolated in this class as implementation requires
20  * use of internal JDT UI code. See bug 151260 for more information.
21  *
22  * @since 3.3
23  * @see org.eclipse.jdt.internal.ui.javaeditor.WorkingCopyManager
24  */

25 public class DebugWorkingCopyManager {
26     
27     /**
28      * Returns the working copy remembered for the compilation unit encoded in the
29      * given editor input.
30      *
31      * @param input the editor input
32      * @param primaryOnly if <code>true</code> only primary working copies will be returned
33      * @return the working copy of the compilation unit, or <code>null</code> if the
34      * input does not encode an editor input, or if there is no remembered working
35      * copy for this compilation unit
36      */

37     public static ICompilationUnit getWorkingCopy(IEditorInput input, boolean primaryOnly) {
38         //TODO Using JDT UI internal code here, see bug 151260 for more information
39
return ((WorkingCopyManager)JavaUI.getWorkingCopyManager()).getWorkingCopy(input, primaryOnly);
40     }
41     
42 }
43
Popular Tags