private void showStandaloneViewMenu( ExecutionEvent event, MPart model, MMenu menuModel, Composite partContainer) { Shell shell = partContainer.getShell(); Menu menu = (Menu) menuModel.getWidget(); if (menu == null) { IPresentationEngine engine = (IPresentationEngine) HandlerUtil.getVariable(event, IPresentationEngine.class.getName()); menu = (Menu) engine.createGui(menuModel, shell, model.getContext()); if (menu != null) { final Menu tmpMenu = menu; partContainer.addDisposeListener( new DisposeListener() { public void widgetDisposed(DisposeEvent e) { tmpMenu.dispose(); } }); } } Display display = menu.getDisplay(); Point location = display.map(partContainer, null, partContainer.getLocation()); Point size = partContainer.getSize(); menu.setLocation(location.x + size.x, location.y); menu.setVisible(true); while (!menu.isDisposed() && menu.isVisible()) { if (!display.readAndDispatch()) display.sleep(); } if (!(menu.getData() instanceof MenuManager)) { menu.dispose(); } }
public int getY() { return composite.getLocation().y; }
public int getX() { return composite.getLocation().x; }