1 11 package org.eclipse.ui.internal.registry; 12 13 import org.eclipse.core.runtime.IExtension; 14 import org.eclipse.core.runtime.dynamichelpers.ExtensionTracker; 15 import org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler; 16 import org.eclipse.swt.widgets.Display; 17 import org.eclipse.ui.internal.WorkbenchPlugin; 18 19 22 public class UIExtensionTracker extends ExtensionTracker { 23 private Display display; 24 25 34 37 public UIExtensionTracker(Display display) { 38 this.display = display; 39 } 40 41 protected void applyRemove(final IExtensionChangeHandler handler, final IExtension removedExtension, final Object [] objects) { 42 display.syncExec(new Runnable () { 43 44 public void run() { 45 try { 46 handler.removeExtension(removedExtension, objects); 47 } catch (Exception e) { 48 WorkbenchPlugin.log(getClass(), "doRemove", e); } 50 } 51 }); 52 } 53 54 protected void applyAdd(final IExtensionChangeHandler handler, final IExtension addedExtension) { 55 display.syncExec(new Runnable () { 56 public void run() { 57 try { 58 handler.addExtension(UIExtensionTracker.this, addedExtension); 59 } catch (Exception e) { 60 WorkbenchPlugin.log(getClass(), "doAdd", e); } 62 } 63 }); 64 } 65 } 66 | Popular Tags |