开发者

How to pass the value into the view

开发者 https://www.devze.com 2023-04-06 11:11 出处:网络
I writed a plugin that start from the file, I want to开发者_开发技巧 pass the file context into a 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

精彩评论

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