Skip to content

Commit 0be1e88

Browse files
committed
Restrict preferences page height #251
thanks @laurentmuller Signed-off-by: Andre Bossert <[email protected]>
1 parent 06fd698 commit 0be1e88

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/CommandPage.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,11 @@ private void createTableViewer(Composite parent) {
223223
// contentProvider
224224
tableViewer.setInput(CommandDataStore.instance());
225225

226-
// Layout the viewer
227-
GridData gridData = new GridData();
228-
gridData.verticalAlignment = GridData.FILL;
226+
// Layout the table viewer
227+
GridData gridData = new GridData(GridData.FILL_BOTH);
228+
gridData.heightHint = table.getItemHeight() * 20;
229229
gridData.horizontalSpan = 2;
230-
gridData.grabExcessHorizontalSpace = true;
231-
gridData.grabExcessVerticalSpace = true;
232-
gridData.horizontalAlignment = GridData.FILL;
233-
tableViewer.getControl().setLayoutData(gridData);
230+
table.setLayoutData(gridData);
234231

235232
tableViewer.addDoubleClickListener(new IDoubleClickListener() {
236233
@Override

plugin/src/de/anbos/eclipse/easyshell/plugin/preferences/MenuPage.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,11 @@ private void createTableViewer(Composite parent) {
211211
// contentProvider
212212
tableViewer.setInput(MenuDataStore.instance());
213213

214-
// Layout the viewer
215-
GridData gridData = new GridData();
216-
gridData.verticalAlignment = GridData.FILL;
214+
// Layout the table viewer
215+
GridData gridData = new GridData(GridData.FILL_BOTH);
216+
gridData.heightHint = table.getItemHeight() * 20;
217217
gridData.horizontalSpan = 2;
218-
gridData.grabExcessHorizontalSpace = true;
219-
gridData.grabExcessVerticalSpace = true;
220-
gridData.horizontalAlignment = GridData.FILL;
221-
tableViewer.getControl().setLayoutData(gridData);
218+
table.setLayoutData(gridData);
222219

223220
tableViewer.addDoubleClickListener(new IDoubleClickListener() {
224221
@Override

0 commit comments

Comments
 (0)