}
}
public Image getImage(Object obj) {
String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
ImageRegistry imgReg = MeclipsePlugin.getDefault().getImageRegistry();
if (obj instanceof Connection) {
if (((Connection) obj).getMongo() != null) {
return imgReg.get(MeclipsePlugin.CONNECTION_IMG_ID);
} else {
return imgReg.get(MeclipsePlugin.CONNECTION_ERROR_IMG_ID);
}
}
if (obj instanceof Database) {
return imgReg.get(MeclipsePlugin.DATABASE_IMG_ID);
}
if (obj instanceof Collection) {
return imgReg.get(MeclipsePlugin.COLLECTION_IMG_ID);
}
if (obj instanceof Filter) {
return imgReg.get(MeclipsePlugin.FILTER_IMG_ID);
}
if (obj instanceof TreeParent)
imageKey = ISharedImages.IMG_OBJ_FOLDER;
return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
}