	private CompositeImageDescriptor getImageDescriptor(Object object, boolean showActivation) {
		CompositeImageDescriptor compositeDescriptor = new CompositeImageDescriptor();
		if (object instanceof TaskArchive) {
			compositeDescriptor.icon = TasksUiImages.CATEGORY_ARCHIVE;
			return compositeDescriptor;
		} else if (object instanceof TaskCategory) {
			compositeDescriptor.icon = TasksUiImages.CATEGORY;
			return compositeDescriptor;
		} else if (object instanceof ITaskListElement) {
			ITaskListElement element = (ITaskListElement) object;
			AbstractRepositoryConnectorUi connectorUi = null;
			if (element instanceof AbstractRepositoryTask) {
				AbstractRepositoryTask repositoryTask = (AbstractRepositoryTask) element;
				connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractRepositoryTask) element).getRepositoryKind());
				compositeDescriptor.overlayKind = connectorUi.getTaskKindOverlay(repositoryTask);
				if (showActivation) {
					compositeDescriptor.contextToggle = getContextActivationImage(element);
				}
			} else if (element instanceof AbstractQueryHit) {
				AbstractRepositoryTask repositoryTask = ((AbstractQueryHit) element).getCorrespondingTask();
				if (repositoryTask != null) {
					return getImageDescriptor(repositoryTask, showActivation);
				}
			} else if (element instanceof AbstractTaskContainer) {
				connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractRepositoryQuery) element).getRepositoryKind());
			}
			if (connectorUi != null) {
				compositeDescriptor.icon = connectorUi.getTaskListElementIcon(element);
				return compositeDescriptor;
			} else {
				if (element instanceof ITask) {
					if (showActivation) {
						compositeDescriptor.contextToggle = getContextActivationImage(element);
					}
				} else if (element instanceof AbstractQueryHit) {
					if (showActivation) {
						compositeDescriptor.contextToggle = getContextActivationImage(element);
					}
				}
				if (element instanceof ITask || element instanceof AbstractQueryHit) {
				}
				if (element instanceof AbstractRepositoryQuery) {
					compositeDescriptor.icon = TasksUiImages.QUERY;
				} else if (element instanceof AbstractQueryHit) {
					compositeDescriptor.icon = TasksUiImages.TASK;
				} else if (element instanceof ITask) {
					compositeDescriptor.icon = TasksUiImages.TASK;
				}
				return compositeDescriptor;
			}
		}
		return null;
	}

	private CompositeImageDescriptor getImageDescriptor(Object object, boolean showActivation) {
		CompositeImageDescriptor compositeDescriptor = new CompositeImageDescriptor();
		if (object instanceof TaskArchive) {
			compositeDescriptor.icon = TasksUiImages.CATEGORY_ARCHIVE;
			return compositeDescriptor;
		} else if (object instanceof TaskCategory) {
			compositeDescriptor.icon = TasksUiImages.CATEGORY;
			return compositeDescriptor;
		} else if (object instanceof ITaskListElement) {
			ITaskListElement element = (ITaskListElement) object;
			AbstractRepositoryConnectorUi connectorUi = null;
			if (element instanceof AbstractRepositoryTask) {
				AbstractRepositoryTask repositoryTask = (AbstractRepositoryTask) element;
				connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractRepositoryTask) element).getRepositoryKind());
				if (connectorUi != null) {
					compositeDescriptor.overlayKind = connectorUi.getTaskKindOverlay(repositoryTask);
				}
				if (showActivation) {
					compositeDescriptor.contextToggle = getContextActivationImage(element);
				}
			} else if (element instanceof AbstractQueryHit) {
				AbstractRepositoryTask repositoryTask = ((AbstractQueryHit) element).getCorrespondingTask();
				if (repositoryTask != null) {
					return getImageDescriptor(repositoryTask, showActivation);
				}
			} else if (element instanceof AbstractTaskContainer) {
				connectorUi = TasksUiPlugin.getRepositoryUi(((AbstractRepositoryQuery) element).getRepositoryKind());
			}
			if (connectorUi != null) {
				compositeDescriptor.icon = connectorUi.getTaskListElementIcon(element);
				return compositeDescriptor;
			} else {
				if (element instanceof ITask) {
					if (showActivation) {
						compositeDescriptor.contextToggle = getContextActivationImage(element);
					}
				} else if (element instanceof AbstractQueryHit) {
					if (showActivation) {
						compositeDescriptor.contextToggle = getContextActivationImage(element);
					}
				}
				if (element instanceof ITask || element instanceof AbstractQueryHit) {
				}
				if (element instanceof AbstractRepositoryQuery) {
					compositeDescriptor.icon = TasksUiImages.QUERY;
				} else if (element instanceof AbstractQueryHit) {
					compositeDescriptor.icon = TasksUiImages.TASK;
				} else if (element instanceof ITask) {
					compositeDescriptor.icon = TasksUiImages.TASK;
				}
				return compositeDescriptor;
			}
		}
		return null;
	}
