use of org.eclipse.linuxtools.internal.rpm.ui.editor.SpecfileEditor in project linuxtools by eclipse.
the class SpecOutlinePageAdapterFactory method getAdapter.
@SuppressWarnings("unchecked")
@Override
public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) {
if (IContentOutlinePage.class.equals(adapterType)) {
if (adaptableObject instanceof ExtensionBasedTextEditor || adaptableObject instanceof SpecfileEditor) {
ITextEditor specEditor = (ITextEditor) adaptableObject;
IFile editorFile = specEditor.getEditorInput().getAdapter(IFile.class);
if (editorFile.getLocation().toOSString().endsWith(".spec")) {
// $NON-NLS-1$
SpecfileContentOutlinePage page = new SpecfileContentOutlinePage(specEditor);
page.setInput(specEditor.getEditorInput());
return (T) page;
}
}
}
return null;
}
Aggregations