KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > elements > adapters > VariableColumnFactoryAdapter


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

11 package org.eclipse.debug.internal.ui.elements.adapters;
12
13 import org.eclipse.debug.core.model.IStackFrame;
14 import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentation;
15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory;
16 import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
17 import org.eclipse.debug.ui.IDebugUIConstants;
18
19 /**
20  * Factory for default variable column presentation.
21  *
22  * @since 3.2
23  */

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

29     public IColumnPresentation createColumnPresentation(IPresentationContext context, Object JavaDoc element) {
30         String JavaDoc id = context.getId();
31         if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(id) || IDebugUIConstants.ID_REGISTER_VIEW.equals(id)) {
32             if (element instanceof IStackFrame) {
33                 return new VariableColumnPresentation();
34             }
35         }
36         return null;
37     }
38
39     /* (non-Javadoc)
40      * @see org.eclipse.debug.internal.ui.viewers.provisional.IColumnPresenetationFactoryAdapter#getColumnPresentationId(org.eclipse.debug.internal.ui.viewers.provisional.IPresentationContext, java.lang.Object)
41      */

42     public String JavaDoc getColumnPresentationId(IPresentationContext context, Object JavaDoc element) {
43         String JavaDoc id = context.getId();
44         if (IDebugUIConstants.ID_VARIABLE_VIEW.equals(id) || IDebugUIConstants.ID_REGISTER_VIEW.equals(id)) {
45             if (element instanceof IStackFrame) {
46                 return VariableColumnPresentation.DEFAULT_VARIABLE_COLUMN_PRESENTATION;
47             }
48         }
49         return null;
50     }
51
52 }
53
Popular Tags