Search in sources :

Example 26 with SafeRunnable

use of org.eclipse.jface.util.SafeRunnable in project polymap4-core by Polymap4.

the class NavigatorContentServiceLabelProvider method fireLabelProviderChanged.

/**
 * Fires a label provider changed event to all registered listeners
 * Only listeners registered at the time this method is called are notified.
 *
 * @param event a label provider changed event
 *
 * @see ILabelProviderListener#labelProviderChanged
 */
protected void fireLabelProviderChanged(final LabelProviderChangedEvent event) {
    Object[] theListeners = getListeners();
    for (int i = 0; i < theListeners.length; ++i) {
        final ILabelProviderListener l = (ILabelProviderListener) theListeners[i];
        SafeRunner.run(new SafeRunnable() {

            public void run() {
                l.labelProviderChanged(event);
            }
        });
    }
}
Also used : ILabelProviderListener(org.eclipse.jface.viewers.ILabelProviderListener) SafeRunnable(org.eclipse.jface.util.SafeRunnable)

Example 27 with SafeRunnable

use of org.eclipse.jface.util.SafeRunnable in project nebula.widgets.nattable by eclipse.

the class RowPostSelectionProvider method firePostSelectionChanged.

protected void firePostSelectionChanged(final SelectionChangedEvent event) {
    Object[] listeners = this.postSelectionChangedListeners.getListeners();
    for (int i = 0; i < listeners.length; ++i) {
        final ISelectionChangedListener l = (ISelectionChangedListener) listeners[i];
        SafeRunnable.run(new SafeRunnable() {

            @Override
            public void run() {
                l.selectionChanged(event);
            }
        });
    }
}
Also used : ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SafeRunnable(org.eclipse.jface.util.SafeRunnable)

Example 28 with SafeRunnable

use of org.eclipse.jface.util.SafeRunnable in project egit by eclipse.

the class GitChangeSetLabelProvider method fireLabelProviderChanged.

private void fireLabelProviderChanged(final LabelProviderChangedEvent event) {
    for (Object o : listeners.getListeners()) {
        final ILabelProviderListener l = (ILabelProviderListener) o;
        SafeRunnable.run(new SafeRunnable() {

            @Override
            public void run() {
                l.labelProviderChanged(event);
            }
        });
    }
}
Also used : ILabelProviderListener(org.eclipse.jface.viewers.ILabelProviderListener) SafeRunnable(org.eclipse.jface.util.SafeRunnable)

Example 29 with SafeRunnable

use of org.eclipse.jface.util.SafeRunnable in project egit by eclipse.

the class CreateBranchPage method getBranchNameSuggestionFromProvider.

private String getBranchNameSuggestionFromProvider() {
    final AtomicReference<String> ref = new AtomicReference<>();
    final IBranchNameProvider branchNameProvider = getBranchNameProvider();
    if (branchNameProvider != null)
        SafeRunner.run(new SafeRunnable() {

            @Override
            public void run() throws Exception {
                ref.set(branchNameProvider.getBranchNameSuggestion());
            }
        });
    return ref.get();
}
Also used : SafeRunnable(org.eclipse.jface.util.SafeRunnable) IBranchNameProvider(org.eclipse.egit.ui.IBranchNameProvider) AtomicReference(java.util.concurrent.atomic.AtomicReference)

Example 30 with SafeRunnable

use of org.eclipse.jface.util.SafeRunnable in project archi by archimatetool.

the class LocalClipboard method fireClipboardChanged.

private void fireClipboardChanged(Object contents) {
    for (Object element : getListeners()) {
        final ILocalClipboardListener l = (ILocalClipboardListener) element;
        SafeRunner.run(new SafeRunnable() {

            @Override
            public void run() {
                l.clipBoardChanged(contents);
            }
        });
    }
}
Also used : SafeRunnable(org.eclipse.jface.util.SafeRunnable)

Aggregations

SafeRunnable (org.eclipse.jface.util.SafeRunnable)31 ISafeRunnable (org.eclipse.core.runtime.ISafeRunnable)6 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)5 Point (org.eclipse.swt.graphics.Point)5 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)4 ICheckStateListener (org.eclipse.jface.viewers.ICheckStateListener)3 ILabelProviderListener (org.eclipse.jface.viewers.ILabelProviderListener)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)3 DropTargetEvent (org.eclipse.swt.dnd.DropTargetEvent)3 Rectangle (org.eclipse.swt.graphics.Rectangle)3 Control (org.eclipse.swt.widgets.Control)3 TableItem (org.eclipse.swt.widgets.TableItem)3 TreeItem (org.eclipse.swt.widgets.TreeItem)3 IHyperlinkDetector (org.eclipse.jface.text.hyperlink.IHyperlinkDetector)2 LocalSelectionTransfer (org.eclipse.jface.util.LocalSelectionTransfer)2 TransferDropTargetListener (org.eclipse.jface.util.TransferDropTargetListener)2 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)2 Transfer (org.eclipse.swt.dnd.Transfer)2 DragNodeCommand (org.eclipse.wst.xml.ui.internal.dnd.DragNodeCommand)2