Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict preferences page height #251

Closed
laurentmuller opened this issue Mar 30, 2022 · 0 comments · Fixed by #252
Closed

Restrict preferences page height #251

laurentmuller opened this issue Mar 30, 2022 · 0 comments · Fixed by #252
Assignees
Milestone

Comments

@laurentmuller
Copy link

laurentmuller commented Mar 30, 2022

Expected Behavior

The Command Preferences Page layout must be updated to set the height of, for example, 20 commands.

Actual Behavior

When open the Command Preferences Page, the dialog is resized to display all the commands.

Steps to Reproduce the Problem

Select the menu Window | Preferences....
Select the entry EasyShell | (2) Command.
The Preferences Dialog is resized to show all commands.

Environment

  • Plugin version: 2.3.0
  • Eclipse Version: 2021-12
  • Java Version: 11
  • Operating System Version: Windows 11

Resolution

This is only a matter of update the viewer layout in the CommandPage class. When creating the table viewer in function createTableViewer, set the gridData.heightHint as follow:

private void createTableViewer(Composite parent) {
    ...
    GridData gridData = new GridData();
    gridData.heightHint = table.getItemHeight() * 20;
    ...
}

You can also simplify the creation of the layout with the following code:

private void createTableViewer(Composite parent) {
    ...
    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.heightHint = table.getItemHeight() * 20;
    gridData.horizontalSpan = 2;
    table.setLayoutData(gridData);
    ...
}

This can be also apply to the MenuPage class.

@anb0s anb0s added this to the v2.3 milestone Mar 30, 2022
@anb0s anb0s self-assigned this Mar 30, 2022
anb0s added a commit that referenced this issue Mar 30, 2022
@anb0s anb0s linked a pull request Mar 30, 2022 that will close this issue
anb0s added a commit that referenced this issue Mar 30, 2022
@anb0s anb0s closed this as completed in #252 Apr 1, 2022
anb0s added a commit that referenced this issue Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants