KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > variables > JavaVariableColumnEditorFactory


1 /*******************************************************************************
2  * Copyright (c) 2006 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 Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.debug.ui.variables;
12
13 import org.eclipse.debug.internal.ui.viewers.provisional.IColumnEditor;
14 import org.eclipse.debug.internal.ui.viewers.provisional.IColumnEditorFactoryAdapter;
15 import org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext;
16 import org.eclipse.debug.ui.IDebugUIConstants;
17 import org.eclipse.jdt.debug.core.IJavaVariable;
18 import org.eclipse.ui.IWorkbenchPart;
19
20 /**
21  * @since 3.2
22  *
23  */

24 public class JavaVariableColumnEditorFactory implements
25         IColumnEditorFactoryAdapter {
26
27     /* (non-Javadoc)
28      * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnEditorFactoryAdapter#createColumnEditor(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
29      */

30     public IColumnEditor createColumnEditor(IPresentationContext context, Object JavaDoc element) {
31         IWorkbenchPart part = context.getPart();
32         if (part != null) {
33             if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(part.getSite().getId())) {
34                 if (element instanceof IJavaVariable) {
35                     return new JavaVariableColumnEditor();
36                 }
37             }
38         }
39         return null;
40     }
41
42     /* (non-Javadoc)
43      * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnEditorFactoryAdapter#getColumnEditorId(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
44      */

45     public String JavaDoc getColumnEditorId(IPresentationContext context, Object JavaDoc element) {
46         IWorkbenchPart part = context.getPart();
47         if (part != null) {
48             if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(part.getSite().getId())) {
49                 if (element instanceof IJavaVariable) {
50                     return JavaVariableColumnEditor.JAVA_VARIABLE_COLUMN_EDITOR;
51                 }
52             }
53         }
54         return null;
55     }
56
57 }
58
Popular Tags