private void firePageChanged(final PageChangedEvent event) { for (final IPageChangedListener l : pageChangeListeners) { SafeRunnable.run(new SafeRunnable() { @Override public void run() { l.pageChanged(event); } }); } } }
public void getToolTipText( final Item item, final int columnIndex ) { SafeRunnable.run( new SafeRunnable() { public void run() { Object element = item.getData(); ViewerColumn column = viewer.getViewerColumn( columnIndex ); CellLabelProvider labelProvider = column.getLabelProvider(); if( labelProvider != null ) { String text = labelProvider.getToolTipText( element ); ICellToolTipAdapter adapter = getAdapter( viewer ); adapter.setCellToolTipText( text ); } } } ); }
/** * Sends the lifecycle event to the page's sections. */ public void aboutToBeShown() { for (final ISection section : sections) { ISafeRunnable runnable = new SafeRunnable() { @Override public void run() throws Exception { section.aboutToBeShown(); } }; SafeRunnable.run(runnable); } }
/** * Sends the lifecycle event to the page's sections. */ public void aboutToBeHidden() { for (final ISection section : sections) { ISafeRunnable runnable = new SafeRunnable() { @Override public void run() throws Exception { section.aboutToBeHidden(); } }; SafeRunnable.run(runnable); } }
/** * Fire workbench postShutdown event. * * @since 3.2 */ void firePostShutdown() { for (final IWorkbenchListener l : workbenchListeners) { SafeRunnable.run(new SafeRunnable() { @Override public void run() { l.postShutdown(Workbench.this); } }); } }
/** * Notifies any check state listeners that the check state of an element has changed. * Only listeners registered at the time this method is called are notified. * * @param event a check state changed event * * @see ICheckStateListener#checkStateChanged */ protected void fireCheckStateChanged(final CheckStateChangedEvent event) { for (ICheckStateListener l : checkStateListeners) { SafeRunnable.run(new SafeRunnable() { @Override public void run() { l.checkStateChanged(event); } }); } }
/** * Sets page's sections input objects. * * @param part * @param selection */ public void setInput(final IWorkbenchPart part, final ISelection selection) { for (final ISection section : sections) { ISafeRunnable runnable = new SafeRunnable() { @Override public void run() throws Exception { section.setInput(part, selection); } }; SafeRunnable.run(runnable); } }
/** * Notifies all registered cell editor listeners of an apply event. Only * listeners registered at the time this method is called are notified. * * @see ICellEditorListener#applyEditorValue */ protected void fireApplyEditorValue() { for (ICellEditorListener l : listeners) { SafeRunnable.run(new SafeRunnable() { @Override public void run() { l.applyEditorValue(); } }); } }
/** * Dispose of page's sections controls. */ public void dispose() { for (final ISection section : sections) { ISafeRunnable runnable = new SafeRunnable() { @Override public void run() throws Exception { section.dispose(); } }; SafeRunnable.run(runnable); } }
/** * Notifies all registered property listeners of an enablement change. * * @param actionId * the id indicating what action's enablement has changed. */ protected void fireEnablementChanged(final String actionId) { for (IPropertyChangeListener l : propertyChangeListeners) { SafeRunnable.run(new SafeRunnable() { @Override public void run() { l.propertyChange(new PropertyChangeEvent(this, actionId, null, null)); } }); } }
/** * Notifies all registered cell editor listeners that editing has been * canceled. * * @see ICellEditorListener#cancelEditor */ protected void fireCancelEditor() { for (ICellEditorListener l : listeners) { SafeRunnable.run(new SafeRunnable() { @Override public void run() { l.cancelEditor(); } }); } }
private void firePageChanged(final PageChangedEvent event) { Object[] listeners = pageChangedListeners.getListeners(); for (int i = 0; i < listeners.length; i++) { final IPageChangedListener l = (IPageChangedListener) listeners[i]; SafeRunnable.run(new SafeRunnable() { @Override public void run() { l.pageChanged(event); } }); } }
/** * Copies attributes of the given element into the given widget. * <p> * This method is internal to the framework; subclassers should not call * this method. Calls <code>doUpdateItem(widget, element, true)</code>. * </p> * * @param widget * the widget * @param element * the element */ protected final void updateItem(Widget widget, Object element) { SafeRunnable.run(new UpdateItemSafeRunnable(widget, element, true)); }
/** * Copies attributes of the given element into the given widget. * <p> * This method is internal to the framework; subclassers should not call * this method. Calls <code>doUpdateItem(widget, element, true)</code>. * </p> * * @param widget * the widget * @param element * the element */ protected final void updateItem(Widget widget, Object element) { SafeRunnable.run(new UpdateItemSafeRunnable(widget, element, true)); }
/** * Notifies all registered cell editor listeners that editing has been * canceled. * * @see ICellEditorListener#cancelEditor */ protected void fireCancelEditor() { Object[] array = listeners.getListeners(); for (int i = 0; i < array.length; i++) { final ICellEditorListener l = (ICellEditorListener) array[i]; SafeRunnable.run(new SafeRunnable() { @Override public void run() { l.cancelEditor(); } }); } }
/** * * Refreshes the given item with the given element. Calls * <code>doUpdateItem(..., false)</code>. * <p> * This method is internal to the framework; subclassers should not call * this method. * </p> * @param widget * the widget * @param element * the element */ protected final void refreshItem(Widget widget, Object element) { SafeRunnable.run(new UpdateItemSafeRunnable(widget, element, true)); }
/** * Copies attributes of the given element into the given widget. * <p> * This method is internal to the framework; subclassers should not call * this method. Calls <code>doUpdateItem(widget, element, true)</code>. * </p> * * @param widget * the widget * @param element * the element */ protected final void updateItem(Widget widget, Object element) { SafeRunnable.run(new UpdateItemSafeRunnable(widget, element, true)); }
/** * Notifies any check state listeners that a check state changed has been received. * Only listeners registered at the time this method is called are notified. * * @param event a check state changed event * * @see ICheckStateListener#checkStateChanged */ private void fireCheckStateChanged(final CheckStateChangedEvent event) { Object[] array = checkStateListeners.getListeners(); for (int i = 0; i < array.length; i++) { final ICheckStateListener l = (ICheckStateListener) array[i]; SafeRunnable.run(new SafeRunnable() { public void run() { l.checkStateChanged(event); } }); } }
/** * * Refreshes the given item with the given element. Calls * <code>doUpdateItem(..., false)</code>. * <p> * This method is internal to the framework; subclassers should not call * this method. * </p> * @param widget * the widget * @param element * the element */ protected final void refreshItem(Widget widget, Object element) { SafeRunnable.run(new UpdateItemSafeRunnable(widget, element, true)); }
public void firePropertyChangeEvent(String name, Object oldValue, Object newValue) { final Object[] finalListeners = getListeners(); // Do we need to fire an event. if (finalListeners.length > 0 && (oldValue == null || !oldValue.equals(newValue))) { final PropertyChangeEvent pe = new PropertyChangeEvent(this, name, oldValue, newValue); for (int i = 0; i < finalListeners.length; ++i) { final IPropertyChangeListener l = (IPropertyChangeListener) finalListeners[i]; SafeRunnable.run(new SafeRunnable(JFaceResources .getString("PreferenceStore.changeError")) { //$NON-NLS-1$ public void run() { l.propertyChange(pe); } }); } } }