public Object getAdapter(Class adapter) { if (adapter == IClassFile.class) return fClassFile; return fClassFile.getAdapter(adapter); }
@SuppressWarnings("rawtypes") public Object getAdapter(Class adapter) { return classFile.getAdapter(adapter); }
public Object getAdapter(Class adapter) { if (adapter == IClassFile.class) return fClassFile; return fClassFile.getAdapter(adapter); }
/** * @see AddMarkerAction#getResource() */ @Override protected IResource getResource() { IResource resource= null; IEditorInput input= getTextEditor().getEditorInput(); if (input instanceof IClassFileEditorInput) { IClassFile c= ((IClassFileEditorInput) input).getClassFile(); IResourceLocator locator= c.getAdapter(IResourceLocator.class); if (locator != null) { try { resource= locator.getContainingResource(c); } catch (JavaModelException x) { // ignore but should inform } } } return resource; }
/** * @see AddMarkerAction#getResource() */ @Override protected IResource getResource() { IResource resource= null; IEditorInput input= getTextEditor().getEditorInput(); if (input instanceof IClassFileEditorInput) { IClassFile c= ((IClassFileEditorInput) input).getClassFile(); IResourceLocator locator= c.getAdapter(IResourceLocator.class); if (locator != null) { try { resource= locator.getContainingResource(c); } catch (JavaModelException x) { // ignore but should inform } } } return resource; }
/** * @see AddMarkerAction#getResource() */ protected IResource getResource() { IResource resource= null; IEditorInput input= getTextEditor().getEditorInput(); if (input instanceof IClassFileEditorInput) { IClassFile c= ((IClassFileEditorInput) input).getClassFile(); IResourceLocator locator= (IResourceLocator) c.getAdapter(IResourceLocator.class); if (locator != null) { try { resource= locator.getContainingResource(c); } catch (JavaModelException x) { // ignore but should inform } } } return resource; }
/** * @see MarkerRulerAction#getResource() */ @Override protected IResource getResource() { IResource resource= null; IEditorInput input= getTextEditor().getEditorInput(); if (input instanceof IClassFileEditorInput) { IClassFile c= ((IClassFileEditorInput) input).getClassFile(); IResourceLocator locator= c.getAdapter(IResourceLocator.class); if (locator != null) { try { resource= locator.getContainingResource(c); } catch (JavaModelException x) { // ignore but should inform } } } return resource; }
/** * @see MarkerRulerAction#getResource() */ protected IResource getResource() { IResource resource= null; IEditorInput input= getTextEditor().getEditorInput(); if (input instanceof IClassFileEditorInput) { IClassFile c= ((IClassFileEditorInput) input).getClassFile(); IResourceLocator locator= (IResourceLocator) c.getAdapter(IResourceLocator.class); if (locator != null) { try { resource= locator.getContainingResource(c); } catch (JavaModelException x) { // ignore but should inform } } } return resource; }
/** * Creates an annotation model derived from the given class file editor input. * * @param classFileEditorInput the editor input from which to query the annotations * @return the created annotation model * @exception CoreException if the editor input could not be accessed */ protected IAnnotationModel createClassFileAnnotationModel(IClassFileEditorInput classFileEditorInput) throws CoreException { IResource resource= null; IClassFile classFile= classFileEditorInput.getClassFile(); IResourceLocator locator= classFile.getAdapter(IResourceLocator.class); if (locator != null) resource= locator.getContainingResource(classFile); if (resource != null) { ClassFileMarkerAnnotationModel model= new ClassFileMarkerAnnotationModel(resource); model.setClassFile(classFile); return model; } return null; }
/** * Creates an annotation model derived from the given class file editor input. * * @param classFileEditorInput the editor input from which to query the annotations * @return the created annotation model * @exception CoreException if the editor input could not be accessed */ protected IAnnotationModel createClassFileAnnotationModel(IClassFileEditorInput classFileEditorInput) throws CoreException { IResource resource= null; IClassFile classFile= classFileEditorInput.getClassFile(); IResourceLocator locator= (IResourceLocator) classFile.getAdapter(IResourceLocator.class); if (locator != null) resource= locator.getContainingResource(classFile); if (resource != null) { ClassFileMarkerAnnotationModel model= new ClassFileMarkerAnnotationModel(resource); model.setClassFile(classFile); return model; } return null; }
/** * @see MarkerRulerAction#getResource() */ @Override protected IResource getResource() { IResource resource= null; IEditorInput input= getTextEditor().getEditorInput(); if (input instanceof IClassFileEditorInput) { IClassFile c= ((IClassFileEditorInput) input).getClassFile(); IResourceLocator locator= c.getAdapter(IResourceLocator.class); if (locator != null) { try { resource= locator.getContainingResource(c); } catch (JavaModelException x) { // ignore but should inform } } } return resource; }
/** * Creates an annotation model derived from the given class file editor input. * * @param classFileEditorInput the editor input from which to query the annotations * @return the created annotation model * @exception CoreException if the editor input could not be accessed */ protected IAnnotationModel createClassFileAnnotationModel(IClassFileEditorInput classFileEditorInput) throws CoreException { IResource resource= null; IClassFile classFile= classFileEditorInput.getClassFile(); IResourceLocator locator= classFile.getAdapter(IResourceLocator.class); if (locator != null) resource= locator.getContainingResource(classFile); if (resource != null) { ClassFileMarkerAnnotationModel model= new ClassFileMarkerAnnotationModel(resource); model.setClassFile(classFile); return model; } return null; }