use of org.eclipse.mylyn.context.core.AbstractContextStructureBridge in project mylyn.docs by eclipse.
the class WikiTextContextUiBridge method open.
@Override
public void open(IInteractionElement element) {
AbstractContextStructureBridge structureBridge = ContextCore.getStructureBridge(WikiTextContextStructureBridge.CONTENT_TYPE);
if (structureBridge instanceof WikiTextContextStructureBridge) {
Object object = structureBridge.getObjectForHandle(element.getHandleIdentifier());
OutlineItem item = null;
if (object instanceof OutlineItem) {
item = (OutlineItem) object;
object = ((WikiTextContextStructureBridge) structureBridge).getFile(item);
}
if (object instanceof IFile) {
FileEditorInput editorInput = new FileEditorInput((IFile) object);
try {
IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(editorInput, // $NON-NLS-1$
"org.eclipse.mylyn.wikitext.ui.editor.markupEditor");
if (item != null && editor instanceof IShowInTarget) {
((IShowInTarget) editor).show(new ShowInContext(editorInput, new StructuredSelection(item)));
}
} catch (PartInitException e) {
WikiTextContextUiPlugin.getDefault().log(e);
}
}
}
}
Aggregations