private void resizeProposalSelector(boolean adjustWidth) { int width= adjustWidth ? SWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint; Point size= fProposalTable.computeSize(width, SWT.DEFAULT, true); GridData data= new GridData(GridData.FILL_BOTH); data.widthHint= adjustWidth ? Math.min(size.x, 300) : width; data.heightHint= Math.min(getTableHeightHint(fProposalTable, fProposalTable.getItemCount()), getTableHeightHint(fProposalTable, 10)); fProposalTable.setLayoutData(data); fProposalShell.layout(true); fProposalShell.pack(); if (adjustWidth) { fProposalShell.setLocation(getLocation()); } }
private void resizeProposalSelector(boolean adjustWidth) { int width= adjustWidth ? SWT.DEFAULT : ((GridData)fProposalTable.getLayoutData()).widthHint; Point size= fProposalTable.computeSize(width, SWT.DEFAULT, true); GridData data= new GridData(GridData.FILL_BOTH); data.widthHint= adjustWidth ? Math.min(size.x, 300) : width; data.heightHint= Math.min(getTableHeightHint(fProposalTable, fProposalTable.getItemCount()), getTableHeightHint(fProposalTable, 10)); fProposalTable.setLayoutData(data); fProposalShell.layout(true); fProposalShell.pack(); if (adjustWidth) { fProposalShell.setLocation(getLocation()); } }
Point newLocation= getLocation(); if ((newLocation.x < currentLocation.x && newLocation.y == currentLocation.y) || newLocation.y < currentLocation.y) fProposalShell.setLocation(newLocation);
Point newLocation= getLocation(); if ((newLocation.x < currentLocation.x && newLocation.y == currentLocation.y) || newLocation.y < currentLocation.y) fProposalShell.setLocation(newLocation);