public CheckBoxToolTip( Control control ) { super( control, ToolTip.RECREATE, true ); image = control.getDisplay().getSystemImage( SWT.ICON_INFORMATION ); listeners = new ArrayList<CheckBoxToolTipListener>(); visible = false; display = control.getDisplay(); super.setRespectMonitorBounds( true ); super.setRespectDisplayBounds( true ); super.setHideDelay( 50000 ); super.setPopupDelay( 0 ); super.setHideOnMouseDown( false ); }
@Override public void focusLost(FocusEvent e) { Display d= fSubjectControl.getDisplay(); d.asyncExec(new Runnable() { // Without the asyncExec, mouse clicks to the workbench window are swallowed. @Override public void run() { if (fInformationControlToClose == null || !fInformationControlToClose.isFocusControl()) hideInformationControl(); } }); }
@Override public void focusLost(FocusEvent e) { if (DEBUG) System.out.println("StickyHoverManager.Closer.focusLost(): " + e); //$NON-NLS-1$ Display d= fSubjectControl.getDisplay(); d.asyncExec(new Runnable() { // Without the asyncExec, mouse clicks to the workbench window are swallowed. @Override public void run() { hideInformationControl(); } }); }
public void postSetSelection(final ISelection selection) { if (isOkToUse(fTableControl)) { Display d = fTableControl.getDisplay(); d.asyncExec(new Runnable() { public void run() { if (isOkToUse(fTableControl)) { selectElements(selection); } } }); } }
private boolean isDisplayThread() { Control ctrl= fViewer.getControl(); if (ctrl == null) return false; Display currentDisplay= Display.getCurrent(); return currentDisplay != null && currentDisplay.equals(ctrl.getDisplay()); }
private boolean isDisplayThread() { Control ctrl= fViewer.getControl(); if (ctrl == null) return false; Display currentDisplay= Display.getCurrent(); return currentDisplay != null && currentDisplay.equals(ctrl.getDisplay()); }
@Override public void run() { BusyIndicator.showWhile(fMethodsViewer.getControl().getDisplay(), new Runnable() { @Override public void run() { fMethodsViewer.sortByDefiningType(isChecked()); } }); } }
@Override public void run() { if (!control.isDisposed()) BusyIndicator.showWhile(control.getDisplay(), runnable); } });
@Override public void run() { BusyIndicator.showWhile(fMethodsViewer.getControl().getDisplay(), new Runnable() { @Override public void run() { fMethodsViewer.showInheritedMethods(isChecked()); } }); } }
public void run() { BusyIndicator.showWhile(fMethodsViewer.getControl().getDisplay(), new Runnable() { public void run() { fMethodsViewer.sortByDefiningType(isChecked()); } }); } }
public void run() { if (!ctrl.isDisposed()) { BusyIndicator.showWhile(ctrl.getDisplay(), r); } } });
/** * Return the clipboard for the receiver. * * @return Clipboard */ Clipboard getClipboard() { if (clipboard == null) { clipboard = new Clipboard(viewer.getControl().getDisplay()); } return clipboard; }
/** * Triggers a redraw in the display thread. */ private final void postRedraw() { if (isConnected() && !fControl.isDisposed()) { Display d= fControl.getDisplay(); if (d != null) { d.asyncExec(() -> redraw()); } } }
public void run() { BusyIndicator.showWhile(fPage.getViewer().getControl().getDisplay(), new Runnable() { public void run() { fPage.setSortOrder(fSortOrder); } }); }
@Override public void modelsChanged(PluginModelDelta delta) { fImports = null; final Control control = fImportViewer.getControl(); if (!control.isDisposed()) { control.getDisplay().asyncExec(() -> { if (!control.isDisposed()) fImportViewer.refresh(); }); } }
@Override public void modelsChanged(PluginModelDelta delta) { fAdditionalBundles = null; final Control control = fAdditionalTable.getControl(); if (!control.isDisposed()) { control.getDisplay().asyncExec(() -> { if (!control.isDisposed()) fAdditionalTable.refresh(); }); } }
private boolean containsFocus(Control control) { Control focusControl= control.getDisplay().getFocusControl(); if (focusControl != null) { focusControl= focusControl.getParent(); while (focusControl != fParent && focusControl != null && !(focusControl instanceof Shell)) { focusControl= focusControl.getParent(); } } return focusControl == fParent; }
private void asyncRefresh() { Control control = fTreeViewer.getControl(); if (!control.isDisposed()) { control.getDisplay().asyncExec(() -> { if (!fTreeViewer.getControl().isDisposed()) { fTreeViewer.refresh(true); initializeCheckState(); } }); } }
@Override public void pressed(SWTSkinButtonUtility buttonUtility, SWTSkinObject skinObject, int stateMask) { Control c = buttonUtility.getSkinObject().getControl(); menuDropDown.setLocation(c.getDisplay().getCursorLocation()); menuDropDown.setVisible(!menuDropDown.getVisible()); } });
private void handleImportEnvironment() { IStructuredSelection sel = fCategoryViewer.getStructuredSelection(); final ISiteFeature[] selectedFeatures = getFeaturesFromSelection(sel); BusyIndicator.showWhile(fCategoryTreePart.getControl().getDisplay(), () -> new SynchronizePropertiesAction(selectedFeatures, getModel()).run()); }