madtyn
madtyn

Reputation: 1549

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.

Upvotes: 2

Views: 1373

Answers (1)

sambi reddy
sambi reddy

Reputation: 3085

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

Upvotes: 4

Related Questions