### Eclipse Workspace Patch 1.0 #P org.eclipse.jst.j2ee.ui Index: j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java =================================================================== RCS file: /cvsroot/webtools/jeetools/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java,v retrieving revision 1.33 diff -u -r1.33 OpenJ2EEResourceAction.java --- j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java 3 Mar 2008 16:23:29 -0000 1.33 +++ j2ee_ui/org/eclipse/jst/j2ee/internal/actions/OpenJ2EEResourceAction.java 30 May 2008 14:56:33 -0000 @@ -165,11 +165,20 @@ IJavaProject javaProject = JavaCore.create(project); if(javaProject.exists()){ - IType type; + IType type = null; try { - type = javaProject.findType( name ); - ICompilationUnit cu = type.getCompilationUnit(); - EditorUtility.openInEditor(cu); + //if name is null then can't get type + if(name != null) { + type = javaProject.findType( name ); + } + + //if type is null then can't open its editor, so open editor for the resource + if(type != null) { + ICompilationUnit cu = type.getCompilationUnit(); + EditorUtility.openInEditor(cu); + } else{ + openAppropriateEditor(resource); + } } catch (JavaModelException e) { J2EEUIPlugin.logError(-1, e.getMessage(), e); } catch (PartInitException e) {