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 131028 Details for
Bug 271355
Cannot get Handle to project error msg thrown
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
patch.txt (text/plain), 5.32 KB, created by
Hari Shankar
on 2009-04-06 13:51:53 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Hari Shankar
Created:
2009-04-06 13:51:53 EDT
Size:
5.32 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jst.j2ee.ui >Index: j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java >=================================================================== >RCS file: /cvsroot/webtools/jeetools/plugins/org.eclipse.jst.j2ee.ui/j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java,v >retrieving revision 1.12 >diff -u -r1.12 J2EEDeployAction.java >--- j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java 24 May 2006 19:56:28 -0000 1.12 >+++ j2ee_ui/org/eclipse/jst/j2ee/internal/actions/J2EEDeployAction.java 3 Apr 2009 15:37:15 -0000 >@@ -33,12 +33,17 @@ > import org.eclipse.jface.dialogs.MessageDialog; > import org.eclipse.jface.viewers.ISelection; > import org.eclipse.jface.viewers.IStructuredSelection; >+import org.eclipse.jst.j2ee.componentcore.EnterpriseArtifactEdit; > import org.eclipse.jst.j2ee.internal.deploy.DeployerRegistry; > import org.eclipse.jst.j2ee.internal.deploy.J2EEDeployOperation; > import org.eclipse.jst.j2ee.internal.dialogs.RuntimeSelectionDialog; >+import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin; > import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages; > import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities; > import org.eclipse.swt.widgets.Shell; >+import org.eclipse.wst.common.componentcore.ComponentCore; >+import org.eclipse.wst.common.componentcore.internal.util.ComponentUtilities; >+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent; > import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler; > import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin; > import org.eclipse.wst.server.core.IRuntime; >@@ -108,44 +113,56 @@ > > > public boolean checkEnabled(Shell shell) { >- > try { > DeployerRegistry reg = DeployerRegistry.instance(); >- >- List modules = DeployerRegistry.getSelectedModules(selection.toArray()); >- for (int i = 0; i < modules.size(); i++) { >- EObject module = (EObject) modules.get(i); >- IProject proj = ProjectUtilities.getProject(module); >- if (proj == null) { >- displayMessageDialog(J2EEUIMessages.getResourceString("DEPLOY_PROJECT_NOT_FOUND") , shell); >- return false; >+ Object[] modules = selection.toArray(); >+ for (int i = 0; i < modules.length; i++) { >+ Object object = modules[i]; >+ if (object instanceof EObject) { >+ object = ProjectUtilities.getProject(object); > } >- >- IRuntime runtime = J2EEProjectUtilities.getServerRuntime(proj); >- if (runtime == null) { >- String message = MessageFormat.format(J2EEUIMessages.getResourceString("DEPLOY_RUNTIME_NOT_FOUND"), new String []{proj.getName()}); >- RuntimeSelectionDialog selectionDialog = new RuntimeSelectionDialog(shell, >- J2EEUIMessages.getResourceString("DEPLOY_DIALOG_TITLE"), >- null /* default image */, >- message, >- MessageDialog.ERROR, >- new String[] { IDialogConstants.OK_LABEL }, 0, proj) ; >- selectionDialog.open(); >- runtime = J2EEProjectUtilities.getServerRuntime(proj); >- if (runtime == null) >- return false; >+ if (!(object instanceof IProject)) { >+ continue; > } >- List visitors = reg.getDeployModuleExtensions(module, runtime); >- if (visitors.isEmpty()) { >- displayMessageDialog(MessageFormat.format(J2EEUIMessages.getResourceString("DEPLOY_PROJECT_NOT_SUPPORTED"), new String []{proj.getName()}), shell); >- return false; >+ IVirtualComponent component = ComponentCore.createComponent((IProject) object); >+ EnterpriseArtifactEdit edit = null; >+ try { >+ edit = (EnterpriseArtifactEdit) ComponentUtilities.getArtifactEditForRead(component); >+ if (edit == null) >+ continue; >+ EObject module = edit.getDeploymentDescriptorRoot(); >+ IProject proj = (IProject) object; >+ if (proj == null) { >+ displayMessageDialog(J2EEUIMessages.getResourceString("DEPLOY_PROJECT_NOT_FOUND"), shell); >+ return false; >+ } >+ IRuntime runtime = J2EEProjectUtilities.getServerRuntime(proj); >+ if (runtime == null) { >+ String message = MessageFormat.format(J2EEUIMessages.getResourceString("DEPLOY_RUNTIME_NOT_FOUND"), new String[] { proj.getName() }); >+ RuntimeSelectionDialog selectionDialog = new RuntimeSelectionDialog( shell, >+ J2EEUIMessages.getResourceString("DEPLOY_DIALOG_TITLE"), >+ null /* default image */, message, >+ MessageDialog.ERROR, >+ new String[] { IDialogConstants.OK_LABEL }, 0, proj); >+ selectionDialog.open(); >+ runtime = J2EEProjectUtilities.getServerRuntime(proj); >+ if (runtime == null) >+ return false; >+ } >+ List visitors = reg.getDeployModuleExtensions(module, runtime); >+ if (visitors.isEmpty()) { >+ displayMessageDialog( MessageFormat.format( J2EEUIMessages.getResourceString("DEPLOY_PROJECT_NOT_SUPPORTED"), >+ new String[] { proj.getName() }), shell); >+ return false; >+ } >+ } finally { >+ if (edit != null) >+ edit.dispose(); > } >- > } >- > return true; > } catch (CoreException e) { >- System.out.println("Deploy Action recovering from problem verifying enablement."); //$NON-NLS-1$ >+ J2EEPlugin.log(4, -1, "Deploy Action recovering from problem verifying enablement.", e); //$NON-NLS-1$ > e.printStackTrace(); > } > return false;
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
Actions:
View
|
Diff
Attachments on
bug 271355
: 131028