IAdaptable selectedAdaptable = getSelectedAdaptable();
if (selectedAdaptable == null) {
return;
}
OpenWithMenu openWithMenu = new OpenWithMenu(activePage, selectedAdaptable) {
@SuppressWarnings("synthetic-access")
protected void openEditor(IEditorDescriptor editorDescriptor, boolean openUsingDescriptor) {
computeResult();
setResult(Collections.EMPTY_LIST);
close();
super.openEditor(editorDescriptor, openUsingDescriptor);
}
};
Menu menu = new Menu(openComposite.getParent());
Control c = openComposite;
Point p = c.getLocation();
p.y = p.y + c.getSize().y;
p = c.getParent().toDisplay(p);
menu.setLocation(p);
openWithMenu.fill(menu, -1);
menu.setVisible(true);
}