1 11 package org.eclipse.jdt.internal.debug.ui.contentassist; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.jdt.core.IType; 15 16 22 public class DynamicTypeContext extends TypeContext { 23 24 28 public interface ITypeProvider { 29 36 public IType getType() throws CoreException; 37 } 38 39 private ITypeProvider fTypeProvider; 40 41 46 public DynamicTypeContext(ITypeProvider type) { 47 super(null, -1); 48 fTypeProvider = type; 49 } 50 51 54 public IType getType() throws CoreException { 55 IType type = fTypeProvider.getType(); 56 if (type == null) { 57 return super.getType(); 58 } 59 return type; 60 } 61 62 } 63 | Popular Tags |