1 11 package org.eclipse.ui.internal.ide.model; 12 13 import org.eclipse.core.resources.IFile; 14 import org.eclipse.core.resources.IFolder; 15 import org.eclipse.core.resources.IMarker; 16 import org.eclipse.core.resources.IProject; 17 import org.eclipse.core.resources.IWorkspace; 18 import org.eclipse.core.resources.IWorkspaceRoot; 19 import org.eclipse.core.runtime.IAdapterFactory; 20 import org.eclipse.core.runtime.IAdapterManager; 21 import org.eclipse.core.runtime.Platform; 22 23 27 public final class WorkbenchAdapterBuilder { 28 31 public static void registerAdapters() { 32 IAdapterManager manager = Platform.getAdapterManager(); 33 IAdapterFactory factory = new WorkbenchAdapterFactory(); 34 manager.registerAdapters(factory, IWorkspace.class); 35 manager.registerAdapters(factory, IWorkspaceRoot.class); 36 manager.registerAdapters(factory, IProject.class); 37 manager.registerAdapters(factory, IFolder.class); 38 manager.registerAdapters(factory, IFile.class); 39 manager.registerAdapters(factory, IMarker.class); 40 41 IAdapterFactory paFactory = new StandardPropertiesAdapterFactory(); 43 manager.registerAdapters(paFactory, IWorkspace.class); 44 manager.registerAdapters(paFactory, IWorkspaceRoot.class); 45 manager.registerAdapters(paFactory, IProject.class); 46 manager.registerAdapters(paFactory, IFolder.class); 47 manager.registerAdapters(paFactory, IFile.class); 48 manager.registerAdapters(paFactory, IMarker.class); 49 } 50 } 51 | Popular Tags |