/**
* There is no official method/extension point for replacing the shared
* workbench images. Thus, we access the internal WorkbenchImages class here
* and replace some images with our own here.
*/
private void changeWorkbenchImages() {
try {
WorkbenchImages.declareImage(
IWorkbenchGraphicConstants.IMG_WIZBAN_IMPORT_WIZ,
RcpActivator.getImageDescriptor("icons/wizard/import.png"),
true);
WorkbenchImages.declareImage(
IWorkbenchGraphicConstants.IMG_WIZBAN_EXPORT_WIZ,
RcpActivator.getImageDescriptor("icons/wizard/export.png"),
true);
WorkbenchImages.declareImage(
ISharedImages.IMG_OBJ_FOLDER,
RcpActivator.getImageDescriptor("icons/folder_open.png"),
true);
} catch (Exception e) {
Logger log = LoggerFactory.getLogger(getClass());
log.error("failed to patch workbench images", e);
}
}
private Image getImage(Object element) {
if (element instanceof ItemsListSeparator) {
return WorkbenchImages
.getImage(IWorkbenchGraphicConstants.IMG_OBJ_SEPARATOR);
}
return provider.getImage(element);
}
public HostPagePathLabelProvider() {
image = WorkbenchImages.getImage(ISharedImages.IMG_OBJ_FOLDER);
}