1 11 package org.eclipse.core.internal.filebuffers; 12 13 import org.osgi.framework.Bundle; 14 15 import org.eclipse.core.runtime.Assert; 16 import org.eclipse.core.runtime.Platform; 17 import org.eclipse.core.runtime.Plugin; 18 19 import org.eclipse.core.filebuffers.ITextFileBufferManager; 20 21 22 23 28 public class FileBuffersPlugin extends Plugin { 29 30 public final static String PLUGIN_ID= "org.eclipse.core.filebuffers"; 32 33 private static FileBuffersPlugin fgPlugin; 34 35 private ITextFileBufferManager fTextFileBufferManager; 36 37 40 public FileBuffersPlugin() { 41 Assert.isTrue(fgPlugin == null); 42 fgPlugin= this; 43 } 44 45 50 public static FileBuffersPlugin getDefault() { 51 return fgPlugin; 52 } 53 54 59 public synchronized ITextFileBufferManager getFileBufferManager() { 60 if (fTextFileBufferManager == null) { 61 Bundle resourcesBundle= Platform.getBundle("org.eclipse.core.resources"); if (resourcesBundle != null) 63 fTextFileBufferManager= new ResourceTextFileBufferManager(); 64 else 65 fTextFileBufferManager= new TextFileBufferManager(); 66 } 67 return fTextFileBufferManager; 68 } 69 } 70 | Popular Tags |