if (obj == null) {
text = NO_EXERCISE_LABEL;
} else if (obj instanceof Resource) {
Resource res = (Resource) obj;
URI uri = res.getURI();
text = uri.lastSegment() + NAME_PATH_SEPARATOR + toPath(uri.trimSegments(1));
// Exercise ex = res.getExercise();
// text = (ex != null ? getText(ex) : res.getURI().toString());
} else if (obj instanceof Exercise) {
// JexResource res = JexUiPlugin.getPlugin().getExerciseManager().getExerciseResource((Exercise)obj);
// String exText = (res != null ? res.getURI().toString() : null);