3232import org .eclipse .jface .wizard .Wizard ;
3333import org .eclipse .pde .api .tools .annotations .NoExtend ;
3434import org .eclipse .pde .api .tools .annotations .NoInstantiate ;
35+ import org .eclipse .swt .SWT ;
3536import org .eclipse .swt .graphics .Font ;
3637import org .eclipse .swt .graphics .Image ;
3738import org .eclipse .swt .widgets .Control ;
@@ -449,12 +450,8 @@ private static void initializeDefaultImages() {
449450 bundle ,
450451 PreferenceDialog .PREF_DLG_TITLE_IMG ,
451452 ICONS_PATH + "pref_dialog_title.png" , PreferenceDialog .class , "images/pref_dialog_title.png" );//$NON-NLS-1$ //$NON-NLS-2$
452- declareImage (bundle , PopupDialog .POPUP_IMG_MENU , ICONS_PATH
453- + "popup_menu.png" , PopupDialog .class , "images/popup_menu.png" );//$NON-NLS-1$ //$NON-NLS-2$
454- declareImage (
455- bundle ,
456- PopupDialog .POPUP_IMG_MENU_DISABLED ,
457- ICONS_PATH + "popup_menu_disabled.png" , PopupDialog .class , "images/popup_menu_disabled.png" );//$NON-NLS-1$ //$NON-NLS-2$
453+ declareImage (bundle , PopupDialog .POPUP_IMG_MENU , PopupDialog .POPUP_IMG_MENU_DISABLED ,
454+ ICONS_PATH + "popup_menu.png" , PopupDialog .class , "images/popup_menu.png" );//$NON-NLS-1$ //$NON-NLS-2$
458455 }
459456
460457 /**
@@ -478,16 +475,27 @@ private static void initializeDefaultImages() {
478475 */
479476 private static final void declareImage (Object bundle , String key , String path , Class <?> fallback ,
480477 String fallbackPath ) {
478+ declareImage (bundle , key , null , path , fallback , fallbackPath );
479+ }
480+
481+ private static final void declareImage (Object bundle , String key , String disabledKey , String path , Class <?> fallback ,
482+ String fallbackPath ) {
481483
482- imageRegistry . put ( key , ImageDescriptor .createFromURLSupplier (false , () -> {
484+ ImageDescriptor imageDescriptor = ImageDescriptor .createFromURLSupplier (false , () -> {
483485 if (bundle != null ) {
484486 URL url = FileLocator .find ((Bundle ) bundle , IPath .fromOSString (path ), null );
485487 if (url != null ) {
486488 return url ;
487489 }
488490 }
489491 return fallback .getResource (fallbackPath );
490- }));
492+ });
493+ imageRegistry .put (key , imageDescriptor );
494+ if (disabledKey != null ) {
495+ ImageDescriptor disabledImageDescriptor = ImageDescriptor .createWithFlags (imageDescriptor ,
496+ SWT .IMAGE_DISABLE );
497+ imageRegistry .put (key , disabledImageDescriptor );
498+ }
491499 }
492500
493501 /**
0 commit comments