1 11 package org.eclipse.core.runtime.content; 12 13 import java.util.EventObject ; 14 import org.eclipse.core.runtime.preferences.IScopeContext; 15 16 27 public interface IContentTypeManager extends IContentTypeMatcher { 28 29 37 public final class ContentTypeChangeEvent extends EventObject { 38 41 private static final long serialVersionUID = 1L; 42 47 private IScopeContext context; 48 49 54 public ContentTypeChangeEvent(IContentType source) { 55 super(source); 56 } 57 58 65 public ContentTypeChangeEvent(IContentType source, IScopeContext context) { 66 super(source); 67 this.context = context; 68 } 69 70 75 public IContentType getContentType() { 76 return (IContentType) source; 77 } 78 79 87 public IScopeContext getContext() { 88 return context; 89 } 90 } 91 92 106 public interface IContentTypeChangeListener { 107 108 115 public void contentTypeChanged(ContentTypeChangeEvent event); 116 } 117 118 128 public interface ISelectionPolicy { 129 148 IContentType[] select(IContentType[] candidates, boolean fileName, boolean content); 149 } 150 151 165 public final static String CT_TEXT = "org.eclipse.core.runtime.text"; 167 176 public void addContentTypeChangeListener(IContentTypeChangeListener listener); 177 178 186 public IContentType[] getAllContentTypes(); 187 188 195 public IContentType getContentType(String contentTypeIdentifier); 196 197 207 public IContentTypeMatcher getMatcher(ISelectionPolicy customPolicy, IScopeContext context); 208 209 218 public void removeContentTypeChangeListener(IContentTypeChangeListener listener); 219 } 220 | Popular Tags |