1 11 package org.eclipse.debug.internal.core; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IConfigurationElement; 15 import org.eclipse.core.runtime.IStatus; 16 import org.eclipse.core.runtime.Status; 17 import org.eclipse.debug.core.DebugPlugin; 18 import org.eclipse.debug.core.ILogicalStructureProvider; 19 import org.eclipse.debug.core.ILogicalStructureType; 20 import org.eclipse.debug.core.model.IValue; 21 22 25 public class LogicalStructureProvider { 26 27 private IConfigurationElement fConfigurationElement; 28 29 private String fModelIdentifier; 30 31 private ILogicalStructureProvider fDelegate; 32 33 public LogicalStructureProvider(IConfigurationElement element) throws CoreException { 34 fConfigurationElement= element; 35 fModelIdentifier= fConfigurationElement.getAttribute("modelIdentifier"); if (fModelIdentifier == null) { 37 throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, DebugCoreMessages.LogicalStructureProvider_0, null)); 38 } 39 String className= fConfigurationElement.getAttribute("class"); if (className == null) { 41 throw new CoreException(new Status(IStatus.ERROR, DebugPlugin.getUniqueIdentifier(), DebugPlugin.INTERNAL_ERROR, DebugCoreMessages.LogicalStructureProvider_1, null)); 42 } 43 } 44 45 52 public ILogicalStructureType[] getLogicalStructures(IValue value) { 53 if (fModelIdentifier.equals(value.getModelIdentifier())) { 54 return getDelegate().getLogicalStructureTypes(value); 55 } 56 return new ILogicalStructureType[0]; 57 } 58 59 62 protected ILogicalStructureProvider getDelegate() { 63 if (fDelegate == null) { 64 try { 65 fDelegate = (ILogicalStructureProvider) fConfigurationElement.createExecutableExtension("class"); } catch (CoreException e) { 67 DebugPlugin.log(e); 68 } 69 } 70 return fDelegate; 71 } 72 73 } 74 | Popular Tags |