0

我是 RCP 的新手,也许这个问题很基本,但是:从两个视图的角度来看,如何在应用程序开始时只显示其中一个?

4

1 回答 1

1

试试这个

    public class Perspective implements IPerspectiveFactory {

        /** Top folder's id. */
        public static final String FI_TOP = Bootstrap.PLUGIN_ID + ".topFolder";
        /** Top folder's id. */
        public static final String FI_BOTTOM = Bootstrap.PLUGIN_ID+ ".bottomFolder";

        float ratioTop = 0.35f;
        float ratioBottom = 0.60f;

        private IPageLayout layout;

        public void createInitialLayout(IPageLayout layout) {
            this.layout = layout;

            String editorAreaId = layout.getEditorArea();
            layout.setEditorAreaVisible(false);

            layout.createPlaceholderFolder(FI_TOP, IPageLayout.TOP, ratioTop, editorAreaId);
            layout.createPlaceholderFolder(FI_BOTTOM, IPageLayout.BOTTOM, ratioBottom, editorAreaId);

            //Opnen a view
            layout.addView("MyViewId", IPageLayout.TOP, 0.9f, layout.getEditorArea());

        }

        public IPageLayout getLayout() {
            return layout;
        }
于 2012-04-19T13:37:03.810 回答