1 11 package org.eclipse.jdt.internal.debug.ui.variables; 12 13 import org.eclipse.core.runtime.IAdapterFactory; 14 import org.eclipse.debug.internal.ui.viewers.model.provisional.IColumnPresentationFactory; 15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementEditor; 16 import org.eclipse.jdt.debug.core.IJavaStackFrame; 17 import org.eclipse.jdt.debug.core.IJavaVariable; 18 19 24 public class ColumnPresentationAdapterFactory implements IAdapterFactory { 25 26 private static final IColumnPresentationFactory fgColumnPresentation = new JavaVariableColumnPresentationFactory(); 27 private static final IElementEditor fgEEJavaVariable = new JavaVariableEditor(); 28 29 32 public Object getAdapter(Object adaptableObject, Class adapterType) { 33 if (adaptableObject instanceof IJavaVariable) { 34 if (IElementEditor.class.equals(adapterType)) { 35 return fgEEJavaVariable; 36 } 37 } 38 if (adaptableObject instanceof IJavaStackFrame) { 39 if (IColumnPresentationFactory.class.equals(adapterType)) { 40 return fgColumnPresentation; 41 } 42 } 43 return null; 44 } 45 46 49 public Class [] getAdapterList() { 50 return new Class []{ 51 IColumnPresentationFactory.class, 52 IElementEditor.class}; 53 } 54 55 } 56 | Popular Tags |