代码之家  ›  专栏  ›  技术社区  ›  schmimona

禁用RCP应用程序中视图的关闭功能

  •  -1
  • schmimona  · 技术社区  · 7 年前

    我有一个不同视角的RCP应用程序。在一个透视图中,定义了几个视图:

        p_layout.addStandaloneView(View1.ID, true, IPageLayout.LEFT, lf_ratioView1, p_layout.getEditorArea());
        p_layout.addStandaloneView(MyView.ID, false, IPageLayout.TOP, lf_ratioMyView, View1.ID);
        final IFolderLayout lf_detailsFolder = p_layout.createFolder("Details", IPageLayout.RIGHT, lf_ratioDetailsView, View1.ID);
        lf_detailsFolder.addPlaceholder(DetailsView.ID);
        lf_detailsFolder.addPlaceholder(View2.ID);
        lf_detailsFolder.addPlaceholder(View3.ID + ":*");
        lf_detailsFolder.addView(View4.ID);
        p_layout.addStandaloneView(View 5.ID, true, IPageLayout.BOTTOM, lf_ratioView5, "Details");
        p_layout.addStandaloneView(View6.ID, false, IPageLayout.BOTTOM, lf_ratioView6, View5.ID);
    

    按不同的按钮可以关闭和打开这些视图。

    我想禁用FolderLayout中视图的关闭选项:DetailsView、View2、View3和View 4,以便用户只能使用这些按钮关闭它们。

        p_layout.getViewLayout(DetailsView.ID).setCloseable(false);
        p_layout.getViewLayout(View2.ID).setCloseable(false);
        p_layout.getViewLayout(View3.ID).setCloseable(false);
        p_layout.getViewLayout(View24.ID).setCloseable(false);
    

    RCP应用程序是从Eclipse Mars构建的。

    1 回复  |  直到 7 年前
        1
  •  0
  •   schmimona    7 年前

    显然是这个方法 setCloseable(false) 对于每个我不想关闭的视图,都是正确的答案。