1 11 package org.eclipse.ui.internal.decorators; 12 13 import java.util.ArrayList ; 14 import java.util.Collection ; 15 import java.util.HashSet ; 16 import java.util.Iterator ; 17 import java.util.Set ; 18 import java.util.StringTokenizer ; 19 20 import org.eclipse.core.runtime.IConfigurationElement; 21 import org.eclipse.core.runtime.IExtension; 22 import org.eclipse.core.runtime.IExtensionPoint; 23 import org.eclipse.core.runtime.IProgressMonitor; 24 import org.eclipse.core.runtime.IStatus; 25 import org.eclipse.core.runtime.ListenerList; 26 import org.eclipse.core.runtime.Platform; 27 import org.eclipse.core.runtime.Status; 28 import org.eclipse.core.runtime.dynamichelpers.ExtensionTracker; 29 import org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler; 30 import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker; 31 import org.eclipse.jface.util.SafeRunnable; 32 import org.eclipse.jface.viewers.DecorationContext; 33 import org.eclipse.jface.viewers.IBaseLabelProvider; 34 import org.eclipse.jface.viewers.IColorDecorator; 35 import org.eclipse.jface.viewers.IDecorationContext; 36 import org.eclipse.jface.viewers.IDelayedLabelDecorator; 37 import org.eclipse.jface.viewers.IFontDecorator; 38 import org.eclipse.jface.viewers.ILabelDecorator; 39 import org.eclipse.jface.viewers.ILabelProviderListener; 40 import org.eclipse.jface.viewers.ILightweightLabelDecorator; 41 import org.eclipse.jface.viewers.LabelDecorator; 42 import org.eclipse.jface.viewers.LabelProviderChangedEvent; 43 import org.eclipse.swt.graphics.Color; 44 import org.eclipse.swt.graphics.Font; 45 import org.eclipse.swt.graphics.Image; 46 import org.eclipse.ui.IDecoratorManager; 47 import org.eclipse.ui.PlatformUI; 48 import org.eclipse.ui.internal.IPreferenceConstants; 49 import org.eclipse.ui.internal.LegacyResourceSupport; 50 import org.eclipse.ui.internal.Workbench; 51 import org.eclipse.ui.internal.WorkbenchMessages; 52 import org.eclipse.ui.internal.WorkbenchPlugin; 53 import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants; 54 import org.eclipse.ui.internal.util.PrefUtil; 55 import org.eclipse.ui.internal.util.Util; 56 import org.eclipse.ui.progress.WorkbenchJob; 57 58 64 public class DecoratorManager extends LabelDecorator implements IDelayedLabelDecorator, 65 ILabelProviderListener, IDecoratorManager, IFontDecorator, IColorDecorator, IExtensionChangeHandler { 66 67 private static String EXTENSIONPOINT_UNIQUE_ID = WorkbenchPlugin.PI_WORKBENCH + "." + IWorkbenchRegistryConstants.PL_DECORATORS; 69 72 public static final Object FAMILY_DECORATE = new Object (); 73 74 private DecorationScheduler scheduler; 75 76 private LightweightDecoratorManager lightweightManager; 77 78 private ListenerList listeners = new ListenerList(); 80 81 private FullDecoratorDefinition[] fullDefinitions; 84 85 private FullTextDecoratorRunnable fullTextRunnable = new FullTextDecoratorRunnable(); 86 87 private FullImageDecoratorRunnable fullImageRunnable = new FullImageDecoratorRunnable(); 88 89 private static final FullDecoratorDefinition[] EMPTY_FULL_DEF = new FullDecoratorDefinition[0]; 90 91 private final String PREFERENCE_SEPARATOR = ","; 93 private final String VALUE_SEPARATOR = ":"; 95 private final String P_TRUE = "true"; 97 private final String P_FALSE = "false"; 99 103 public DecoratorManager() { 104 105 scheduler = new DecorationScheduler(this); 106 IExtensionTracker tracker = PlatformUI.getWorkbench() 107 .getExtensionTracker(); 108 tracker.registerHandler(this, ExtensionTracker.createExtensionPointFilter(getExtensionPointFilter())); 109 } 110 111 114 private void initializeDecoratorDefinitions() { 115 DecoratorRegistryReader reader = new DecoratorRegistryReader(); 116 Collection values = reader 117 .readRegistry(Platform.getExtensionRegistry()); 118 119 ArrayList full = new ArrayList (); 120 ArrayList lightweight = new ArrayList (); 121 Iterator allDefinitions = values.iterator(); 122 IExtensionTracker configurationElementTracker = PlatformUI 123 .getWorkbench().getExtensionTracker(); 124 while (allDefinitions.hasNext()) { 125 DecoratorDefinition nextDefinition = (DecoratorDefinition) allDefinitions 126 .next(); 127 if (nextDefinition.isFull()) { 128 full.add(nextDefinition); 129 } else { 130 lightweight.add(nextDefinition); 131 } 132 133 configurationElementTracker.registerObject(nextDefinition.getConfigurationElement().getDeclaringExtension(), nextDefinition, IExtensionTracker.REF_WEAK); 134 } 135 136 fullDefinitions = new FullDecoratorDefinition[full.size()]; 137 full.toArray(fullDefinitions); 138 139 LightweightDecoratorDefinition[] lightweightDefinitions = new LightweightDecoratorDefinition[lightweight 140 .size()]; 141 lightweight.toArray(lightweightDefinitions); 142 143 lightweightManager = new LightweightDecoratorManager( 144 lightweightDefinitions); 145 146 applyDecoratorsPreference(); 147 } 148 149 155 public void addDecorator(DecoratorDefinition definition) { 156 if (definition.isFull()) { 157 if (getFullDecoratorDefinition(definition.getId()) == null) { 158 FullDecoratorDefinition[] oldDefs = getFullDefinitions(); 159 fullDefinitions = new FullDecoratorDefinition[fullDefinitions.length + 1]; 160 System 161 .arraycopy(oldDefs, 0, fullDefinitions, 0, 162 oldDefs.length); 163 fullDefinitions[oldDefs.length] = (FullDecoratorDefinition) definition; 164 clearCaches(); 165 updateForEnablementChange(); 166 } 167 } else { 168 if (getLightweightManager().addDecorator( 169 (LightweightDecoratorDefinition) definition)) { 170 clearCaches(); 171 updateForEnablementChange(); 172 } 173 } 174 ((Workbench) PlatformUI.getWorkbench()) 175 .getExtensionTracker().registerObject( 176 definition.getConfigurationElement().getDeclaringExtension(), definition, IExtensionTracker.REF_WEAK); 177 } 178 179 187 static Collection getDecoratorsFor(Object element, 188 DecoratorDefinition[] enabledDefinitions) { 189 190 ArrayList decorators = new ArrayList (); 191 192 for (int i = 0; i < enabledDefinitions.length; i++) { 193 if (enabledDefinitions[i].isEnabledFor(element)) { 194 decorators.add(enabledDefinitions[i]); 195 } 196 } 197 198 return decorators; 199 200 } 201 202 203 206 public void addListener(ILabelProviderListener listener) { 207 listeners.add(listener); 208 } 209 210 213 public void removeListener(ILabelProviderListener listener) { 214 listeners.remove(listener); 215 scheduler.listenerRemoved(listener); 216 } 217 218 222 ILabelProviderListener [] getListeners(){ 223 Object [] array = listeners.getListeners(); 224 ILabelProviderListener [] listenerArray = 225 new ILabelProviderListener [array.length]; 226 System.arraycopy(array,0,listenerArray,0,listenerArray.length); 227 return listenerArray; 228 } 229 230 236 void fireListener(final LabelProviderChangedEvent event, final ILabelProviderListener listener) { 237 Platform.run(new SafeRunnable() { 238 public void run() { 239 listener.labelProviderChanged(event); 240 } 241 }); 242 243 } 244 245 249 void fireListeners(final LabelProviderChangedEvent event) { 250 Object [] array = listeners.getListeners(); 251 for (int i = 0; i < array.length; i++) { 252 final ILabelProviderListener l = (ILabelProviderListener) array[i]; 253 Platform.run(new SafeRunnable() { 254 public void run() { 255 l.labelProviderChanged(event); 256 } 257 }); 258 } 259 } 260 261 266 void fireListenersInUIThread(final LabelProviderChangedEvent event) { 267 268 if (!PlatformUI.isWorkbenchRunning()) { 270 return; 271 } 272 273 if (Thread.currentThread() == PlatformUI.getWorkbench().getDisplay() 275 .getThread()) { 276 fireListeners(event); 277 return; 278 } 279 280 WorkbenchJob updateJob = new WorkbenchJob(WorkbenchMessages.DecorationScheduler_UpdateJobName) { 281 286 public IStatus runInUIThread(IProgressMonitor monitor) { 287 fireListeners(event); 288 return Status.OK_STATUS; 289 } 290 291 294 public boolean belongsTo(Object family) { 295 return FAMILY_DECORATE == family; 296 } 297 }; 298 updateJob.setSystem(true); 299 updateJob.schedule(); 300 301 } 302 303 306 public String decorateText(String text, Object element, IDecorationContext context) { 307 Object adapted = getResourceAdapter(element); 309 String result = scheduler.decorateWithText(text, element, adapted, context); 310 FullDecoratorDefinition[] decorators = getDecoratorsFor(element); 311 for (int i = 0; i < decorators.length; i++) { 312 if (decorators[i].isEnabledFor(element)) { 313 String newResult = safeDecorateText(element, result, 314 decorators[i]); 315 if (newResult != null) { 316 result = newResult; 317 } 318 } 319 } 320 321 if (adapted != null) { 322 decorators = getDecoratorsFor(adapted); 323 for (int i = 0; i < decorators.length; i++) { 324 if (decorators[i].isAdaptable() 325 && decorators[i].isEnabledFor(adapted)) { 326 String newResult = safeDecorateText(adapted, result, 327 decorators[i]); 328 if (newResult != null) { 329 result = newResult; 330 } 331 } 332 } 333 } 334 335 return result; 336 } 337 338 342 public String decorateText(String text, Object element) { 343 return decorateText(text, element, DecorationContext.DEFAULT_CONTEXT); 344 } 345 346 354 private String safeDecorateText(Object element, String start, 355 FullDecoratorDefinition decorator) { 356 fullTextRunnable.setValues(start, element, decorator); 357 Platform.run(fullTextRunnable); 358 String newResult = fullTextRunnable.getResult(); 359 return newResult; 360 } 361 362 365 public Image decorateImage(Image image, Object element, IDecorationContext context) { 366 Object adapted = getResourceAdapter(element); 367 Image result = scheduler.decorateWithOverlays(image, element, adapted, context); 368 FullDecoratorDefinition[] decorators = getDecoratorsFor(element); 369 370 for (int i = 0; i < decorators.length; i++) { 371 if (decorators[i].isEnabledFor(element)) { 372 Image newResult = safeDecorateImage(element, result, 373 decorators[i]); 374 if (newResult != null) { 375 result = newResult; 376 } 377 } 378 } 379 380 382 if (adapted != null) { 383 decorators = getDecoratorsFor(adapted); 384 for (int i = 0; i < decorators.length; i++) { 385 if (decorators[i].isAdaptable() 386 && decorators[i].isEnabledFor(adapted)) { 387 Image newResult = safeDecorateImage(adapted, result, 388 decorators[i]); 389 if (newResult != null) { 390 result = newResult; 391 } 392 } 393 } 394 } 395 396 return result; 397 } 398 399 403 public Image decorateImage(Image image, Object element) { 404 return decorateImage(image, element, DecorationContext.DEFAULT_CONTEXT); 405 } 406 407 415 private Image safeDecorateImage(Object element, Image start, 416 FullDecoratorDefinition decorator) { 417 fullImageRunnable.setValues(start, element, decorator); 418 Platform.run(fullImageRunnable); 419 Image newResult = fullImageRunnable.getResult(); 420 return newResult; 421 } 422 423 429 private Object getResourceAdapter(Object element) { 430 Object adapted = LegacyResourceSupport.getAdaptedContributorResource(element); 431 if (adapted != element) { 432 return adapted; } 434 return null; 435 } 436 437 441 public boolean isLabelProperty(Object element, String property) { 442 return isLabelProperty(element, property, true); 443 } 444 445 455 public boolean isLabelProperty(Object element, String property, 456 boolean checkAdapted) { 457 boolean fullCheck = isLabelProperty(element, property, 458 getDecoratorsFor(element)); 459 460 if (fullCheck) { 461 return fullCheck; 462 } 463 464 boolean lightweightCheck = isLabelProperty(element, property, 465 getLightweightManager().getDecoratorsFor(element)); 466 467 if (lightweightCheck) { 468 return true; 469 } 470 471 if (checkAdapted) { 472 Object adapted = getResourceAdapter(element); 474 if (adapted == null || adapted == element) { 475 return false; 476 } 477 478 fullCheck = isLabelProperty(adapted, property, 479 getDecoratorsFor(adapted)); 480 if (fullCheck) { 481 return fullCheck; 482 } 483 484 return isLabelProperty(adapted, property, lightweightManager 485 .getDecoratorsFor(adapted)); 486 } 487 return false; 488 } 489 490 private boolean isLabelProperty(Object element, String property, 491 DecoratorDefinition[] decorators) { 492 for (int i = 0; i < decorators.length; i++) { 493 if (decorators[i].isEnabledFor(element) 494 && decorators[i].isLabelProperty(element, property)) { 495 return true; 496 } 497 } 498 499 return false; 500 } 501 502 506 private FullDecoratorDefinition[] enabledFullDefinitions() { 507 508 FullDecoratorDefinition[] full = getFullDefinitions(); 509 if(full.length == 0) { 512 return full; 513 } 514 ArrayList result = new ArrayList (); 515 for (int i = 0; i < full.length; i++) { 516 if (full[i].isEnabled()) { 517 result.add(full[i]); 518 } 519 } 520 FullDecoratorDefinition[] returnArray = new FullDecoratorDefinition[result 521 .size()]; 522 result.toArray(returnArray); 523 return returnArray; 524 } 525 526 529 public void dispose() { 530 } 532 533 538 public void clearCaches() { 539 getLightweightManager().reset(); 540 fullTextRunnable.clearReferences(); 541 fullImageRunnable.clearReferences(); 542 } 543 544 548 public void updateForEnablementChange() { 549 scheduler.clearResults(); 551 fireListenersInUIThread(new LabelProviderChangedEvent(this)); 552 writeDecoratorsPreference(); 553 } 554 555 559 public DecoratorDefinition[] getAllDecoratorDefinitions() { 560 LightweightDecoratorDefinition[] lightweightDefinitions = getLightweightManager() 561 .getDefinitions(); 562 DecoratorDefinition[] returnValue = new DecoratorDefinition[fullDefinitions.length 563 + lightweightDefinitions.length]; 564 System.arraycopy(fullDefinitions, 0, returnValue, 0, 565 fullDefinitions.length); 566 System.arraycopy(lightweightDefinitions, 0, returnValue, 567 fullDefinitions.length, lightweightDefinitions.length); 568 return returnValue; 569 } 570 571 574 public void labelProviderChanged(LabelProviderChangedEvent event) { 575 Object [] elements = event.getElements(); 576 scheduler.clearResults(); 577 if (elements == null) { 579 fireListeners(event); 580 } else { 581 for (int i = 0; i < elements.length; i++) { 584 Object adapted = getResourceAdapter(elements[i]); 585 scheduler.queueForDecoration(elements[i], adapted, true, null, DecorationContext.DEFAULT_CONTEXT); 587 } 588 } 589 } 590 591 595 private void writeDecoratorsPreference() { 596 StringBuffer enabledIds = new StringBuffer (); 597 writeDecoratorsPreference(enabledIds, getFullDefinitions()); 598 writeDecoratorsPreference(enabledIds, getLightweightManager() 599 .getDefinitions()); 600 601 WorkbenchPlugin.getDefault().getPreferenceStore().setValue( 602 IPreferenceConstants.ENABLED_DECORATORS, enabledIds.toString()); 603 PrefUtil.savePrefs(); 604 } 605 606 private void writeDecoratorsPreference(StringBuffer enabledIds, 607 DecoratorDefinition[] definitions) { 608 for (int i = 0; i < definitions.length; i++) { 609 enabledIds.append(definitions[i].getId()); 610 enabledIds.append(VALUE_SEPARATOR); 611 if (definitions[i].isEnabled()) { 612 enabledIds.append(P_TRUE); 613 } else { 614 enabledIds.append(P_FALSE); 615 } 616 617 enabledIds.append(PREFERENCE_SEPARATOR); 618 } 619 } 620 621 626 public void applyDecoratorsPreference() { 627 628 String preferenceValue = WorkbenchPlugin.getDefault() 629 .getPreferenceStore().getString( 630 IPreferenceConstants.ENABLED_DECORATORS); 631 632 StringTokenizer tokenizer = new StringTokenizer (preferenceValue, 633 PREFERENCE_SEPARATOR); 634 Set enabledIds = new HashSet (); 635 Set disabledIds = new HashSet (); 636 while (tokenizer.hasMoreTokens()) { 637 String nextValuePair = tokenizer.nextToken(); 638 639 String id = nextValuePair.substring(0, nextValuePair 641 .indexOf(VALUE_SEPARATOR)); 642 if (nextValuePair.endsWith(P_TRUE)) { 643 enabledIds.add(id); 644 } else { 645 disabledIds.add(id); 646 } 647 } 648 649 FullDecoratorDefinition[] full = getFullDefinitions(); 650 for (int i = 0; i < full.length; i++) { 651 String id = full[i].getId(); 652 if (enabledIds.contains(id)) { 653 full[i].setEnabled(true); 654 } else { 655 if (disabledIds.contains(id)) { 656 full[i].setEnabled(false); 657 } 658 } 659 } 660 661 LightweightDecoratorDefinition[] lightweightDefinitions = getLightweightManager() 662 .getDefinitions(); 663 for (int i = 0; i < lightweightDefinitions.length; i++) { 664 String id = lightweightDefinitions[i].getId(); 665 if (enabledIds.contains(id)) { 666 lightweightDefinitions[i].setEnabled(true); 667 } else { 668 if (disabledIds.contains(id)) { 669 lightweightDefinitions[i].setEnabled(false); 670 } 671 } 672 } 673 674 } 675 676 681 public void shutdown() { 682 FullDecoratorDefinition[] full = getFullDefinitions(); 685 for (int i = 0; i < full.length; i++) { 686 if (full[i].isEnabled()) { 687 full[i].setEnabled(false); 688 } 689 } 690 if(lightweightManager != null) { 691 getLightweightManager().shutdown(); 692 } 693 scheduler.shutdown(); 694 dispose(); 695 } 696 697 698 701 public boolean getEnabled(String decoratorId) { 702 DecoratorDefinition definition = getDecoratorDefinition(decoratorId); 703 if (definition == null) { 704 return false; 705 } 706 return definition.isEnabled(); 707 } 708 709 712 public ILabelDecorator getLabelDecorator() { 713 return this; 714 } 715 716 719 public void setEnabled(String decoratorId, boolean enabled) { 720 DecoratorDefinition definition = getDecoratorDefinition(decoratorId); 721 if (definition != null) { 722 definition.setEnabled(enabled); 723 clearCaches(); 724 updateForEnablementChange(); 725 } 726 } 727 728 731 public IBaseLabelProvider getBaseLabelProvider(String decoratorId) { 732 IBaseLabelProvider fullProvider = getLabelDecorator(decoratorId); 733 if (fullProvider == null) { 734 return getLightweightLabelDecorator(decoratorId); 735 } 736 return fullProvider; 737 } 738 739 742 public ILabelDecorator getLabelDecorator(String decoratorId) { 743 FullDecoratorDefinition definition = getFullDecoratorDefinition(decoratorId); 744 745 if (definition != null && definition.isEnabled()) { 747 return definition.getDecorator(); 748 } 749 return null; 750 } 751 752 755 public ILightweightLabelDecorator getLightweightLabelDecorator( 756 String decoratorId) { 757 LightweightDecoratorDefinition definition = getLightweightManager() 758 .getDecoratorDefinition(decoratorId); 759 if (definition != null && definition.isEnabled()) { 761 return definition.getDecorator(); 762 } 763 return null; 764 } 765 766 771 private DecoratorDefinition getDecoratorDefinition(String decoratorId) { 772 DecoratorDefinition returnValue = getFullDecoratorDefinition(decoratorId); 773 if (returnValue == null) { 774 return getLightweightManager().getDecoratorDefinition(decoratorId); 775 } 776 return returnValue; 777 } 778 779 784 private FullDecoratorDefinition getFullDecoratorDefinition( 785 String decoratorId) { 786 int idx = getFullDecoratorDefinitionIdx(decoratorId); 787 if (idx != -1) { 788 return getFullDefinitions()[idx]; 789 } 790 return null; 791 } 792 793 800 private int getFullDecoratorDefinitionIdx( 801 String decoratorId) { 802 FullDecoratorDefinition[] full = getFullDefinitions(); 803 for (int i = 0; i < full.length; i++) { 804 if (full[i].getId().equals(decoratorId)) { 805 return i; 806 } 807 } 808 return -1; 809 } 810 811 812 817 private FullDecoratorDefinition[] getDecoratorsFor(Object element) { 818 819 if (element == null) { 820 return EMPTY_FULL_DEF; 821 } 822 823 Collection decorators = getDecoratorsFor(element, 824 enabledFullDefinitions()); 825 FullDecoratorDefinition[] decoratorArray = EMPTY_FULL_DEF; 826 if (decorators.size() > 0){ 827 decoratorArray = new FullDecoratorDefinition[decorators.size()]; 828 decorators.toArray(decoratorArray); 829 } 830 831 return decoratorArray; 832 } 833 834 840 public LightweightDecoratorManager getLightweightManager() { 841 if(lightweightManager == null) { 842 initializeDecoratorDefinitions(); 843 } 844 return lightweightManager; 845 } 846 847 850 public void update(String decoratorId) { 851 852 IBaseLabelProvider provider = getBaseLabelProvider(decoratorId); 853 if (provider != null) { 854 scheduler.clearResults(); 855 fireListeners(new LabelProviderChangedEvent(provider)); 856 } 857 858 } 859 860 public boolean prepareDecoration(Object element, String originalText, IDecorationContext context) { 861 if (scheduler.isDecorationReady(element, context) 863 || !getLightweightManager().hasEnabledDefinitions()) { 864 return true; 865 } 866 867 boolean force = true; 869 if(originalText == null || originalText.length() == 0) { 871 force = false; 872 } 873 874 scheduler.queueForDecoration(element, getResourceAdapter(element), 876 force, originalText, context); 877 878 return getFullDefinitions().length > 0; 883 } 884 885 888 public boolean prepareDecoration(Object element, String originalText) { 889 return prepareDecoration(element, originalText, DecorationContext.DEFAULT_CONTEXT); 890 } 891 892 895 public Font decorateFont(Object element) { 896 return scheduler.getFont(element, getResourceAdapter(element)); 897 } 898 901 public Color decorateBackground(Object element) { 902 return scheduler.getBackgroundColor(element, getResourceAdapter(element)); 903 } 904 907 public Color decorateForeground(Object element) { 908 return scheduler.getForegroundColor(element, getResourceAdapter(element)); 909 } 910 915 private FullDecoratorDefinition[] getFullDefinitions() { 916 if(fullDefinitions == null) { 917 initializeDecoratorDefinitions(); 918 } 919 return fullDefinitions; 920 } 921 922 private IExtensionPoint getExtensionPointFilter() { 923 return Platform.getExtensionRegistry().getExtensionPoint(EXTENSIONPOINT_UNIQUE_ID); 924 } 925 926 929 public void addExtension(IExtensionTracker tracker, IExtension addedExtension) { 930 IConfigurationElement addedElements[] = addedExtension.getConfigurationElements(); 931 for (int i = 0; i < addedElements.length; i++) { 932 DecoratorRegistryReader reader = new DecoratorRegistryReader(); 933 reader.readElement(addedElements[i]); 934 for (Iterator j = reader.getValues().iterator(); j.hasNext();) { 935 addDecorator((DecoratorDefinition) j.next()); 936 } 937 } 938 } 939 940 943 public void removeExtension(IExtension source, Object [] objects) { 944 945 boolean shouldClear = false; 946 for (int i = 0; i < objects.length; i++) { 947 if (objects[i] instanceof DecoratorDefinition) { 948 DecoratorDefinition definition = (DecoratorDefinition) objects[i]; 949 if (definition.isFull()) { 950 int idx = getFullDecoratorDefinitionIdx(definition.getId()); 951 if (idx != -1) { 952 FullDecoratorDefinition[] oldDefs = getFullDefinitions(); 953 Util 954 .arrayCopyWithRemoval( 955 oldDefs, 956 fullDefinitions = new FullDecoratorDefinition[fullDefinitions.length - 1], 957 idx); 958 shouldClear = true; 959 } 960 } else { 961 shouldClear |= getLightweightManager().removeDecorator( 962 (LightweightDecoratorDefinition) definition); 963 } 964 } 965 } 966 967 if(shouldClear){ 968 clearCaches(); 969 updateForEnablementChange(); 970 } 971 972 } 973 974 } 975 | Popular Tags |