setImageDescriptor(MetadataUIImages.DESC_OBJS_JAVA_FILE);
}
@Override
public void run() {
IModelSourceLocation sourceLocation = null;
IStructuredSelection selection = getStructuredSelection();
Object obj = selection.getFirstElement();
if (obj instanceof RequestMappingAnnotationMetadata) {
RequestMappingAnnotationMetadata annotation = (RequestMappingAnnotationMetadata) obj;
sourceLocation = annotation.getElementSourceLocation();
} else if (obj instanceof RequestMappingMethodToClassMap) {
RequestMappingMethodAnnotationMetadata annotation = ((RequestMappingMethodToClassMap) obj)
.getMethodMetadata();
sourceLocation = annotation.getElementSourceLocation();
}
if (sourceLocation != null) {
SpringUIUtils.openInEditor(((FileResource) sourceLocation
.getResource()).getRawFile(),
sourceLocation.getStartLine(), true);
}
}