Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 105174 Details for
Bug 235218
OpenJ2EEResourceAction updateSelection not checking for none existent file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated Patch
235218.txt (text/plain), 2.61 KB, created by
Ian Tewksbury
on 2008-06-17 11:17:49 EDT
(
hide
)
Description:
Updated Patch
Filename:
MIME Type:
Creator:
Ian Tewksbury
Created:
2008-06-17 11:17:49 EDT
Size:
2.61 KB
patch
obsolete
>### 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 17 Jun 2008 15:14:33 -0000 >@@ -45,6 +45,9 @@ > import org.eclipse.jst.j2ee.webservice.wsdd.BeanLink; > import org.eclipse.jst.j2ee.webservice.wsdd.EJBLink; > import org.eclipse.jst.j2ee.webservice.wsdd.ServletLink; >+import org.eclipse.jst.javaee.application.Application; >+import org.eclipse.jst.javaee.applicationclient.ApplicationClient; >+import org.eclipse.jst.javaee.ejb.internal.impl.EJBJarImpl; > import org.eclipse.ui.IEditorDescriptor; > import org.eclipse.ui.IEditorPart; > import org.eclipse.ui.IEditorRegistry; >@@ -231,8 +234,19 @@ > IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry(); > IFile file = WorkbenchResourceHelper.getFile((EObject)obj); > if(file != null) { >- IContentType contentType = IDE.getContentType(file); >- currentDescriptor = registry.getDefaultEditor(file.getName(), contentType); >+ /*[235218] if 'obj' is a JavaEE DD file it can only be opened if the file exists >+ * if 'obj' is not a DD file, the WorkbenchResourceHelper may still return the DD >+ * as the associated file (such as in the case with Beans), thus we must try to get >+ * the default editor if 'obj' is not a JavaEE DD file. >+ */ >+ boolean isJavaEEDDFile = isJavaEEDDFile((EObject)obj); >+ if((isJavaEEDDFile && file.exists()) || !isJavaEEDDFile){ >+ IContentType contentType = IDE.getContentType(file); >+ currentDescriptor = registry.getDefaultEditor(file.getName(), contentType); >+ } else { >+ currentDescriptor = null; >+ return false; >+ } > } else { > if (((EObject)obj).eResource() != null) { > String name = (new Path(((EObject)obj).eResource().getURI().toString())).lastSegment(); >@@ -315,4 +329,11 @@ > } > return null; > } >+ >+ //[235218] Determine if the given EObject is a JavaEE DD >+ private boolean isJavaEEDDFile(EObject obj){ >+ boolean isDD = obj instanceof EJBJarImpl || obj instanceof org.eclipse.jst.javaee.web.WebApp || >+ obj instanceof Application || obj instanceof ApplicationClient; >+ return isDD; >+ } > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
bjorn.freeman-benson
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 235218
:
103200
| 105174