diff options
author | Darin Swanson | 2004-02-23 17:56:21 +0000 |
---|---|---|
committer | Darin Swanson | 2004-02-23 17:56:21 +0000 |
commit | a06c4f2af91db461dcf0343b06f5609571cda0e9 (patch) | |
tree | 986d28f95cd19d995896d049d8cea805b8ac666e /org.eclipse.ui.externaltools | |
parent | 4df09be5eb39c0319c21fa14e44e13cc59e1bbdc (diff) | |
download | eclipse.platform.debug-a06c4f2af91db461dcf0343b06f5609571cda0e9.tar.gz eclipse.platform.debug-a06c4f2af91db461dcf0343b06f5609571cda0e9.tar.xz eclipse.platform.debug-a06c4f2af91db461dcf0343b06f5609571cda0e9.zip |
Bug 37944 - .project file paths to external tools hardcoded to specific project
Diffstat (limited to 'org.eclipse.ui.externaltools')
2 files changed, 14 insertions, 9 deletions
diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java index 47ecec7f2..881744bfc 100644 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java +++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/model/BuilderUtils.java @@ -34,15 +34,16 @@ import org.eclipse.debug.core.ILaunchManager; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.externaltools.internal.registry.ExternalToolMigration; -import org.eclipse.ui.externaltools.internal.ui.BuilderPropertyPage; /** * Utility methods for working with external tool project builders. */ public class BuilderUtils { - private static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$ + public static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$ + public static final String BUILDER_FOLDER_NAME= ".externalToolBuilders"; //$NON-NLS-1$ + // Extension point constants. private static final String TAG_CONFIGURATION_MAP= "configurationMap"; //$NON-NLS-1$ private static final String TAG_SOURCE_TYPE= "sourceType"; //$NON-NLS-1$ @@ -74,13 +75,21 @@ public class BuilderUtils { if (configuration == null) { // If the memento failed, try treating the handle as a file name. // This is the format used in 3.0. - IPath path= new Path(BuilderPropertyPage.BUILDER_FOLDER_NAME).append(configHandle); + IPath path= new Path(BUILDER_FOLDER_NAME).append(configHandle); IFile file= project.getFile(path); configuration= manager.getLaunchConfiguration(file); } return configuration; } + /** + * Returns an <code>ICommand</code> from the given launch configuration. + * + * @param project the project the ICommand is relevant to + * @param config, the launch configuration to create the command from + * @return the new command. <code>null</code> can be returned if problems occur during + * the translation. + */ public static ICommand commandFromLaunchConfig(IProject project, ILaunchConfiguration config) { ICommand newCommand = null; try { @@ -180,7 +189,7 @@ public class BuilderUtils { * <code>null</code> if the folder could not be created */ public static IFolder getBuilderFolder(IProject project, boolean create) { - IFolder folder = project.getFolder(BuilderPropertyPage.BUILDER_FOLDER_NAME); + IFolder folder = project.getFolder(BUILDER_FOLDER_NAME); if (!folder.exists() && create) { try { folder.create(true, true, new NullProgressMonitor()); diff --git a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java index 9ffb12a9a..14d4c7522 100644 --- a/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java +++ b/org.eclipse.ui.externaltools/External Tools Base/org/eclipse/ui/externaltools/internal/ui/BuilderPropertyPage.java @@ -79,12 +79,8 @@ import org.eclipse.ui.help.WorkbenchHelp; */ public final class BuilderPropertyPage extends PropertyPage implements ICheckStateListener { - private static final String LAUNCH_CONFIG_HANDLE = "LaunchConfigHandle"; //$NON-NLS-1$ - //locally mark a command's enabled state so it can be processed correctly on performOK private static final String COMMAND_ENABLED= "CommandEnabled"; //$NON-NLS-1$ - - public static final String BUILDER_FOLDER_NAME= ".externalToolBuilders"; //$NON-NLS-1$ private Button upButton, downButton, newButton, copyButton, editButton, removeButton; @@ -210,7 +206,7 @@ public final class BuilderPropertyPage extends PropertyPage implements ICheckSta } } else { String builderID = commands[i].getBuilderName(); - if (builderID.equals(ExternalToolBuilder.ID) && commands[i].getArguments().get(LAUNCH_CONFIG_HANDLE) != null) { + if (builderID.equals(ExternalToolBuilder.ID) && commands[i].getArguments().get(BuilderUtils.LAUNCH_CONFIG_HANDLE) != null) { // An invalid external tool entry. element= new ErrorConfig(commands[i]); } else { |