public boolean isModifiable( Object element )
{
String elementClassName = element.getClass().getName();
if ( element instanceof IPathEditorInput )
{
IPathEditorInput pei = ( IPathEditorInput ) element;
File file = pei.getPath().toFile();
return file.canWrite() || !file.exists(); // Allow to edit new files
}
else if ( elementClassName.equals( "org.eclipse.ui.internal.editors.text.JavaFileEditorInput" ) //$NON-NLS-1$
|| elementClassName.equals( "org.eclipse.ui.ide.FileStoreEditorInput" ) ) //$NON-NLS-1$
// The class 'org.eclipse.ui.internal.editors.text.JavaFileEditorInput'