17
17
18
18
import org .osgi .framework .Bundle ;
19
19
20
+ import org .eclipse .swt .SWT ;
20
21
import org .eclipse .swt .graphics .Image ;
21
22
22
23
import org .eclipse .core .runtime .FileLocator ;
@@ -54,11 +55,11 @@ class TemplatesPageImages {
54
55
55
56
public static final String IMG_ELCL_TEMPLATE_COLLAPSE_ALL = PREFIX_ELCL + "collapseall.svg" ; //$NON-NLS-1$
56
57
57
- public static final String IMG_DLCL_TEMPLATE_DELETE = PREFIX_DLCL + "delete_template.png " ; //$NON-NLS-1$
58
+ public static final String IMG_DLCL_TEMPLATE_DELETE = PREFIX_DLCL + "delete_template.svg " ; //$NON-NLS-1$
58
59
59
- public static final String IMG_DLCL_TEMPLATE_EDIT = PREFIX_DLCL + "edit_template.png " ; //$NON-NLS-1$
60
+ public static final String IMG_DLCL_TEMPLATE_EDIT = PREFIX_DLCL + "edit_template.svg " ; //$NON-NLS-1$
60
61
61
- public static final String IMG_DLCL_TEMPLATE_INSERT = PREFIX_DLCL + "insert_template.png " ; //$NON-NLS-1$
62
+ public static final String IMG_DLCL_TEMPLATE_INSERT = PREFIX_DLCL + "insert_template.svg " ; //$NON-NLS-1$
62
63
63
64
public static final String IMG_OBJ_PREVIEW = PREFIX_OBJ + "preview.svg" ; //$NON-NLS-1$
64
65
@@ -77,8 +78,6 @@ class TemplatesPageImages {
77
78
// slashes correct
78
79
private final static String ELCL = ICONS_PATH + "elcl16/" ; //$NON-NLS-1$
79
80
80
- private final static String DLCL = ICONS_PATH + "dlcl16/" ; //$NON-NLS-1$
81
-
82
81
private final static String OBJ = ICONS_PATH + "obj16/" ; //$NON-NLS-1$
83
82
84
83
/**
@@ -87,12 +86,9 @@ class TemplatesPageImages {
87
86
private static void declareImages () {
88
87
// Ant Editor images
89
88
declareRegistryImage (IMG_ELCL_TEMPLATE_NEW , ELCL + "new_template.svg" ); //$NON-NLS-1$
90
- declareRegistryImage (IMG_ELCL_TEMPLATE_INSERT , ELCL + "insert_template.svg" ); //$NON-NLS-1$
91
- declareRegistryImage (IMG_DLCL_TEMPLATE_INSERT , DLCL + "insert_template.png" ); //$NON-NLS-1$
92
- declareRegistryImage (IMG_ELCL_TEMPLATE_DELETE , ELCL + "delete_template.svg" ); //$NON-NLS-1$
93
- declareRegistryImage (IMG_DLCL_TEMPLATE_DELETE , DLCL + "delete_template.png" ); //$NON-NLS-1$
94
- declareRegistryImage (IMG_ELCL_TEMPLATE_EDIT , ELCL + "edit_template.svg" ); //$NON-NLS-1$
95
- declareRegistryImage (IMG_DLCL_TEMPLATE_EDIT , DLCL + "edit_template.png" ); //$NON-NLS-1$
89
+ declareRegistryImage (IMG_ELCL_TEMPLATE_INSERT , IMG_DLCL_TEMPLATE_INSERT , ELCL + "insert_template.svg" ); //$NON-NLS-1$
90
+ declareRegistryImage (IMG_ELCL_TEMPLATE_DELETE , IMG_DLCL_TEMPLATE_DELETE , ELCL + "delete_template.svg" ); //$NON-NLS-1$
91
+ declareRegistryImage (IMG_ELCL_TEMPLATE_EDIT , IMG_DLCL_TEMPLATE_EDIT , ELCL + "edit_template.svg" ); //$NON-NLS-1$
96
92
declareRegistryImage (IMG_ELCL_TEMPLATE_LINK , ELCL + "link_to_editor.svg" ); //$NON-NLS-1$
97
93
declareRegistryImage (IMG_ELCL_TEMPLATE_COLLAPSE_ALL , ELCL + "collapseall.svg" ); //$NON-NLS-1$
98
94
@@ -109,6 +105,10 @@ private static void declareImages() {
109
105
* class is found (i.e. typically the packages directory)
110
106
*/
111
107
private final static void declareRegistryImage (String key , String path ) {
108
+ declareRegistryImage (key , null , path );
109
+ }
110
+
111
+ private final static void declareRegistryImage (String key , String disabledKey , String path ) {
112
112
ImageDescriptor desc = ImageDescriptor .getMissingImageDescriptor ();
113
113
Bundle bundle = Platform .getBundle (TextEditorPlugin .PLUGIN_ID );
114
114
URL url = null ;
@@ -117,6 +117,10 @@ private final static void declareRegistryImage(String key, String path) {
117
117
desc = ImageDescriptor .createFromURL (url );
118
118
}
119
119
fgImageRegistry .put (key , desc );
120
+ if (disabledKey != null ) {
121
+ ImageDescriptor disabledDescriptor = ImageDescriptor .createWithFlags (desc , SWT .IMAGE_DISABLE );
122
+ fgImageRegistry .put (disabledKey , disabledDescriptor );
123
+ }
120
124
}
121
125
122
126
/**
0 commit comments