public void show(Control control, Point displayCoordinates,
IPresentablePart currentSelection) {
int shellStyle = SWT.RESIZE | SWT.ON_TOP | SWT.NO_TRIM;
int tableStyle = SWT.V_SCROLL | SWT.H_SCROLL;
final BasicPartList editorList = new BasicPartList(control.getShell(),
shellStyle, tableStyle, site, folder);
editorList.setInput(folder);
Point size = editorList.computeSizeHint();
int x = displayCoordinates.x;
int y = displayCoordinates.y;
Monitor mon = folder.getTabFolder().getControl().getMonitor();
Rectangle bounds = mon.getClientArea();
if (x + size.x > bounds.x + bounds.width) {
x = bounds.x + bounds.width - size.x;
}
if (y + size.y > bounds.y + bounds.height) {
y = bounds.y + bounds.height - size.y;
}
editorList.setLocation(new Point(x, y));
editorList.setVisible(true);
editorList.setFocus();
editorList.getTableViewer().getTable().getShell().addListener(
SWT.Deactivate, new Listener() {
public void handleEvent(Event event) {
editorList.setVisible(false);
}
}
);
}