Point location = GUIResource.calculateControlPosition( control ); final Shell shell = new Shell( control.getShell(), SWT.NONE ); shell.setSize( bounds.width > 300 ? bounds.width : 300, 200 ); shell.setLocation( location.x, location.y + bounds.height );
@Override public Shell getShell() { if (targetControl instanceof Shell) { return (Shell)targetControl; } return targetControl == null? null :targetControl.getShell(); }
int traversalCode (int key, GdkEventKey event) { int code = SWT.TRAVERSE_RETURN | SWT.TRAVERSE_TAB_NEXT | SWT.TRAVERSE_TAB_PREVIOUS | SWT.TRAVERSE_PAGE_NEXT | SWT.TRAVERSE_PAGE_PREVIOUS; Shell shell = getShell (); if (shell.parent != null) code |= SWT.TRAVERSE_ESCAPE; return code; }
private Shell getShell() { if (fSWTWidget != null) { return fSWTWidget.getShell(); } return JavaPlugin.getActiveWorkbenchShell(); }
private Shell getShell() { if (fSWTWidget != null) { return fSWTWidget.getShell(); } return JavaPlugin.getActiveWorkbenchShell(); }
private Shell getShell() { if (fControl != null) { return fControl.getShell(); } return JavaPlugin.getActiveWorkbenchShell(); }
private Shell getShell() { if (fControl != null) { return fControl.getShell(); } return JavaPlugin.getActiveWorkbenchShell(); }
public static Point getLocationRelativeToShell(Control control) { Point controlLocation = control.toDisplay(0, 0); Point shellLocation = control.getShell().getLocation(); return new Point(controlLocation.x - shellLocation.x, controlLocation.y - shellLocation.y); }
/** * @deprecated As of SWT 4.6 (Neon), this functionality is {@link Control#requestLayout()}. */ @Deprecated public static void requestLayout(Control control) { if (control instanceof Shell) { ((Shell) control).layout(null, SWT.DEFER); } else { control.getShell().layout(new Control[]{control}, SWT.DEFER); } }
/** * Returns the shell used to realize this action's dialog (if any). */ protected Shell getShell() { if (fShell == null) { fShell = getViewer().getControl().getShell(); } return fShell; }
private void reportException(Exception e) { Shell shell = getControl().getShell(); WorkbenchPlugin.log(e.getMessage(), e); MessageDialog.open(MessageDialog.ERROR, shell, "", e.getLocalizedMessage(), SWT.SHEET); //$NON-NLS-1$ } }
public void handleEvent(Event event) { if (shellDefaultButton != null) { Shell shell = searchWordCombo.getControl().getShell(); shell.setDefaultButton(shellDefaultButton); shellDefaultButton = null; } } });
private void endOfDocumentReached(boolean down) { Control c= getControl(); if (Utilities.okToUse(c)) { handleEndOfDocumentReached(c.getShell(), down); } }
private Shell getShell() { if (fSWTControl != null) { return fSWTControl.getShell(); } return AspectJUIPlugin.getDefault().getActiveWorkbenchWindow().getShell(); }
private Shell getShell() { if (fSWTControl != null) { return fSWTControl.getShell(); } return AspectJUIPlugin.getDefault().getActiveWorkbenchWindow().getShell(); }
private void showHoverText(String text, Control hoverNear) { if (text == null) { hideHover(); return; } if (hover == null) { hover = new Hover(hoverNear.getShell()); } hover.setText(text, hoverNear, control); hover.setVisible(true); }
@Override protected Object openDialogBox(Control cellEditorWindow) { ColorDialog dialog = new ColorDialog(cellEditorWindow.getShell()); Object value = getValue(); if (value != null) { dialog.setRGB((RGB) value); } value = dialog.open(); return dialog.getRGB(); }
private Shell toolTipCreate(final Event event) { if (shouldCreateToolTip(event)) { Shell shell = new Shell(control.getShell(), SWT.ON_TOP | SWT.TOOL | SWT.NO_FOCUS); shell.setLayout(new FillLayout()); toolTipOpen(shell, event); return shell; } return null; }
public void changeControlPressed(DialogField field1) { Shell shell = field1.getLabelControl(null, null).getShell(); DialogFieldWrapper wrapper = (DialogFieldWrapper) field1; String result = _handler .handleBinding(shell, wrapper.getAncester(), wrapper .getElement(), wrapper.getText()); if (result != null) { wrapper.setText(result); } } });
void cancelOperation(long /*int*/ id, long /*int*/ sel, long /*int*/ sender) { // Cmd-. and escape arrive here. Forward the current event as a key event. if (hasKeyboardFocus(id)) { NSEvent nsEvent = NSApplication.sharedApplication().currentEvent(); Shell s = this.getShell(); s.keyInputHappened = false; boolean [] consume = new boolean [1]; if (translateTraversal (nsEvent.keyCode (), nsEvent, consume)) return; if (isDisposed ()) return; if (!sendKeyEvent (nsEvent, SWT.KeyDown)) return; } }