简体   繁体   中英

Is possible to define a minimum size for a ViewPart or Workbench in Eclipse-RCP?

I have an Eclipse Application with a ViewPart that can't be resized under some width and height.

Is it possible to limit the resizing so that the whole workbench can't get smaller than the Point value that I want to set?

This requirement is because of the images inside the ViewPart , which can't be hidden.

Now I have the DIALOG_TRIM option on the whole workbench so it can't be resized, but I've been asked for maximizing the app, so the minimum size is the problem.

I haven't found in stackoverflow.com anything about doing this.

Thank you in advance.

You just need to set minimum size on main Shell

ApplicationWorkbenchWindowAdvisor

    @Override
    public void postWindowCreate() {
        super.postWindowCreate();
       final Shell shell = getWindowConfigurer().getWindow().getShell();
       shell.setMinimumSize(700, 800);
    }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM