if (targetEditor instanceof SimpleGraphicalEditor) {
IHTMLGraphicalViewer graphicalViewer = ((SimpleGraphicalEditor) targetEditor).getGraphicViewer();
setViewerOnActions(graphicalViewer);
} else if (targetEditor instanceof HTMLEditor) {
//Bug 264080 - getDesignViewer may return null
IDesignViewer designViewer = ((HTMLEditor) targetEditor).getDesignViewer();
if (designViewer != null) {
IHTMLGraphicalViewer graphicalViewer = designViewer.getGraphicViewer();
setViewerOnActions(graphicalViewer);
}
} else {
setViewerOnActions(null);
}