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 181852 Details for
Bug 328742
Workspace name not updated after typing existing config name
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]
Fix
328742_patch.txt (text/plain), 4.66 KB, created by
Markus Keller
on 2010-10-27 12:44:07 EDT
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Markus Keller
Created:
2010-10-27 12:44:07 EDT
Size:
4.66 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/launcher/WorkspaceDataBlock.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/WorkspaceDataBlock.java,v >retrieving revision 1.15 >diff -u -r1.15 WorkspaceDataBlock.java >--- src/org/eclipse/pde/internal/ui/launcher/WorkspaceDataBlock.java 22 Oct 2010 15:48:05 -0000 1.15 >+++ src/org/eclipse/pde/internal/ui/launcher/WorkspaceDataBlock.java 27 Oct 2010 16:43:36 -0000 >@@ -12,6 +12,7 @@ > > import java.io.File; > import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.variables.VariablesPlugin; > import org.eclipse.debug.core.ILaunchConfiguration; > import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; > import org.eclipse.pde.internal.launching.IPDEConstants; >@@ -34,6 +35,7 @@ > private Button fClearWorkspaceLogRadio; > > private String fLastKnownName; >+ private String fLastKnownLocation; > > public WorkspaceDataBlock(AbstractLauncherTab tab) { > super(tab); >@@ -97,17 +99,24 @@ > } > > public void performApply(ILaunchConfigurationWorkingCopy config, boolean isJUnit) { >+ /* >+ * Goals: >+ * - Update the workspace location when the configuration name changes and ... >+ * - the workspace location matches the default location >+ * - the workspace location doesn't exist on the file system >+ * - Renaming the config should not set the workspace location to an already existing location >+ */ > String currentLocation = getLocation(); > String currentName = config.getName(); > if (fLastKnownName != null && !fLastKnownName.equals(currentName)) { >- String lastDefaultLocation = LaunchArgumentsHelper.getDefaultWorkspaceLocation(fLastKnownName, isJUnit); >- if (lastDefaultLocation.equals(currentLocation)) { >+ if (currentLocation.equals(fLastKnownLocation)) { > try { > File workspaceDir = new File(LaunchArgumentsHelper.getWorkspaceLocation(config)); > if (!workspaceDir.exists()) { >- currentLocation = LaunchArgumentsHelper.getDefaultWorkspaceLocation(currentName, isJUnit); >+ currentLocation = getUnusedWorkspaceLocation(currentName, isJUnit); > fLocationText.setText(currentLocation); > fLastKnownName = currentName; >+ fLastKnownLocation = currentLocation; > } > } catch (CoreException e) { > // don't change workspace location >@@ -120,9 +129,31 @@ > config.setAttribute(IPDEConstants.DOCLEARLOG, fClearWorkspaceLogRadio.getSelection()); > } > >+ private String getUnusedWorkspaceLocation(String name, boolean isJUnit) { >+ String location = LaunchArgumentsHelper.getDefaultWorkspaceLocation(name, isJUnit); >+ String resolvedLocation; >+ try { >+ resolvedLocation = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(location); >+ } catch (CoreException e) { >+ return location; >+ } >+ File workspaceDir = new File(resolvedLocation); >+ if (!workspaceDir.exists()) >+ return location; >+ >+ String resolvedLocation2; >+ int i = 1; >+ do { >+ i++; >+ resolvedLocation2 = resolvedLocation + '-' + i; >+ } while (new File(resolvedLocation2).exists()); >+ return location + '-' + i; >+ } >+ > public void initializeFrom(ILaunchConfiguration configuration) throws CoreException { > fLastKnownName = configuration.getName(); >- fLocationText.setText(configuration.getAttribute(IPDELauncherConstants.LOCATION, LaunchArgumentsHelper.getDefaultWorkspaceLocation(fLastKnownName))); >+ fLastKnownLocation = configuration.getAttribute(IPDELauncherConstants.LOCATION, LaunchArgumentsHelper.getDefaultWorkspaceLocation(fLastKnownName)); >+ fLocationText.setText(fLastKnownLocation); > fClearWorkspaceCheck.setSelection(configuration.getAttribute(IPDELauncherConstants.DOCLEAR, false)); > fAskClearCheck.setSelection(configuration.getAttribute(IPDELauncherConstants.ASKCLEAR, true)); > fAskClearCheck.setEnabled(fClearWorkspaceCheck.getSelection()); >@@ -134,7 +165,8 @@ > > public void setDefaults(ILaunchConfigurationWorkingCopy configuration, boolean isJUnit) { > fLastKnownName = configuration.getName(); >- configuration.setAttribute(IPDELauncherConstants.LOCATION, LaunchArgumentsHelper.getDefaultWorkspaceLocation(fLastKnownName, isJUnit)); >+ fLastKnownLocation = LaunchArgumentsHelper.getDefaultWorkspaceLocation(fLastKnownName, isJUnit); >+ configuration.setAttribute(IPDELauncherConstants.LOCATION, fLastKnownLocation); > configuration.setAttribute(IPDELauncherConstants.DOCLEAR, isJUnit); > configuration.setAttribute(IPDELauncherConstants.ASKCLEAR, !isJUnit); > configuration.setAttribute(IPDEConstants.DOCLEARLOG, 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 328742
: 181852