1 11 package org.eclipse.compare.internal; 12 13 import org.eclipse.core.runtime.CoreException; 14 import org.eclipse.core.runtime.IConfigurationElement; 15 16 import org.eclipse.compare.structuremergeviewer.IStructureCreator; 17 18 21 public class StructureCreatorDescriptor { 22 23 private final static String CLASS_ATTRIBUTE= "class"; private final static String EXTENSIONS_ATTRIBUTE= "extensions"; 26 private IConfigurationElement fElement; 27 28 31 public StructureCreatorDescriptor(IConfigurationElement element) { 32 fElement= element; 33 } 34 35 38 public IStructureCreator createStructureCreator() { 39 try { 40 return (IStructureCreator)fElement.createExecutableExtension(CLASS_ATTRIBUTE); 41 } catch (CoreException ex) { 42 CompareUIPlugin.log(ex.getStatus()); 43 return null; 45 } catch (ClassCastException ex) { 46 return null; 48 } 49 } 50 51 54 public String getExtension() { 55 return fElement.getAttribute(EXTENSIONS_ATTRIBUTE); 56 } 57 } 58 | Popular Tags |