Пример #1
0
 /* (non-Javadoc)
  * @see org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler#removeExtension(org.eclipse.core.runtime.IExtension, java.lang.Object[])
  */
 public void removeExtension(IExtension extension, Object[] objects) {
   for (int i = 0; i < objects.length; i++) {
     if (objects[i] instanceof WorkingSetDescriptor) {
       WorkingSetDescriptor desc = (WorkingSetDescriptor) objects[i];
       workingSetDescriptors.remove(desc.getId());
     }
   }
 }
Пример #2
0
 /**
  * Adds a working set descriptor.
  *
  * @param descriptor working set descriptor to add. Must not exist in the registry yet.
  */
 public void addWorkingSetDescriptor(WorkingSetDescriptor descriptor) {
   Assert.isTrue(
       !workingSetDescriptors.containsValue(descriptor),
       "working set descriptor already registered"); //$NON-NLS-1$
   IExtensionTracker tracker = PlatformUI.getWorkbench().getExtensionTracker();
   tracker.registerObject(
       descriptor.getConfigurationElement().getDeclaringExtension(),
       descriptor,
       IExtensionTracker.REF_WEAK);
   workingSetDescriptors.put(descriptor.getId(), descriptor);
 }