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 190866 Details for
Bug 309701
Persisted launch configuration file changes unnecessarily
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for 3.7
309701.txt (text/plain), 13.60 KB, created by
Dean Roberts
on 2011-03-10 10:04:07 EST
(
hide
)
Description:
Patch for 3.7
Filename:
MIME Type:
Creator:
Dean Roberts
Created:
2011-03-10 10:04:07 EST
Size:
13.60 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.launching >Index: src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.launching/src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java,v >retrieving revision 1.22 >diff -u -r1.22 BundleLauncherHelper.java >--- src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java 27 May 2010 02:26:12 -0000 1.22 >+++ src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java 10 Mar 2011 15:01:05 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2007, 2010 IBM Corporation and others. >+ * Copyright (c) 2007, 2011 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 >@@ -32,7 +32,9 @@ > * simple configurator and update configurator, we change the start level as they > * shouldn't be started together. > */ >- public static final String DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL = "3:true"; //$NON-NLS-1$ >+ public static final String DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL_TEXT = "3"; //$NON-NLS-1$ >+ public static final String DEFAULT_UPDATE_CONFIGURATOR_AUTO_START_TEXT = "true"; //$NON-NLS-1$ >+ public static final String DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL = DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL_TEXT + ":" + DEFAULT_UPDATE_CONFIGURATOR_AUTO_START_TEXT; //$NON-NLS-1$ > > public static final char VERSION_SEPARATOR = '*'; > >@@ -358,6 +360,54 @@ > return map; > } > >+ public static String resolveSystemRunLevelText(IPluginModelBase model) { >+ BundleDescription description = model.getBundleDescription(); >+ String modelName = description.getSymbolicName(); >+ >+ if (IPDEBuildConstants.BUNDLE_DS.equals(modelName)) { >+ return "1"; //$NON-NLS-1$ >+ } else if (IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR.equals(modelName)) { >+ return "1"; //$NON-NLS-1$ >+ } else if (IPDEBuildConstants.BUNDLE_EQUINOX_COMMON.equals(modelName)) { >+ return "2"; //$NON-NLS-1$ >+ } else if (IPDEBuildConstants.BUNDLE_OSGI.equals(modelName)) { >+ return "-1"; //$NON-NLS-1$ >+ } else if (IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR.equals(modelName)) { >+ return DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL_TEXT; >+ } else if (IPDEBuildConstants.BUNDLE_CORE_RUNTIME.equals(modelName)) { >+ if (TargetPlatformHelper.getTargetVersion() > 3.1) { >+ return "default"; //$NON-NLS-1$ >+ } >+ return "2"; //$NON-NLS-1$ >+ } else { >+ return null; >+ } >+ } >+ >+ public static String resolveSystemAutoText(IPluginModelBase model) { >+ BundleDescription description = model.getBundleDescription(); >+ String modelName = description.getSymbolicName(); >+ >+ if (IPDEBuildConstants.BUNDLE_DS.equals(modelName)) { >+ return "true"; //$NON-NLS-1$ >+ } else if (IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR.equals(modelName)) { >+ return "true"; //$NON-NLS-1$ >+ } else if (IPDEBuildConstants.BUNDLE_EQUINOX_COMMON.equals(modelName)) { >+ return "true"; //$NON-NLS-1$ >+ } else if (IPDEBuildConstants.BUNDLE_OSGI.equals(modelName)) { >+ return "true"; //$NON-NLS-1$ >+ } else if (IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR.equals(modelName)) { >+ return DEFAULT_UPDATE_CONFIGURATOR_AUTO_START_TEXT; >+ } else if (IPDEBuildConstants.BUNDLE_CORE_RUNTIME.equals(modelName)) { >+ if (TargetPlatformHelper.getTargetVersion() > 3.1) { >+ return "true"; //$NON-NLS-1$ >+ } >+ return "true"; //$NON-NLS-1$ >+ } else { >+ return null; >+ } >+ } >+ > /** > * Adds the given bundle and start information to the map. This will override anything set > * for system bundles, and set their start level to the appropriate level >@@ -369,23 +419,10 @@ > BundleDescription desc = bundle.getBundleDescription(); > boolean defaultsl = (sl == null || sl.equals("default:default")); //$NON-NLS-1$ > if (desc != null && defaultsl) { >- String modelName = desc.getSymbolicName(); >- if (IPDEBuildConstants.BUNDLE_DS.equals(modelName)) { >- map.put(bundle, "1:true"); //$NON-NLS-1$ >- } else if (IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR.equals(modelName)) { >- map.put(bundle, "1:true"); //$NON-NLS-1$ >- } else if (IPDEBuildConstants.BUNDLE_EQUINOX_COMMON.equals(modelName)) { >- map.put(bundle, "2:true"); //$NON-NLS-1$ >- } else if (IPDEBuildConstants.BUNDLE_OSGI.equals(modelName)) { >- map.put(bundle, "-1:true"); //$NON-NLS-1$ >- } else if (IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR.equals(modelName)) { >- map.put(bundle, DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL); >- } else if (IPDEBuildConstants.BUNDLE_CORE_RUNTIME.equals(modelName)) { >- if (TargetPlatformHelper.getTargetVersion() > 3.1) { >- map.put(bundle, "default:true"); //$NON-NLS-1$ >- } else { >- map.put(bundle, "2:true"); //$NON-NLS-1$ >- } >+ String runLevelText = resolveSystemRunLevelText(bundle); >+ String autoText = resolveSystemAutoText(bundle); >+ if (runLevelText != null && autoText != null) { >+ map.put(bundle, runLevelText + ":" + autoText); //$NON-NLS-1$ > } else { > map.put(bundle, sl); > } >#P org.eclipse.pde.ui >Index: src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java,v >retrieving revision 1.55 >diff -u -r1.55 AbstractPluginBlock.java >--- src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java 13 Aug 2010 10:50:09 -0000 1.55 >+++ src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java 10 Mar 2011 15:01:07 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2010 IBM Corporation and others. >+ * Copyright (c) 2005, 2011 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 >@@ -103,15 +103,16 @@ > } > > public String getColumnText(Object obj, int index) { >+ boolean isChecked = fPluginTreeViewer.getChecked(obj); > switch (index) { > case 0 : > return super.getColumnText(obj, index); > case 1 : >- if (levelColumnCache != null && levelColumnCache.containsKey(obj)) >+ if (isChecked && levelColumnCache != null && levelColumnCache.containsKey(obj)) > return (String) levelColumnCache.get(obj); > return ""; //$NON-NLS-1$ > case 2 : >- if (autoColumnCache != null && autoColumnCache.containsKey(obj)) >+ if (isChecked && autoColumnCache != null && autoColumnCache.containsKey(obj)) > return (String) autoColumnCache.get(obj); > return ""; //$NON-NLS-1$ > default : >@@ -596,35 +597,33 @@ > protected void resetText(IPluginModelBase model) { > String levelText = ""; //$NON-NLS-1$ > String autoText = ""; //$NON-NLS-1$ >- String systemBundleId = PDECore.getDefault().getModelManager().getSystemBundleId(); >- boolean isSystemBundle = systemBundleId.equals(model.getPluginBase().getId()); >- if (model.isFragmentModel()) { >- autoText = "false"; //$NON-NLS-1$ >- } else if (IPDEBuildConstants.BUNDLE_CORE_RUNTIME.equals(model.getPluginBase().getId()) || "org.eclipse.equinox.ds".equals(model.getPluginBase().getId())) { //$NON-NLS-1$ >- autoText = "true"; //$NON-NLS-1$ >- } >+ > Widget widget = fPluginTreeViewer.testFindItem(model); > if (fPluginTreeViewer.getChecked(model)) { >- if (levelColumnCache.containsKey(model) && !isSystemBundle) { >+ if (levelColumnCache.containsKey(model)) { > levelText = (String) levelColumnCache.get(model); >- levelText = levelText.length() > 0 ? levelText : "default"; //$NON-NLS-1$ >+ levelText = levelText == null || levelText.length() == 0 ? "default" : levelText; //$NON-NLS-1$ > } >- if (autoColumnCache.containsKey(model) && !isSystemBundle) { >+ if (autoColumnCache.containsKey(model)) { > autoText = (String) autoColumnCache.get(model); >- autoText = autoText.length() > 0 ? autoText : "default"; //$NON-NLS-1$ >+ autoText = autoText == null || autoText.length() == 0 ? "default" : autoText; //$NON-NLS-1$ > } >+ >+ // Replace run levels and autostart values for certain important system bundles >+ String systemLevelText = BundleLauncherHelper.resolveSystemRunLevelText(model); >+ levelText = systemLevelText != null ? systemLevelText : levelText; >+ >+ String systemAutoText = BundleLauncherHelper.resolveSystemAutoText(model); >+ autoText = systemAutoText != null ? systemAutoText : autoText; > } >- if (levelText != null) { >- levelColumnCache.put(model, levelText); >- if (widget instanceof TreeItem) { >- ((TreeItem) widget).setText(1, levelText); >- } >+ >+ // Set values in UI (although I'm not sure why we don't use the label provider here) >+ if (widget instanceof TreeItem) { >+ ((TreeItem) widget).setText(1, levelText); > } >- if (autoText != null) { >- autoColumnCache.put(model, autoText); >- if (widget instanceof TreeItem) { >- ((TreeItem) widget).setText(2, autoText); >- } >+ >+ if (widget instanceof TreeItem) { >+ ((TreeItem) widget).setText(2, autoText); > } > } > >Index: src/org/eclipse/pde/internal/ui/launcher/ConfigurationAreaBlock.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/launcher/ConfigurationAreaBlock.java,v >retrieving revision 1.15 >diff -u -r1.15 ConfigurationAreaBlock.java >--- src/org/eclipse/pde/internal/ui/launcher/ConfigurationAreaBlock.java 22 Oct 2010 15:48:05 -0000 1.15 >+++ src/org/eclipse/pde/internal/ui/launcher/ConfigurationAreaBlock.java 10 Mar 2011 15:01:07 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2005, 2010 IBM Corporation and others. >+ * Copyright (c) 2005, 2011 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 >@@ -99,7 +99,16 @@ > > public void performApply(ILaunchConfigurationWorkingCopy configuration) { > configuration.setAttribute(IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, fUseDefaultLocationButton.getSelection()); >- fLastEnteredConfigArea = getLocation(); >+ // This is a hack. A more proper way is likely to have the Configuration name text >+ // change callback update the location text directly ... but I could not unravel >+ // a reasonable way to pass messages in the correct direction. >+ >+ // Given the brittle nature of the implementation this seemed like a reasonable compromise. >+ if (fUseDefaultLocationButton.getSelection()) { >+ fLastEnteredConfigArea = DEFAULT_DIR + configuration.getName(); >+ } else { >+ fLastEnteredConfigArea = getLocation(); >+ } > configuration.setAttribute(IPDELauncherConstants.CONFIG_LOCATION, fLastEnteredConfigArea); > configuration.setAttribute(IPDELauncherConstants.CONFIG_CLEAR_AREA, fClearConfig.getSelection()); > } >@@ -132,5 +141,4 @@ > return null; > return super.validate(); > } >- > } >Index: src/org/eclipse/pde/ui/launcher/OSGiSettingsTab.java >=================================================================== >RCS file: /cvsroot/eclipse/pde/ui/org.eclipse.pde.ui/src/org/eclipse/pde/ui/launcher/OSGiSettingsTab.java,v >retrieving revision 1.10 >diff -u -r1.10 OSGiSettingsTab.java >--- src/org/eclipse/pde/ui/launcher/OSGiSettingsTab.java 28 May 2010 19:43:48 -0000 1.10 >+++ src/org/eclipse/pde/ui/launcher/OSGiSettingsTab.java 10 Mar 2011 15:01:07 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2006, 2009 IBM Corporation and others. >+ * Copyright (c) 2006, 2011 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 >@@ -10,8 +10,6 @@ > *******************************************************************************/ > package org.eclipse.pde.ui.launcher; > >-import org.eclipse.pde.launching.IPDELauncherConstants; >- > import org.eclipse.core.runtime.CoreException; > import org.eclipse.debug.core.ILaunchConfiguration; > import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; >@@ -19,6 +17,7 @@ > import org.eclipse.pde.internal.ui.*; > import org.eclipse.pde.internal.ui.launcher.ConfigurationAreaBlock; > import org.eclipse.pde.internal.ui.launcher.JREBlock; >+import org.eclipse.pde.launching.IPDELauncherConstants; > import org.eclipse.swt.SWT; > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.layout.GridData; >@@ -146,4 +145,16 @@ > public String getId() { > return IPDELauncherConstants.TAB_OSGI_SETTINGS_ID; > } >+ >+ // Since editing the config name is not updating the location field in real time >+ // This code at least makes sure the location field is set with the current config name >+ // if the tab is selected. >+ public void activated(ILaunchConfigurationWorkingCopy workingCopy) { >+ super.activated(workingCopy); >+ try { >+ fConfigurationBlock.initializeFrom(workingCopy); >+ } catch (CoreException e) { >+ // A horrible cop out but exactly what the other callers of .initializeFrom() in org.eclipse.pde.ui.launcher do. >+ } >+ } > }
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 309701
:
190553
|
190554
|
190866
|
191013