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 163007 Details for
Bug 147044
[launching] external editor configuration dialog loses JRE setting
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]
updated patch for 3.6M7 vs HEAD
ant-jre.patch (text/plain), 8.59 KB, created by
Michael Rennie
on 2010-03-25 11:54:20 EDT
(
hide
)
Description:
updated patch for 3.6M7 vs HEAD
Filename:
MIME Type:
Creator:
Michael Rennie
Created:
2010-03-25 11:54:20 EDT
Size:
8.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ant.ui >Index: Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntJRETab.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntJRETab.java,v >retrieving revision 1.46 >diff -u -r1.46 AntJRETab.java >--- Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntJRETab.java 8 Oct 2009 18:44:18 -0000 1.46 >+++ Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntJRETab.java 25 Mar 2010 15:53:49 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -13,7 +13,6 @@ > > import java.util.regex.Pattern; > >-import org.eclipse.ant.internal.ui.AntUIPlugin; > import org.eclipse.ant.internal.ui.IAntUIConstants; > import org.eclipse.ant.internal.ui.IAntUIHelpContextIds; > import org.eclipse.ant.launching.IAntLaunchConstants; >@@ -25,6 +24,7 @@ > import org.eclipse.debug.core.ILaunchConfiguration; > import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; > import org.eclipse.debug.ui.ILaunchConfigurationDialog; >+import org.eclipse.jdt.core.IJavaProject; > import org.eclipse.jdt.debug.ui.launchConfigurations.JavaJRETab; > import org.eclipse.jdt.internal.debug.ui.jres.JREDescriptor; > import org.eclipse.jdt.internal.debug.ui.launcher.VMArgumentsBlock; >@@ -96,22 +96,17 @@ > boolean isDefaultJRE = fJREBlock.isDefaultJRE(); > fWorkingDirectoryBlock.setEnabled(!isDefaultJRE); > fVMArgumentsBlock.setEnabled(!isDefaultJRE); >+ configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, (String)null); >+ configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, (String)null); > if (isDefaultJRE) { >- configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, (String)null); >- configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, (String)null); > configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String)null); > configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, (String)null); > configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String)null); > configuration.setAttribute(IAntLaunchConstants.ATTR_DEFAULT_VM_INSTALL, false); > } else { > super.performApply(configuration); >- >- if (useDefaultSeparateJRE(configuration)) { >- configuration.setAttribute(IAntLaunchConstants.ATTR_DEFAULT_VM_INSTALL, true); >- } else { >- configuration.setAttribute(IAntLaunchConstants.ATTR_DEFAULT_VM_INSTALL, false); >- } >- >+ IVMInstall vm = fJREBlock.getJRE(); >+ configuration.setAttribute(IAntLaunchConstants.ATTR_DEFAULT_VM_INSTALL, (vm == null ? false : vm.equals(getDefaultVMInstall(configuration)))); > applySeparateVMAttributes(configuration); > fVMArgumentsBlock.performApply(configuration); > fWorkingDirectoryBlock.performApply(configuration); >@@ -119,36 +114,6 @@ > setLaunchConfigurationWorkingCopy(configuration); > } > >- private boolean useDefaultSeparateJRE(ILaunchConfigurationWorkingCopy configuration) { >- boolean deflt= false; >- String vmInstallType= null; >- String jreContainerPath= null; >- try { >- vmInstallType= configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, (String)null); >- jreContainerPath= configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String)null); >- } catch (CoreException e) { >- } >- if (vmInstallType != null) { >- configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, (String)null); >- } >- if (jreContainerPath != null) { >- configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String)null); >- } >- IVMInstall defaultVMInstall= getDefaultVMInstall(configuration); >- if (defaultVMInstall != null) { >- IVMInstall vm= fJREBlock.getJRE(); >- deflt= defaultVMInstall.equals(vm); >- } >- >- if (vmInstallType != null) { >- configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, vmInstallType); >- } >- if (jreContainerPath != null) { >- configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, jreContainerPath); >- } >- return deflt; >- } >- > private void applySeparateVMAttributes(ILaunchConfigurationWorkingCopy configuration) { > configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME, MAIN_TYPE_NAME); > //only set to use the remote ant process factory if the user >@@ -189,35 +154,10 @@ > * @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration) > */ > public void initializeFrom(ILaunchConfiguration configuration) { >- try { >- boolean isDefaultVMInstall= configuration.getAttribute(IAntLaunchConstants.ATTR_DEFAULT_VM_INSTALL, false); >- if (isDefaultVMInstall) { >- ILaunchConfigurationWorkingCopy copy = null; >- if (configuration instanceof ILaunchConfigurationWorkingCopy) { >- copy= (ILaunchConfigurationWorkingCopy) configuration; >- } else { >- copy= configuration.getWorkingCopy(); >- } >- >- //null out the vm type and jre container path to get the default vm install from JavaRuntime >- copy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, (String)null); >- copy.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String)null); >- IVMInstall defaultVMInstall= getDefaultVMInstall(copy); >- if (defaultVMInstall != null) { >- //update if required >- setDefaultVMInstallAttributes(defaultVMInstall, copy); >- } >- if (copy.isDirty() && !copy.isReadOnly()) { >- configuration= copy.doSave(); >- } >- } >- } catch (CoreException ce) { >- AntUIPlugin.log(ce); >- } > super.initializeFrom(configuration); > fVMArgumentsBlock.initializeFrom(configuration); > fWorkingDirectoryBlock.initializeFrom(configuration); >- boolean separateVM= !fJREBlock.isDefaultJRE(); >+ boolean separateVM = !fJREBlock.isDefaultJRE(); > fWorkingDirectoryBlock.setEnabled(separateVM); > fVMArgumentsBlock.setEnabled(separateVM); > } >@@ -276,33 +216,36 @@ > IVMInstall defaultVMInstall= getDefaultVMInstall(config); > if (defaultVMInstall != null) { > config.setAttribute(IAntLaunchConstants.ATTR_DEFAULT_VM_INSTALL, true); >- setDefaultVMInstallAttributes(defaultVMInstall, config); >+ //setDefaultVMInstallAttributes(defaultVMInstall, config); > applySeparateVMAttributes(config); > } > > } > >+ /** >+ * Returns the default {@link IVMInstall} for the given {@link ILaunchConfiguration}, which resolves >+ * to the {@link IVMInstall} for the backing {@link IJavaProject} as specified by the project >+ * attribute in the configuration. If there is no project attribute the workspace default >+ * {@link IVMInstall} is returned. >+ * >+ * @param config >+ * @return the default {@link IVMInstall} for the given {@link ILaunchConfiguration} >+ */ > private IVMInstall getDefaultVMInstall(ILaunchConfiguration config) { >- IVMInstall defaultVMInstall; > try { >- defaultVMInstall = JavaRuntime.computeVMInstall(config); >+ IJavaProject project = JavaRuntime.getJavaProject(config); >+ if(project != null) { >+ return JavaRuntime.getVMInstall(project); >+ } >+ return JavaRuntime.getDefaultVMInstall(); > } catch (CoreException e) { > //core exception thrown for non-Java project >- defaultVMInstall= JavaRuntime.getDefaultVMInstall(); >+ return JavaRuntime.getDefaultVMInstall(); > } >- return defaultVMInstall; > } > >- private void setDefaultVMInstallAttributes(IVMInstall defaultVMInstall, ILaunchConfigurationWorkingCopy config) { >- String vmName = defaultVMInstall.getName(); >- String vmTypeID = defaultVMInstall.getVMInstallType().getId(); >- config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_NAME, vmName); >- config.setAttribute(IJavaLaunchConfigurationConstants.ATTR_VM_INSTALL_TYPE, vmTypeID); >- } >- > /* (non-Javadoc) > * @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) > */ >- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) { >- } >+ public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {} > }
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 147044
:
73576
|
134659
| 163007