@SuppressWarnings("unchecked") @Override public Image decorateImage(Image image, Object element) { if (!(element instanceof AbstractNode)) { return image; } try { List<Image> decorations = (List<Image>) ((AbstractNode) element) .accept( new DecorationProvider( fFileInfoProvider, fFileInfoProvider.isProjectAvailable())); List<Image> all = new ArrayList<Image>(decorations); all.add(0, image); if (fFusedImages.containsKey(all) == false) { Image decorated = new Image(Display.getCurrent(), image.getImageData()); for (Image decoration : decorations) { if (decoration != null) { decorated = fuseImages(decorated, decoration, 0, 0); } } fFusedImages.put(decorations, decorated); } return fFusedImages.get(decorations); } catch (Exception e) { SystemLogger.logCatch(e.getMessage()); } return image; }
@Override public Image getImage(Object element) { if (element instanceof AbstractNode) { try { return (Image) ((AbstractNode) element).accept(new ImageProvider()); } catch (Exception e) { SystemLogger.logCatch(e.getMessage()); } } return getImageFromFile("sample.png"); }
@Override public String getText(Object element) { if (element instanceof AbstractNode) { try { return (String) ((AbstractNode) element).accept(new TextProvider()); } catch (Exception e) { SystemLogger.logCatch(e.getMessage()); } } return null; }