/** * Gets the editor's encoding support. * * @return the resource being edited or <code>null</code>s */ private IEncodingSupport getEncodingSupport() { if (getTextEditor() != null) return (IEncodingSupport)getTextEditor().getAdapter(IEncodingSupport.class); return null; } }
/** * Gets the editor's encoding support. * * @return the resource being edited or <code>null</code>s */ private IEncodingSupport getEncodingSupport() { if (getTextEditor() != null) return getTextEditor().getAdapter(IEncodingSupport.class); return null; } }
/** * Gets the resource which is being edited in the editor. * * @return the resource being edited or <code>null</code>s */ private IResource getResource() { if (getTextEditor() != null && getTextEditor().getEditorInput() != null) return getTextEditor().getEditorInput().getAdapter(IResource.class); return null; }
/** * Gets the resource which is being edited in the editor. * * @return the resource being edited or <code>null</code>s */ private IResource getResource() { if (getTextEditor() != null && getTextEditor().getEditorInput() != null) return (IResource)getTextEditor().getEditorInput().getAdapter(IResource.class); return null; }
@Override public void update() { setEnabled((getResource() != null || getEncodingSupport() != null) && !getTextEditor().isDirty()); }
public void update() { setEnabled((getResource() != null || getEncodingSupport() != null) && !getTextEditor().isDirty()); }
@Override public void run() { final IResource resource= getResource(); final Shell parentShell= getTextEditor().getSite().getShell(); final IEncodingSupport encodingSupport= getEncodingSupport(); if (resource == null && encodingSupport == null) {
public void run() { final IResource resource= getResource(); final Shell parentShell= getTextEditor().getSite().getShell(); final IEncodingSupport encodingSupport= getEncodingSupport(); if (resource == null && encodingSupport == null) {