开发者

How to pass the value into the view

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();
        }
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜