Eclipse Platform
2.0

org.eclipse.core.runtime
Interface IAdaptable

All Known Subinterfaces:
IArchiveReference, IBreakpoint, ICategory, IContainer, IDebugElement, IDebugTarget, IDebugView, IEditorInput, IEditorPart, IExpression, IFeature, IFeatureReference, IFile, IFileEditorInput, IFileState, IFolder, IImport, IInstallHandlerEntry, ILaunch, ILaunchConfiguration, ILaunchConfigurationWorkingCopy, ILineBreakpoint, IMarker, IMemoryBlock, INonPluginEntry, IPluginEntry, IProcess, IProject, IRegister, IRegisterGroup, IResource, IResourceDelta, IResourceNavigator, IReusableEditor, ISearchResultView, ISite, IStackFrame, IStorage, IStorageEditorInput, ITextEditor, IThread, IURLEntry, IValue, IVariable, IViewPart, IWorkbenchPart, IWorkspace, IWorkspaceRoot
All Known Implementing Classes:
AbstractDebugView, AbstractTextEditor, ArchiveReference, Breakpoint, Category, CompareEditorInput, EditorPart, Feature, FeatureReference, FileEditorInput, FileSystemElement, Import, InstallHandlerEntry, Launch, LineBreakpoint, MultiEditorInput, NonPluginEntry, PlatformObject, PluginEntry, ResourceNavigator, Site, URLEntry, ViewPart, WorkbenchPart

public interface IAdaptable

An interface for an adaptable object.

Adaptable objects can be dynamically extended to provide different interfaces (or "adapters"). Adapters are created by adapter factories, which are in turn managed by type by adapter managers.

For example,
     IAdaptable a = [some adaptable];
     IFoo x = (IFoo)a.getAdapter(IFoo.class);
     if (x != null)
         [do IFoo things with x]
 

Clients may implement this interface.

See Also:
IAdapterFactory, IAdapterManager

Method Summary
 Object getAdapter(Class adapter)
          Returns an object which is an instance of the given class associated with this object.
 

Method Detail

getAdapter

public Object getAdapter(Class adapter)
Returns an object which is an instance of the given class associated with this object. Returns null if no such object can be found.

Parameters:
adapter - the adapter class to look up
Returns:
a object castable to the given class, or null if this object does not have an adapter for the given class

Eclipse Platform
2.0

Copyright (c) IBM Corp. and others 2000, 2002. All Rights Reserved.