I writed a plugin that start from the file, I want to开发者_开发技巧 pass the file context into a view, Anybody can tell me how to pass the context into the view?
Normally you pass the objects between editors using 'EditorInput'. Create a POJO class extending EditorInput and then pass it as a parameter when you opening a new editor:
protected void openSingleObjectEditor(final IEditorInput input,final String editorID){
IWorkbenchPage page;
page = PlatformUI.getWorkbench().getActiveWorkbenchWindow()
.getActivePage();
try {
page.openEditor(input, editorID);
} catch (PartInitException e) {
e.printStackTrace();
}
}
精彩评论