Skip to main content
summaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorJonah Graham2018-11-20 11:20:42 -0500
committerJonah Graham2018-11-22 16:47:02 -0500
commit170e654b4796bad1453ae85a427b97317d67a69a (patch)
tree6ca9b8a8fedd5fd25f97eb79c408312e256ff981 /launch
parent35996a5c5ca5c254959ba48241eaada6dbf8628d (diff)
downloadorg.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.gz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.tar.xz
org.eclipse.cdt-170e654b4796bad1453ae85a427b97317d67a69a.zip
Bug 540373: Cleanup: Format & Remove trailing whitespace
This was done by selecting all projects in Eclipse then Source -> Clean Up... -> choosing: - Format source code - Remove trailing white spaces on all lines and completing the wizard Change-Id: I63685372c6bcc67719bcf145123bcb72e5b00394
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncher.java98
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java165
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerTargetTypeProvider.java93
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/DockerLaunchUIPlugin.java20
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/IContainerLaunchTarget.java2
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/BaseDatabindingModel.java2
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ConnectionListener.java7
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerDataVolumeDialog.java249
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationDelegate.java329
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationTabGroup.java3
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPortDialog.java107
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java389
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyVolumesModel.java29
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java249
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTabModel.java6
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/DataVolumeModel.java52
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ExposedPortModel.java79
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/GdbDebuggerPage.java179
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ILaunchConstants.java31
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java232
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/Messages.java6
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerPage.java70
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerTab.java5
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/SWTImagesFactory.java41
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java87
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChainProvider.java74
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/CoreBuildContainerLaunchConfigProvider.java62
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/CoreBuildContainerLaunchDescriptorType.java2
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/Messages.java6
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizard.java20
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java24
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/DockerHeaderPreferencePage.java44
-rw-r--r--launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/DockerLaunchPreferencePage.java12
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java361
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java241
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java38
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LaunchConfigAffinityExtensionPoint.java29
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java18
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java120
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/corebuild/GenericLaunchConfigTabGroup.java6
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/corebuild/LocalLaunchConfigurationTabGroup.java5
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/AbstractLaunchConfigChange.java22
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/ProjectRenameChange.java46
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/ResourceRenameParticipant.java14
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/BuildErrPrompter.java85
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java28
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.java11
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java79
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java110
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java152
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/ProcessPrompter.java27
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java67
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java28
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java31
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java42
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java34
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainAttachTab.java6
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainCoreTab.java9
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java144
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab2.java142
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ComboControlledStackComposite.java19
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CommonTabLite.java212
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java14
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/CommonBuildTab.java2
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/CoreBuildTab.java2
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/GenericMainTab.java25
66 files changed, 2059 insertions, 2884 deletions
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncher.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncher.java
index 3a9d9d1f1f..3b65d0fb91 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncher.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncher.java
@@ -37,18 +37,13 @@ import org.eclipse.osgi.util.NLS;
import org.osgi.service.prefs.Preferences;
@SuppressWarnings("restriction")
-public class ContainerCommandLauncher
- implements ICommandLauncher, ICBuildCommandLauncher,
- IErrorMessageHolder {
+public class ContainerCommandLauncher implements ICommandLauncher, ICBuildCommandLauncher, IErrorMessageHolder {
public final static String CONTAINER_BUILD_ENABLED = DockerLaunchUIPlugin.PLUGIN_ID
+ ".containerbuild.property.enablement"; //$NON-NLS-1$
- public final static String CONNECTION_ID = DockerLaunchUIPlugin.PLUGIN_ID
- + ".containerbuild.property.connection"; //$NON-NLS-1$
- public final static String IMAGE_ID = DockerLaunchUIPlugin.PLUGIN_ID
- + ".containerbuild.property.image"; //$NON-NLS-1$
- public final static String VOLUMES_ID = DockerLaunchUIPlugin.PLUGIN_ID
- + ".containerbuild.property.volumes"; //$NON-NLS-1$
+ public final static String CONNECTION_ID = DockerLaunchUIPlugin.PLUGIN_ID + ".containerbuild.property.connection"; //$NON-NLS-1$
+ public final static String IMAGE_ID = DockerLaunchUIPlugin.PLUGIN_ID + ".containerbuild.property.image"; //$NON-NLS-1$
+ public final static String VOLUMES_ID = DockerLaunchUIPlugin.PLUGIN_ID + ".containerbuild.property.volumes"; //$NON-NLS-1$
public final static String SELECTED_VOLUMES_ID = DockerLaunchUIPlugin.PLUGIN_ID
+ ".containerbuild.property.selectedvolumes"; //$NON-NLS-1$
@@ -154,9 +149,8 @@ public class ContainerCommandLauncher
}
@Override
- public Process execute(IPath commandPath, String[] args, String[] env,
- IPath workingDirectory, IProgressMonitor monitor)
- throws CoreException {
+ public Process execute(IPath commandPath, String[] args, String[] env, IPath workingDirectory,
+ IProgressMonitor monitor) throws CoreException {
HashMap<String, String> labels = new HashMap<>();
labels.put("org.eclipse.cdt.container-command", ""); //$NON-NLS-1$ //$NON-NLS-2$
@@ -184,8 +178,7 @@ public class ContainerCommandLauncher
cmdList.add(commandString);
commandSegments.add(commandString);
for (String arg : args) {
- String realArg = VariablesPlugin.getDefault()
- .getStringVariableManager().performStringSubstitution(arg);
+ String realArg = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(arg);
if (Platform.getOS().equals(Platform.OS_WIN32)) {
// check if file exists and if so, add an additional directory
IPath p = new Path(realArg);
@@ -201,8 +194,7 @@ public class ContainerCommandLauncher
p = p.removeLastSegments(1);
}
if (f != null && f.exists()) {
- additionalDirs.add(
- "/" + p.toPortableString().replace(':', '/')); //$NON-NLS-1$
+ additionalDirs.add("/" + p.toPortableString().replace(':', '/')); //$NON-NLS-1$
realArg = modifiedArg;
}
}
@@ -223,19 +215,17 @@ public class ContainerCommandLauncher
cmdList.add(realArg);
commandSegments.add(realArg);
}
-
+
commandArgs = commandSegments.toArray(new String[0]);
IProject[] referencedProjects = fProject.getReferencedProjects();
for (IProject referencedProject : referencedProjects) {
- String referencedProjectPath = referencedProject.getLocation()
- .toPortableString();
+ String referencedProjectPath = referencedProject.getLocation().toPortableString();
if (referencedProject.getLocation().getDevice() != null) {
referencedProjectPath = "/" //$NON-NLS-1$
+ referencedProjectPath.replace(':', '/');
}
- additionalDirs
- .add(referencedProjectPath);
+ additionalDirs.add(referencedProjectPath);
}
String workingDir = workingDirectory.makeAbsolute().toPortableString();
@@ -253,11 +243,9 @@ public class ContainerCommandLauncher
ContainerLauncher launcher = new ContainerLauncher();
- Preferences prefs = InstanceScope.INSTANCE
- .getNode(DockerLaunchUIPlugin.PLUGIN_ID);
+ Preferences prefs = InstanceScope.INSTANCE.getNode(DockerLaunchUIPlugin.PLUGIN_ID);
- boolean keepContainer = prefs.getBoolean(
- PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH, false);
+ boolean keepContainer = prefs.getBoolean(PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH, false);
ICBuildConfiguration buildCfg = getBuildConfiguration();
String selectedVolumeString = null;
@@ -266,29 +254,24 @@ public class ContainerCommandLauncher
if (buildCfg != null) {
IToolChain toolChain = buildCfg.getToolChain();
selectedVolumeString = toolChain.getProperty(SELECTED_VOLUMES_ID);
- connectionName = toolChain
- .getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI);
- imageName = toolChain
- .getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
+ connectionName = toolChain.getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI);
+ imageName = toolChain.getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
} else {
- ICConfigurationDescription cfgd = CoreModel.getDefault()
- .getProjectDescription(fProject).getActiveConfiguration();
- IConfiguration cfg = ManagedBuildManager
- .getConfigurationForDescription(cfgd);
+ ICConfigurationDescription cfgd = CoreModel.getDefault().getProjectDescription(fProject)
+ .getActiveConfiguration();
+ IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgd);
if (cfg == null) {
return null;
}
IOptionalBuildProperties props = cfg.getOptionalBuildProperties();
selectedVolumeString = props.getProperty(SELECTED_VOLUMES_ID);
- connectionName = props
- .getProperty(ContainerCommandLauncher.CONNECTION_ID);
+ connectionName = props.getProperty(ContainerCommandLauncher.CONNECTION_ID);
imageName = props.getProperty(ContainerCommandLauncher.IMAGE_ID);
}
// Add any specified volumes to additional dir list
if (selectedVolumeString != null && !selectedVolumeString.isEmpty()) {
- String[] selectedVolumes = selectedVolumeString
- .split(VOLUME_SEPARATOR_REGEX);
+ String[] selectedVolumes = selectedVolumeString.split(VOLUME_SEPARATOR_REGEX);
if (Platform.getOS().equals(Platform.OS_WIN32)) {
for (String selectedVolume : selectedVolumes) {
IPath path = new Path(selectedVolume);
@@ -311,13 +294,8 @@ public class ContainerCommandLauncher
}
setImageName(imageName);
- fProcess = launcher.runCommand(connectionName, imageName, fProject,
- this,
- cmdList,
- workingDir,
- additionalDirs,
- origEnv, fEnvironment, supportStdin, privilegedMode,
- labels, keepContainer);
+ fProcess = launcher.runCommand(connectionName, imageName, fProject, this, cmdList, workingDir, additionalDirs,
+ origEnv, fEnvironment, supportStdin, privilegedMode, labels, keepContainer);
return fProcess;
}
@@ -333,13 +311,11 @@ public class ContainerCommandLauncher
} catch (CoreException e) {
return imageName;
}
- imageName = toolChain
- .getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
+ imageName = toolChain.getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
} else {
- ICConfigurationDescription cfgd = CoreModel.getDefault()
- .getProjectDescription(fProject).getActiveConfiguration();
- IConfiguration cfg = ManagedBuildManager
- .getConfigurationForDescription(cfgd);
+ ICConfigurationDescription cfgd = CoreModel.getDefault().getProjectDescription(fProject)
+ .getActiveConfiguration();
+ IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgd);
if (cfg == null) {
return imageName;
}
@@ -385,8 +361,7 @@ public class ContainerCommandLauncher
}
@Override
- public int waitAndRead(OutputStream output, OutputStream err,
- IProgressMonitor monitor) {
+ public int waitAndRead(OutputStream output, OutputStream err, IProgressMonitor monitor) {
printImageHeader(output);
if (fShowCommand) {
@@ -442,10 +417,8 @@ public class ContainerCommandLauncher
protected void printImageHeader(OutputStream os) {
if (os != null) {
try {
- os.write(NLS
- .bind(Messages.ContainerCommandLauncher_image_msg,
- ((ContainerCommandProcess) fProcess).getImage())
- .getBytes());
+ os.write(NLS.bind(Messages.ContainerCommandLauncher_image_msg,
+ ((ContainerCommandProcess) fProcess).getImage()).getBytes());
os.write(NEWLINE.getBytes());
os.flush();
} catch (IOException e) {
@@ -456,15 +429,13 @@ public class ContainerCommandLauncher
@Override
public String getConsoleHeader() {
- return NLS.bind(Messages.ContainerCommandLauncher_image_msg,
- calculateImageName()) + NEWLINE;
+ return NLS.bind(Messages.ContainerCommandLauncher_image_msg, calculateImageName()) + NEWLINE;
}
protected void printCommandLine(OutputStream os) {
if (os != null) {
try {
- os.write(getCommandLineQuoted(getCommandArgs(), true)
- .getBytes());
+ os.write(getCommandLineQuoted(getCommandArgs(), true).getBytes());
os.flush();
} catch (IOException e) {
// ignore;
@@ -477,11 +448,8 @@ public class ContainerCommandLauncher
StringBuilder buf = new StringBuilder();
if (commandArgs != null) {
for (String commandArg : commandArgs) {
- if (quote && (commandArg.contains(" ")
- || commandArg.contains("\"")
- || commandArg.contains("\\"))) {
- commandArg = '"' + commandArg.replaceAll("\\\\", "\\\\\\\\")
- .replaceAll("\"", "\\\\\"") + '"';
+ if (quote && (commandArg.contains(" ") || commandArg.contains("\"") || commandArg.contains("\\"))) {
+ commandArg = '"' + commandArg.replaceAll("\\\\", "\\\\\\\\").replaceAll("\"", "\\\\\"") + '"';
}
buf.append(commandArg);
buf.append(' ');
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java
index f2c5a88f1b..3cfb3df417 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerCommandLauncherFactory.java
@@ -45,8 +45,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.linuxtools.docker.ui.launch.ContainerLauncher;
@SuppressWarnings("restriction")
-public class ContainerCommandLauncherFactory
- implements ICommandLauncherFactory, ICommandLauncherFactory2 {
+public class ContainerCommandLauncherFactory implements ICommandLauncherFactory, ICommandLauncherFactory2 {
private IProject project;
@@ -55,16 +54,14 @@ public class ContainerCommandLauncherFactory
public ICommandLauncher getCommandLauncher(IProject project) {
this.project = project;
// check if container build enablement has been checked
- ICConfigurationDescription cfgd = CoreModel.getDefault()
- .getProjectDescription(project, false)
- .getActiveConfiguration();
+ ICConfigurationDescription cfgd = CoreModel.getDefault().getProjectDescription(project, false)
+ .getActiveConfiguration();
IConfiguration cfg = null;
try {
if (cfgd instanceof CConfigurationDescriptionCache) {
- CConfigurationData data = ((CConfigurationDescriptionCache) cfgd)
- .getConfigurationData();
+ CConfigurationData data = ((CConfigurationDescriptionCache) cfgd).getConfigurationData();
if (data instanceof BuildConfigurationData) {
cfg = ((BuildConfigurationData) data).getConfiguration();
}
@@ -83,11 +80,9 @@ public class ContainerCommandLauncherFactory
IOptionalBuildProperties props = cfg.getOptionalBuildProperties();
if (props != null) {
- String enablementProperty = props.getProperty(
- ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
+ String enablementProperty = props.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
if (enablementProperty != null) {
- boolean enableContainer = Boolean
- .parseBoolean(enablementProperty);
+ boolean enableContainer = Boolean.parseBoolean(enablementProperty);
// enablement has occurred, we can return a
// ContainerCommandLauncher
if (enableContainer) {
@@ -99,11 +94,9 @@ public class ContainerCommandLauncherFactory
}
@Override
- public ICommandLauncher getCommandLauncher(
- ICConfigurationDescription cfgd) {
+ public ICommandLauncher getCommandLauncher(ICConfigurationDescription cfgd) {
// check if container build enablement has been checked
- IConfiguration cfg = ManagedBuildManager
- .getConfigurationForDescription(cfgd);
+ IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgd);
// TODO: figure out why this occurs
if (cfg == null) {
return null;
@@ -111,11 +104,9 @@ public class ContainerCommandLauncherFactory
this.project = (IProject) cfg.getManagedProject().getOwner();
IOptionalBuildProperties props = cfg.getOptionalBuildProperties();
if (props != null) {
- String enablementProperty = props.getProperty(
- ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
+ String enablementProperty = props.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
if (enablementProperty != null) {
- boolean enableContainer = Boolean
- .parseBoolean(enablementProperty);
+ boolean enableContainer = Boolean.parseBoolean(enablementProperty);
// enablement has occurred, we can return a
// ContainerCommandLauncher
if (enableContainer) {
@@ -138,8 +129,7 @@ public class ContainerCommandLauncherFactory
try {
toolchain = cfgd.getToolChain();
if (toolchain != null) {
- if (ContainerTargetTypeProvider.CONTAINER_LINUX
- .equals(toolchain.getProperty(IToolChain.ATTR_OS))) {
+ if (ContainerTargetTypeProvider.CONTAINER_LINUX.equals(toolchain.getProperty(IToolChain.ATTR_OS))) {
return new ContainerCommandLauncher();
}
}
@@ -150,30 +140,23 @@ public class ContainerCommandLauncherFactory
}
@Override
- public void registerLanguageSettingEntries(IProject project,
- List<? extends ICLanguageSettingEntry> langEntries) {
+ public void registerLanguageSettingEntries(IProject project, List<? extends ICLanguageSettingEntry> langEntries) {
@SuppressWarnings("unchecked")
List<ICLanguageSettingEntry> entries = (List<ICLanguageSettingEntry>) langEntries;
- ICConfigurationDescription cfgd = CoreModel.getDefault()
- .getProjectDescription(project).getActiveConfiguration();
- IConfiguration cfg = ManagedBuildManager
- .getConfigurationForDescription(cfgd);
+ ICConfigurationDescription cfgd = CoreModel.getDefault().getProjectDescription(project)
+ .getActiveConfiguration();
+ IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgd);
IOptionalBuildProperties props = cfg.getOptionalBuildProperties();
if (props != null) {
- String enablementProperty = props.getProperty(
- ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
+ String enablementProperty = props.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
if (enablementProperty != null) {
- boolean enableContainer = Boolean
- .parseBoolean(enablementProperty);
+ boolean enableContainer = Boolean.parseBoolean(enablementProperty);
if (enableContainer) {
- String connectionName = props.getProperty(
- ContainerCommandLauncher.CONNECTION_ID);
- String imageName = props
- .getProperty(ContainerCommandLauncher.IMAGE_ID);
- if (connectionName == null || connectionName.isEmpty()
- || imageName == null || imageName.isEmpty()) {
- DockerLaunchUIPlugin.logErrorMessage(
- Messages.ContainerCommandLauncher_invalid_values);
+ String connectionName = props.getProperty(ContainerCommandLauncher.CONNECTION_ID);
+ String imageName = props.getProperty(ContainerCommandLauncher.IMAGE_ID);
+ if (connectionName == null || connectionName.isEmpty() || imageName == null
+ || imageName.isEmpty()) {
+ DockerLaunchUIPlugin.logErrorMessage(Messages.ContainerCommandLauncher_invalid_values);
return;
}
ContainerLauncher launcher = new ContainerLauncher();
@@ -189,12 +172,10 @@ public class ContainerCommandLauncherFactory
// the directory name as the connection may be
// connected to a different repo using the same
// image name.
- IPath pluginPath = Platform.getStateLocation(Platform
- .getBundle(DockerLaunchUIPlugin.PLUGIN_ID))
+ IPath pluginPath = Platform.getStateLocation(Platform.getBundle(DockerLaunchUIPlugin.PLUGIN_ID))
.append("HEADERS"); //$NON-NLS-1$
pluginPath.toFile().mkdir();
- pluginPath = pluginPath
- .append(getCleanName(connectionName));
+ pluginPath = pluginPath.append(getCleanName(connectionName));
pluginPath.toFile().mkdir();
// To allow the user to later manage the headers, store
// the
@@ -204,16 +185,14 @@ public class ContainerCommandLauncherFactory
try {
f.createNewFile();
try (FileWriter writer = new FileWriter(f);
- BufferedWriter bufferedWriter = new BufferedWriter(
- writer);) {
+ BufferedWriter bufferedWriter = new BufferedWriter(writer);) {
bufferedWriter.write(connectionName);
bufferedWriter.newLine();
} catch (IOException e) {
DockerLaunchUIPlugin.log(e);
return;
}
- pluginPath = pluginPath
- .append(getCleanName(imageName));
+ pluginPath = pluginPath.append(getCleanName(imageName));
pluginPath.toFile().mkdir();
// To allow the user to later manage the headers,
// store the
@@ -222,8 +201,7 @@ public class ContainerCommandLauncherFactory
f = imageNamePath.toFile();
f.createNewFile();
try (FileWriter writer = new FileWriter(f);
- BufferedWriter bufferedWriter = new BufferedWriter(
- writer);) {
+ BufferedWriter bufferedWriter = new BufferedWriter(writer);) {
bufferedWriter.write(imageName);
bufferedWriter.newLine();
} catch (IOException e) {
@@ -238,9 +216,8 @@ public class ContainerCommandLauncherFactory
List<String> excludeList = new ArrayList<>();
excludeList.add(project.getLocation().toString());
@SuppressWarnings("unused")
- int status = launcher.fetchContainerDirs(connectionName,
- imageName,
- paths, excludeList, hostDir);
+ int status = launcher.fetchContainerDirs(connectionName, imageName, paths, excludeList,
+ hostDir);
}
}
}
@@ -258,8 +235,7 @@ public class ContainerCommandLauncherFactory
try {
toolchain = cfgd.getToolChain();
if (toolchain != null) {
- if (ContainerTargetTypeProvider.CONTAINER_LINUX
- .equals(toolchain.getProperty(IToolChain.ATTR_OS))) {
+ if (ContainerTargetTypeProvider.CONTAINER_LINUX.equals(toolchain.getProperty(IToolChain.ATTR_OS))) {
isContainerEnabled = true;
}
}
@@ -268,14 +244,10 @@ public class ContainerCommandLauncherFactory
}
if (isContainerEnabled) {
- String connectionName = toolchain
- .getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI);
- String imageName = toolchain
- .getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
- if (connectionName == null || connectionName.isEmpty()
- || imageName == null || imageName.isEmpty()) {
- DockerLaunchUIPlugin.logErrorMessage(
- Messages.ContainerCommandLauncher_invalid_values);
+ String connectionName = toolchain.getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI);
+ String imageName = toolchain.getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
+ if (connectionName == null || connectionName.isEmpty() || imageName == null || imageName.isEmpty()) {
+ DockerLaunchUIPlugin.logErrorMessage(Messages.ContainerCommandLauncher_invalid_values);
return includePaths;
}
if (includePaths.size() > 0) {
@@ -285,9 +257,7 @@ public class ContainerCommandLauncherFactory
// the directory name as the connection may be
// connected to a different repo using the same
// image name.
- IPath pluginPath = Platform
- .getStateLocation(Platform
- .getBundle(DockerLaunchUIPlugin.PLUGIN_ID))
+ IPath pluginPath = Platform.getStateLocation(Platform.getBundle(DockerLaunchUIPlugin.PLUGIN_ID))
.append("HEADERS"); //$NON-NLS-1$
pluginPath.toFile().mkdir();
pluginPath = pluginPath.append(getCleanName(connectionName));
@@ -300,8 +270,7 @@ public class ContainerCommandLauncherFactory
try {
f.createNewFile();
try (FileWriter writer = new FileWriter(f);
- BufferedWriter bufferedWriter = new BufferedWriter(
- writer);) {
+ BufferedWriter bufferedWriter = new BufferedWriter(writer);) {
bufferedWriter.write(connectionName);
bufferedWriter.newLine();
} catch (IOException e) {
@@ -317,8 +286,7 @@ public class ContainerCommandLauncherFactory
f = imageNamePath.toFile();
f.createNewFile();
try (FileWriter writer = new FileWriter(f);
- BufferedWriter bufferedWriter = new BufferedWriter(
- writer);) {
+ BufferedWriter bufferedWriter = new BufferedWriter(writer);) {
bufferedWriter.write(imageName);
bufferedWriter.newLine();
} catch (IOException e) {
@@ -333,11 +301,10 @@ public class ContainerCommandLauncherFactory
// exclude project directories from any copying operation
List<String> excludeList = new ArrayList<>();
excludeList.add(project.getLocation().toString());
- int status = launcher.fetchContainerDirsSync(connectionName,
- imageName, includePaths, excludeList, hostDir);
+ int status = launcher.fetchContainerDirsSync(connectionName, imageName, includePaths, excludeList,
+ hostDir);
if (status == 0) {
- Set<String> copiedVolumes = launcher
- .getCopiedVolumes(connectionName, imageName);
+ Set<String> copiedVolumes = launcher.getCopiedVolumes(connectionName, imageName);
List<String> newEntries = new ArrayList<>();
for (String path : includePaths) {
@@ -359,9 +326,7 @@ public class ContainerCommandLauncherFactory
// the headers will be recopied)
// TODO: fix this in a minor release to be an additional method
// that can be registered by the removal of the header files
- IPath pluginPath = Platform
- .getStateLocation(Platform
- .getBundle(DockerLaunchUIPlugin.PLUGIN_ID))
+ IPath pluginPath = Platform.getStateLocation(Platform.getBundle(DockerLaunchUIPlugin.PLUGIN_ID))
.append("HEADERS").append(getCleanName(connectionName)) //$NON-NLS-1$
.append(getCleanName(imageName));
toolchain.setProperty("cdt.needScannerRefresh", //$NON-NLS-1$
@@ -372,53 +337,41 @@ public class ContainerCommandLauncherFactory
}
@Override
- public List<ICLanguageSettingEntry> verifyLanguageSettingEntries(
- IProject project, List<ICLanguageSettingEntry> entries) {
+ public List<ICLanguageSettingEntry> verifyLanguageSettingEntries(IProject project,
+ List<ICLanguageSettingEntry> entries) {
if (entries == null) {
return null;
}
- ICConfigurationDescription cfgd = CoreModel.getDefault()
- .getProjectDescription(project).getActiveConfiguration();
- IConfiguration cfg = ManagedBuildManager
- .getConfigurationForDescription(cfgd);
+ ICConfigurationDescription cfgd = CoreModel.getDefault().getProjectDescription(project)
+ .getActiveConfiguration();
+ IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgd);
IOptionalBuildProperties props = cfg.getOptionalBuildProperties();
if (props != null) {
- String enablementProperty = props.getProperty(
- ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
+ String enablementProperty = props.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
if (enablementProperty != null) {
- boolean enableContainer = Boolean
- .parseBoolean(enablementProperty);
+ boolean enableContainer = Boolean.parseBoolean(enablementProperty);
if (enableContainer) {
- String connectionName = props.getProperty(
- ContainerCommandLauncher.CONNECTION_ID);
- String imageName = props
- .getProperty(ContainerCommandLauncher.IMAGE_ID);
- if (connectionName == null || connectionName.isEmpty()
- || imageName == null || imageName.isEmpty()) {
- DockerLaunchUIPlugin.logErrorMessage(
- Messages.ContainerCommandLauncher_invalid_values);
+ String connectionName = props.getProperty(ContainerCommandLauncher.CONNECTION_ID);
+ String imageName = props.getProperty(ContainerCommandLauncher.IMAGE_ID);
+ if (connectionName == null || connectionName.isEmpty() || imageName == null
+ || imageName.isEmpty()) {
+ DockerLaunchUIPlugin.logErrorMessage(Messages.ContainerCommandLauncher_invalid_values);
return entries;
}
ContainerLauncher launcher = new ContainerLauncher();
- Set<String> copiedVolumes = launcher
- .getCopiedVolumes(connectionName, imageName);
+ Set<String> copiedVolumes = launcher.getCopiedVolumes(connectionName, imageName);
List<ICLanguageSettingEntry> newEntries = new ArrayList<>();
- IPath pluginPath = Platform.getStateLocation(
- Platform.getBundle(DockerLaunchUIPlugin.PLUGIN_ID));
+ IPath pluginPath = Platform.getStateLocation(Platform.getBundle(DockerLaunchUIPlugin.PLUGIN_ID));
IPath hostDir = pluginPath.append("HEADERS") //$NON-NLS-1$
- .append(getCleanName(connectionName))
- .append(getCleanName(imageName));
+ .append(getCleanName(connectionName)).append(getCleanName(imageName));
for (ICLanguageSettingEntry entry : entries) {
if (entry instanceof ICIncludePathEntry) {
- if (copiedVolumes
- .contains(((ICIncludePathEntry) entry)
- .getName().toString())) {
- // //$NON-NLS-2$
+ if (copiedVolumes.contains(((ICIncludePathEntry) entry).getName().toString())) {
+ // //$NON-NLS-2$
IPath newPath = hostDir.append(entry.getName());
- CIncludePathEntry newEntry = new CIncludePathEntry(
- newPath.toString(),
+ CIncludePathEntry newEntry = new CIncludePathEntry(newPath.toString(),
entry.getFlags());
newEntries.add(newEntry);
continue;
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerTargetTypeProvider.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerTargetTypeProvider.java
index 24de64e412..1b20e3ca29 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerTargetTypeProvider.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/ContainerTargetTypeProvider.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - modified for use with Docker Container launching
*******************************************************************************/
@@ -46,8 +46,7 @@ import org.eclipse.linuxtools.docker.core.IDockerImage;
* @author jjohnstn
*
*/
-public class ContainerTargetTypeProvider
- implements ILaunchTargetProvider, IDockerConnectionManagerListener {
+public class ContainerTargetTypeProvider implements ILaunchTargetProvider, IDockerConnectionManagerListener {
public static final String TYPE_ID = "org.eclipse.cdt.docker.launcher.launchTargetType.container"; //$NON-NLS-1$
public static final String CONTAINER_LINUX = "linux-container"; //$NON-NLS-1$
@@ -57,24 +56,21 @@ public class ContainerTargetTypeProvider
@Override
public synchronized void init(ILaunchTargetManager targetManager) {
this.targetManager = targetManager;
- ILaunchBarManager launchbarManager = CDebugCorePlugin
- .getService(ILaunchBarManager.class);
+ ILaunchBarManager launchbarManager = CDebugCorePlugin.getService(ILaunchBarManager.class);
ILaunchTarget defaultTarget = null;
try {
defaultTarget = launchbarManager.getActiveLaunchTarget();
} catch (CoreException e) {
// ignore
}
- IDockerConnection[] connections = DockerConnectionManager.getInstance()
- .getConnections();
+ IDockerConnection[] connections = DockerConnectionManager.getInstance().getConnections();
Map<String, IDockerConnection> establishedConnectionMap = new HashMap<>();
Set<String> imageNames = new HashSet<>();
for (IDockerConnection connection : connections) {
// Get Images before checking state as the state may be
// unknown until a request is made
List<IDockerImage> images = connection.getImages();
- if (connection
- .getState() == EnumDockerConnectionState.ESTABLISHED) {
+ if (connection.getState() == EnumDockerConnectionState.ESTABLISHED) {
establishedConnectionMap.put(connection.getUri(), connection);
}
for (IDockerImage image : images) {
@@ -87,20 +83,15 @@ public class ContainerTargetTypeProvider
imageName += "[" + connection.getName() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
}
imageNames.add(imageName);
- ILaunchTarget target = targetManager
- .getLaunchTarget(TYPE_ID, imageName);
+ ILaunchTarget target = targetManager.getLaunchTarget(TYPE_ID, imageName);
if (target == null) {
- target = targetManager.addLaunchTarget(TYPE_ID,
- imageName);
+ target = targetManager.addLaunchTarget(TYPE_ID, imageName);
}
ILaunchTargetWorkingCopy wc = target.getWorkingCopy();
wc.setAttribute(ILaunchTarget.ATTR_OS, CONTAINER_LINUX);
- wc.setAttribute(ILaunchTarget.ATTR_ARCH,
- Platform.getOSArch());
- wc.setAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI,
- connection.getUri());
- wc.setAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID,
- image.repoTags().get(0));
+ wc.setAttribute(ILaunchTarget.ATTR_ARCH, Platform.getOSArch());
+ wc.setAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI, connection.getUri());
+ wc.setAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, image.repoTags().get(0));
wc.save();
}
@@ -111,8 +102,7 @@ public class ContainerTargetTypeProvider
ILaunchTarget[] targets = targetManager.getLaunchTargetsOfType(TYPE_ID);
for (ILaunchTarget target : targets) {
try {
- String uri = target.getAttribute(
- IContainerLaunchTarget.ATTR_CONNECTION_URI, ""); //$NON-NLS-1$
+ String uri = target.getAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI, ""); //$NON-NLS-1$
if (!establishedConnectionMap.containsKey(uri)) {
targetManager.removeLaunchTarget(target);
}
@@ -123,8 +113,7 @@ public class ContainerTargetTypeProvider
// add a Docker Connection listener to handle enablement/disablement of
// Connections
- DockerConnectionManager.getInstance()
- .addConnectionManagerListener(this);
+ DockerConnectionManager.getInstance().addConnectionManagerListener(this);
// re-check configs in case an enabled Connection has made old configs
// valid again do this in a separate job to prevent a possible
@@ -136,8 +125,7 @@ public class ContainerTargetTypeProvider
// call the recheckConfigs method in case any disabled targets
// are now
// ok
- ICBuildConfigurationManager mgr = CCorePlugin
- .getService(ICBuildConfigurationManager.class);
+ ICBuildConfigurationManager mgr = CCorePlugin.getService(ICBuildConfigurationManager.class);
ICBuildConfigurationManager2 cbuildmanager = (ICBuildConfigurationManager2) mgr;
cbuildmanager.recheckConfigs();
return Status.OK_STATUS;
@@ -161,32 +149,27 @@ public class ContainerTargetTypeProvider
}
@Override
- public synchronized void changeEvent(final IDockerConnection connection,
- final int type) {
+ public synchronized void changeEvent(final IDockerConnection connection, final int type) {
Job checkConfigs = new Job("Check configs") { //$NON-NLS-1$
@Override
protected IStatus run(IProgressMonitor monitor) {
- ICBuildConfigurationManager mgr = CCorePlugin
- .getService(ICBuildConfigurationManager.class);
+ ICBuildConfigurationManager mgr = CCorePlugin.getService(ICBuildConfigurationManager.class);
ICBuildConfigurationManager2 manager = (ICBuildConfigurationManager2) mgr;
if (type == IDockerConnectionManagerListener.ADD_EVENT
|| type == IDockerConnectionManagerListener.ENABLE_EVENT) {
- ILaunchBarManager launchbarManager = CDebugCorePlugin
- .getService(ILaunchBarManager.class);
+ ILaunchBarManager launchbarManager = CDebugCorePlugin.getService(ILaunchBarManager.class);
ILaunchTarget defaultTarget = null;
try {
- defaultTarget = launchbarManager
- .getActiveLaunchTarget();
+ defaultTarget = launchbarManager.getActiveLaunchTarget();
} catch (CoreException e) {
// ignore
}
List<IDockerImage> images = connection.getImages();
for (IDockerImage image : images) {
- if (!image.isDangling()
- && !image.isIntermediateImage()) {
+ if (!image.isDangling() && !image.isIntermediateImage()) {
String imageName = "[" //$NON-NLS-1$
+ image.repoTags().get(0).replace(':', '_')
@@ -194,35 +177,24 @@ public class ContainerTargetTypeProvider
+ "]"; //$NON-NLS-1$
String imageName2 = imageName + "[" //$NON-NLS-1$
+ connection.getName() + "]"; //$NON-NLS-1$
- ILaunchTarget target = targetManager
- .getLaunchTarget(TYPE_ID, imageName2);
+ ILaunchTarget target = targetManager.getLaunchTarget(TYPE_ID, imageName2);
if (target != null) {
continue;
}
- target = targetManager.getLaunchTarget(TYPE_ID,
- imageName);
+ target = targetManager.getLaunchTarget(TYPE_ID, imageName);
if (target != null) {
- if (target.getAttribute(
- IContainerLaunchTarget.ATTR_CONNECTION_URI,
- "").equals(connection.getUri())) {
+ if (target.getAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI, "")
+ .equals(connection.getUri())) {
continue;
}
imageName = imageName2;
}
- target = targetManager.addLaunchTarget(TYPE_ID,
- imageName);
- ILaunchTargetWorkingCopy wc = target
- .getWorkingCopy();
- wc.setAttribute(ILaunchTarget.ATTR_OS,
- CONTAINER_LINUX);
- wc.setAttribute(ILaunchTarget.ATTR_ARCH,
- Platform.getOSArch());
- wc.setAttribute(
- IContainerLaunchTarget.ATTR_CONNECTION_URI,
- connection.getUri());
- wc.setAttribute(
- IContainerLaunchTarget.ATTR_IMAGE_ID,
- image.repoTags().get(0));
+ target = targetManager.addLaunchTarget(TYPE_ID, imageName);
+ ILaunchTargetWorkingCopy wc = target.getWorkingCopy();
+ wc.setAttribute(ILaunchTarget.ATTR_OS, CONTAINER_LINUX);
+ wc.setAttribute(ILaunchTarget.ATTR_ARCH, Platform.getOSArch());
+ wc.setAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI, connection.getUri());
+ wc.setAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, image.repoTags().get(0));
wc.save();
}
@@ -231,8 +203,7 @@ public class ContainerTargetTypeProvider
// reset the default target back again
if (defaultTarget != null) {
try {
- launchbarManager
- .setActiveLaunchTarget(defaultTarget);
+ launchbarManager.setActiveLaunchTarget(defaultTarget);
} catch (CoreException e) {
DockerLaunchUIPlugin.log(e);
}
@@ -245,11 +216,9 @@ public class ContainerTargetTypeProvider
} else if (type == IDockerConnectionManagerListener.REMOVE_EVENT
|| type == IDockerConnectionManagerListener.DISABLE_EVENT) {
String connectionURI = connection.getUri();
- ILaunchTarget[] targets = targetManager
- .getLaunchTargetsOfType(TYPE_ID);
+ ILaunchTarget[] targets = targetManager.getLaunchTargetsOfType(TYPE_ID);
for (ILaunchTarget target : targets) {
- String uri = target.getAttribute(
- IContainerLaunchTarget.ATTR_CONNECTION_URI, ""); //$NON-NLS-1$
+ String uri = target.getAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI, ""); //$NON-NLS-1$
if (connectionURI.equals(uri)) {
targetManager.removeLaunchTarget(target);
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/DockerLaunchUIPlugin.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/DockerLaunchUIPlugin.java
index 3af7500fdf..85ab18f8bb 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/DockerLaunchUIPlugin.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/DockerLaunchUIPlugin.java
@@ -24,7 +24,7 @@ import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
- *
+ *
* @noextend This class is not intended to be subclassed by Clients
*/
public class DockerLaunchUIPlugin extends AbstractUIPlugin {
@@ -43,7 +43,7 @@ public class DockerLaunchUIPlugin extends AbstractUIPlugin {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
* )
@@ -56,7 +56,7 @@ public class DockerLaunchUIPlugin extends AbstractUIPlugin {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
* )
@@ -76,8 +76,7 @@ public class DockerLaunchUIPlugin extends AbstractUIPlugin {
}
public static Shell getActiveWorkbenchShell() {
- IWorkbenchWindow window = getDefault().getWorkbench()
- .getActiveWorkbenchWindow();
+ IWorkbenchWindow window = getDefault().getWorkbench().getActiveWorkbenchWindow();
if (window != null) {
return window.getShell();
}
@@ -88,14 +87,13 @@ public class DockerLaunchUIPlugin extends AbstractUIPlugin {
if (getActiveWorkbenchShell() != null) {
return getActiveWorkbenchShell();
}
- IWorkbenchWindow[] windows = getDefault().getWorkbench()
- .getWorkbenchWindows();
+ IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows();
return windows[0].getShell();
}
/**
* Convenience method which returns the unique identifier of this plugin.
- *
+ *
* @return The identifier.
*/
public static String getUniqueIdentifier() {
@@ -127,8 +125,7 @@ public class DockerLaunchUIPlugin extends AbstractUIPlugin {
* @since 1.1
*/
public static void logErrorMessage(String message) {
- log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR,
- message, null));
+ log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, message, null));
}
/**
@@ -138,8 +135,7 @@ public class DockerLaunchUIPlugin extends AbstractUIPlugin {
* the exception to be logged
*/
public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR,
- e.getMessage(), e));
+ log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, e.getMessage(), e));
}
public static void log(int status, String msg, Throwable e) {
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/IContainerLaunchTarget.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/IContainerLaunchTarget.java
index 3b430d9d1e..01a2c92134 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/IContainerLaunchTarget.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/docker/launcher/IContainerLaunchTarget.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial contribution
*******************************************************************************/
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/BaseDatabindingModel.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/BaseDatabindingModel.java
index 7e68e58649..1049a27549 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/BaseDatabindingModel.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/BaseDatabindingModel.java
@@ -19,7 +19,7 @@ import java.beans.PropertyChangeSupport;
/**
* Base class for all model classes that need Databinding support
- *
+ *
*/
public abstract class BaseDatabindingModel {
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ConnectionListener.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ConnectionListener.java
index aec3d7eb68..d5ba9bd686 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ConnectionListener.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ConnectionListener.java
@@ -39,9 +39,7 @@ public class ConnectionListener implements ISelectionListener {
if (workbench != null) {
IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
if (window != null) {
- window.getSelectionService()
- .addSelectionListener(
- "org.eclipse.linuxtools.docker.ui.dockerExplorerView", //$NON-NLS-1$
+ window.getSelectionService().addSelectionListener("org.eclipse.linuxtools.docker.ui.dockerExplorerView", //$NON-NLS-1$
this);
}
}
@@ -57,8 +55,7 @@ public class ConnectionListener implements ISelectionListener {
if (treeSelection.isEmpty()) {
return;
}
- final Object firstSegment = treeSelection.getPaths()[0]
- .getFirstSegment();
+ final Object firstSegment = treeSelection.getPaths()[0].getFirstSegment();
if (firstSegment instanceof IDockerConnection) {
currentConnection = (IDockerConnection) firstSegment;
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerDataVolumeDialog.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerDataVolumeDialog.java
index 890fca8fb9..75f4626aa4 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerDataVolumeDialog.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerDataVolumeDialog.java
@@ -75,8 +75,7 @@ public class ContainerDataVolumeDialog extends Dialog {
private final IDockerConnection connection;
- public ContainerDataVolumeDialog(final Shell parentShell,
- final IDockerConnection connection,
+ public ContainerDataVolumeDialog(final Shell parentShell, final IDockerConnection connection,
final DataVolumeModel selectedDataVolume) {
super(parentShell);
this.connection = connection;
@@ -84,8 +83,7 @@ public class ContainerDataVolumeDialog extends Dialog {
this.containerNames = WizardUtils.getContainerNames(connection);
}
- public ContainerDataVolumeDialog(final Shell parentShell,
- final IDockerConnection connection) {
+ public ContainerDataVolumeDialog(final Shell parentShell, final IDockerConnection connection) {
super(parentShell);
this.connection = connection;
this.model = new DataVolumeModel();
@@ -100,18 +98,15 @@ public class ContainerDataVolumeDialog extends Dialog {
protected void configureShell(final Shell shell) {
super.configureShell(shell);
setShellStyle(getShellStyle() | SWT.RESIZE);
- shell.setText(
- WizardMessages.getString("ContainerDataVolumeDialog.title")); //$NON-NLS-1$
+ shell.setText(WizardMessages.getString("ContainerDataVolumeDialog.title")); //$NON-NLS-1$
}
/**
* Disable the 'OK' button by default
*/
@Override
- protected Button createButton(Composite parent, int id, String label,
- boolean defaultButton) {
- final Button button = super.createButton(parent, id, label,
- defaultButton);
+ protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
+ final Button button = super.createButton(parent, id, label, defaultButton);
if (id == IDialogConstants.OK_ID) {
button.setEnabled(false);
}
@@ -127,172 +122,121 @@ public class ContainerDataVolumeDialog extends Dialog {
protected Control createDialogArea(final Composite parent) {
final Composite container = new Composite(parent, SWT.NONE);
final int COLUMNS = 3;
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).span(1, 1)
- .grab(true, true).applyTo(container);
- GridLayoutFactory.fillDefaults().margins(10, 10).numColumns(COLUMNS)
- .applyTo(container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).span(1, 1).grab(true, true).applyTo(container);
+ GridLayoutFactory.fillDefaults().margins(10, 10).numColumns(COLUMNS).applyTo(container);
// Container path
final Label containerPathLabel = new Label(container, SWT.NONE);
- containerPathLabel.setText(WizardMessages
- .getString("ContainerDataVolumeDialog.containerPathLabel")); //$NON-NLS-1$
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(false, false).applyTo(containerPathLabel);
+ containerPathLabel.setText(WizardMessages.getString("ContainerDataVolumeDialog.containerPathLabel")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(containerPathLabel);
final Text containerPathText = new Text(container, SWT.BORDER);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(true, false).applyTo(containerPathText);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(containerPathText);
final IObservableValue containerPathObservable = BeanProperties
- .value(DataVolumeModel.class, DataVolumeModel.CONTAINER_PATH)
- .observe(model);
- dbc.bindValue(
- WidgetProperties.text(SWT.Modify).observe(containerPathText),
- containerPathObservable);
+ .value(DataVolumeModel.class, DataVolumeModel.CONTAINER_PATH).observe(model);
+ dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(containerPathText), containerPathObservable);
// mount type
final Label explanationLabel = new Label(container, SWT.NONE);
- explanationLabel.setText(WizardMessages
- .getString("ContainerDataVolumeDialog.explanationLabel")); //$NON-NLS-1$
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .span(COLUMNS, 1).grab(true, false).applyTo(explanationLabel);
+ explanationLabel.setText(WizardMessages.getString("ContainerDataVolumeDialog.explanationLabel")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(COLUMNS, 1).grab(true, false)
+ .applyTo(explanationLabel);
final int INDENT = 20;
// No mount
final Button noMountButton = new Button(container, SWT.RADIO);
- noMountButton.setText(WizardMessages
- .getString("ContainerDataVolumeDialog.noMountButton")); //$NON-NLS-1$
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .indent(INDENT, 0).span(COLUMNS, 1).grab(true, false)
+ noMountButton.setText(WizardMessages.getString("ContainerDataVolumeDialog.noMountButton")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(INDENT, 0).span(COLUMNS, 1).grab(true, false)
.applyTo(noMountButton);
bindButton(noMountButton, MountType.NONE);
// File System mount
final Button fileSystemMountButton = new Button(container, SWT.RADIO);
- fileSystemMountButton.setText(WizardMessages
- .getString("ContainerDataVolumeDialog.fileSystemMountButton")); //$NON-NLS-1$
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .indent(INDENT, 0).span(COLUMNS, 1).grab(true, false)
+ fileSystemMountButton.setText(WizardMessages.getString("ContainerDataVolumeDialog.fileSystemMountButton")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(INDENT, 0).span(COLUMNS, 1).grab(true, false)
.applyTo(fileSystemMountButton);
final Label hostPathLabel = new Label(container, SWT.NONE);
- hostPathLabel.setText(WizardMessages
- .getString("ContainerDataVolumeDialog.hostPathLabel")); //$NON-NLS-1$
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .indent(2 * INDENT, SWT.DEFAULT).grab(false, false)
+ hostPathLabel.setText(WizardMessages.getString("ContainerDataVolumeDialog.hostPathLabel")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(2 * INDENT, SWT.DEFAULT).grab(false, false)
.applyTo(hostPathLabel);
final Text hostPathText = new Text(container, SWT.BORDER);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(true, false).applyTo(hostPathText);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(hostPathText);
final IObservableValue hostPathObservable = BeanProperties
- .value(DataVolumeModel.class, DataVolumeModel.HOST_PATH_MOUNT)
- .observe(model);
- dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(hostPathText),
- hostPathObservable);
+ .value(DataVolumeModel.class, DataVolumeModel.HOST_PATH_MOUNT).observe(model);
+ dbc.bindValue(WidgetProperties.text(SWT.Modify).observe(hostPathText), hostPathObservable);
// browse for directory
final Button hostPathDirectoryButton = new Button(container, SWT.NONE);
- hostPathDirectoryButton.setText(WizardMessages
- .getString("ContainerDataVolumeDialog.directoryButton")); //$NON-NLS-1$
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(false, false).applyTo(hostPathDirectoryButton);
+ hostPathDirectoryButton.setText(WizardMessages.getString("ContainerDataVolumeDialog.directoryButton")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(hostPathDirectoryButton);
hostPathDirectoryButton.addSelectionListener(onHostDirectoryPath());
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(false, false).applyTo(new Label(container, SWT.NONE));
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false)
+ .applyTo(new Label(container, SWT.NONE));
// optional read-only access
final Button readOnlyButton = new Button(container, SWT.CHECK);
- readOnlyButton.setText(WizardMessages
- .getString("ContainerDataVolumeDialog.readOnlyButton")); //$NON-NLS-1$
- readOnlyButton.setToolTipText(WizardMessages
- .getString("ContainerDataVolumeDialog.readOnlyButtonTooltip")); //$NON-NLS-1$
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .span(COLUMNS - 2, 1).grab(true, false).applyTo(readOnlyButton);
- final ISWTObservableValue readOnlyButtonObservable = WidgetProperties
- .selection().observe(readOnlyButton);
+ readOnlyButton.setText(WizardMessages.getString("ContainerDataVolumeDialog.readOnlyButton")); //$NON-NLS-1$
+ readOnlyButton.setToolTipText(WizardMessages.getString("ContainerDataVolumeDialog.readOnlyButtonTooltip")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(COLUMNS - 2, 1).grab(true, false)
+ .applyTo(readOnlyButton);
+ final ISWTObservableValue readOnlyButtonObservable = WidgetProperties.selection().observe(readOnlyButton);
dbc.bindValue(readOnlyButtonObservable,
- BeanProperties
- .value(DataVolumeModel.class,
- DataVolumeModel.READ_ONLY_VOLUME)
- .observe(model));
+ BeanProperties.value(DataVolumeModel.class, DataVolumeModel.READ_ONLY_VOLUME).observe(model));
// browse for file
final Button hostPathFileButton = new Button(container, SWT.NONE);
- hostPathFileButton.setText(WizardMessages
- .getString("ContainerDataVolumeDialog.fileButton")); //$NON-NLS-1$
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(false, false).applyTo(hostPathFileButton);
+ hostPathFileButton.setText(WizardMessages.getString("ContainerDataVolumeDialog.fileButton")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(hostPathFileButton);
hostPathFileButton.addSelectionListener(onHostFilePath());
- bindButton(fileSystemMountButton, MountType.HOST_FILE_SYSTEM,
- hostPathText, hostPathDirectoryButton, hostPathFileButton,
- readOnlyButton);
+ bindButton(fileSystemMountButton, MountType.HOST_FILE_SYSTEM, hostPathText, hostPathDirectoryButton,
+ hostPathFileButton, readOnlyButton);
// Container mount
final Button containerMountButton = new Button(container, SWT.RADIO);
- containerMountButton.setText(WizardMessages
- .getString("ContainerDataVolumeDialog.containerMountButton")); //$NON-NLS-1$
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .indent(INDENT, 0).span(COLUMNS, 1).grab(true, false)
+ containerMountButton.setText(WizardMessages.getString("ContainerDataVolumeDialog.containerMountButton")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(INDENT, 0).span(COLUMNS, 1).grab(true, false)
.applyTo(containerMountButton);
final Label containerSelectionLabel = new Label(container, SWT.NONE);
- containerSelectionLabel.setText(WizardMessages.getString(
- "ContainerDataVolumeDialog.containerSelectionLabel")); //$NON-NLS-1$
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .indent(2 * INDENT, SWT.DEFAULT)
+ containerSelectionLabel.setText(WizardMessages.getString("ContainerDataVolumeDialog.containerSelectionLabel")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).indent(2 * INDENT, SWT.DEFAULT)
.applyTo(containerSelectionLabel);
final Combo containerSelectionCombo = new Combo(container, SWT.BORDER);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(true, false).span(1, 1).applyTo(containerSelectionCombo);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(1, 1)
+ .applyTo(containerSelectionCombo);
new ControlDecoration(containerSelectionCombo, SWT.TOP | SWT.LEFT);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(false, false).applyTo(new Label(container, SWT.NONE));
- bindButton(containerMountButton, MountType.CONTAINER,
- containerSelectionCombo);
- final ComboViewer containerSelectionComboViewer = new ComboViewer(
- containerSelectionCombo);
- containerSelectionComboViewer
- .setContentProvider(new ArrayContentProvider());
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false)
+ .applyTo(new Label(container, SWT.NONE));
+ bindButton(containerMountButton, MountType.CONTAINER, containerSelectionCombo);
+ final ComboViewer containerSelectionComboViewer = new ComboViewer(containerSelectionCombo);
+ containerSelectionComboViewer.setContentProvider(new ArrayContentProvider());
containerSelectionComboViewer.setInput(this.containerNames);
final IObservableValue selectedContainerObservable = BeanProperties
- .value(DataVolumeModel.class, DataVolumeModel.CONTAINER_MOUNT)
- .observe(model);
- dbc.bindValue(
- WidgetProperties.selection().observe(containerSelectionCombo),
- selectedContainerObservable);
- new ContentProposalAdapter(containerSelectionCombo,
- new ComboContentAdapter() {
- @Override
- public void insertControlContents(Control control,
- String text, int cursorPosition) {
- final Combo combo = (Combo) control;
- final Point selection = combo.getSelection();
- combo.setText(text);
- selection.x = text.length();
- selection.y = selection.x;
- combo.setSelection(selection);
- }
- }, getContainerNameContentProposalProvider(
- containerSelectionCombo),
- null, null);
+ .value(DataVolumeModel.class, DataVolumeModel.CONTAINER_MOUNT).observe(model);
+ dbc.bindValue(WidgetProperties.selection().observe(containerSelectionCombo), selectedContainerObservable);
+ new ContentProposalAdapter(containerSelectionCombo, new ComboContentAdapter() {
+ @Override
+ public void insertControlContents(Control control, String text, int cursorPosition) {
+ final Combo combo = (Combo) control;
+ final Point selection = combo.getSelection();
+ combo.setText(text);
+ selection.x = text.length();
+ selection.y = selection.x;
+ combo.setSelection(selection);
+ }
+ }, getContainerNameContentProposalProvider(containerSelectionCombo), null, null);
// error message
final Composite errorContainer = new Composite(container, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL)
- .span(COLUMNS, 1).grab(true, true).applyTo(errorContainer);
- GridLayoutFactory.fillDefaults().margins(6, 6).numColumns(2)
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).span(COLUMNS, 1).grab(true, true)
.applyTo(errorContainer);
+ GridLayoutFactory.fillDefaults().margins(6, 6).numColumns(2).applyTo(errorContainer);
final Label errorMessageIcon = new Label(errorContainer, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .hint(20, SWT.DEFAULT)
- .applyTo(errorMessageIcon);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).hint(20, SWT.DEFAULT).applyTo(errorMessageIcon);
final Label errorMessageLabel = new Label(errorContainer, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(true, false)
- .applyTo(errorMessageLabel);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(errorMessageLabel);
setupValidationSupport(errorMessageIcon, errorMessageLabel);
return container;
}
- private void setupValidationSupport(final Label errorMessageIcon,
- final Label errorMessageLabel) {
+ private void setupValidationSupport(final Label errorMessageIcon, final Label errorMessageLabel) {
for (@SuppressWarnings("unchecked")
- Iterator<Binding> iterator = dbc.getBindings().iterator(); iterator
- .hasNext();) {
+ Iterator<Binding> iterator = dbc.getBindings().iterator(); iterator.hasNext();) {
final Binding binding = iterator.next();
- binding.getModel().addChangeListener(onDataVolumeSettingsChanged(
- errorMessageIcon, errorMessageLabel));
+ binding.getModel().addChangeListener(onDataVolumeSettingsChanged(errorMessageIcon, errorMessageLabel));
}
}
@@ -301,7 +245,7 @@ public class ContainerDataVolumeDialog extends Dialog {
* selected, and set the enablement of the associated {@link Control} at the
* same time (ie: the {@link Control} are only enabled when the given
* {@link Button} is selected.
- *
+ *
* @param button
* the {@link Button} to bind
* @param mountType
@@ -311,11 +255,9 @@ public class ContainerDataVolumeDialog extends Dialog {
* selected/unselected.
* @return
*/
- private Binding bindButton(final Button button, final MountType mountType,
- final Control... controls) {
+ private Binding bindButton(final Button button, final MountType mountType, final Control... controls) {
return dbc.bindValue(WidgetProperties.selection().observe(button),
- BeanProperties.value(DataVolumeModel.class,
- DataVolumeModel.MOUNT_TYPE).observe(model),
+ BeanProperties.value(DataVolumeModel.class, DataVolumeModel.MOUNT_TYPE).observe(model),
new UpdateValueStrategy() {
@Override
public Object convert(Object value) {
@@ -327,8 +269,7 @@ public class ContainerDataVolumeDialog extends Dialog {
return null;
}
- private void setEnabled(final Control[] controls,
- final boolean enabled) {
+ private void setEnabled(final Control[] controls, final boolean enabled) {
for (Control control : controls) {
control.setEnabled(enabled);
}
@@ -346,8 +287,7 @@ public class ContainerDataVolumeDialog extends Dialog {
private SelectionListener onHostDirectoryPath() {
return SelectionListener.widgetSelectedAdapter(e -> {
- final DirectoryDialog directoryDialog = new DirectoryDialog(
- getShell());
+ final DirectoryDialog directoryDialog = new DirectoryDialog(getShell());
final String selectedPath = directoryDialog.open();
if (selectedPath != null) {
model.setHostPathMount(selectedPath);
@@ -368,26 +308,23 @@ public class ContainerDataVolumeDialog extends Dialog {
/**
* Creates an {@link IContentProposalProvider} to propose
* {@link IDockerContainer} names based on the current text.
- *
+ *
* @param items
* @return
*/
- private IContentProposalProvider getContainerNameContentProposalProvider(
- final Combo containerSelectionCombo) {
+ private IContentProposalProvider getContainerNameContentProposalProvider(final Combo containerSelectionCombo) {
return (contents, position) -> {
final List<IContentProposal> proposals = new ArrayList<>();
for (String containerName : containerSelectionCombo.getItems()) {
if (containerName.contains(contents)) {
- proposals.add(new ContentProposal(containerName,
- containerName, containerName, position));
+ proposals.add(new ContentProposal(containerName, containerName, containerName, position));
}
}
return proposals.toArray(new IContentProposal[0]);
};
}
- private IChangeListener onDataVolumeSettingsChanged(
- final Label errorMessageIcon, final Label errorMessageLabel) {
+ private IChangeListener onDataVolumeSettingsChanged(final Label errorMessageIcon, final Label errorMessageLabel) {
return event -> {
// skip if dialog has been closed
@@ -402,17 +339,14 @@ public class ContainerDataVolumeDialog extends Dialog {
setOkButtonEnabled(true);
} else if (status.matches(IStatus.WARNING)) {
errorMessageIcon.setVisible(true);
- errorMessageIcon.setImage(
- SWTImagesFactory.DESC_WARNING.createImage());
+ errorMessageIcon.setImage(SWTImagesFactory.DESC_WARNING.createImage());
errorMessageLabel.setVisible(true);
errorMessageLabel.setText(status.getMessage());
setOkButtonEnabled(true);
} else if (status.matches(IStatus.ERROR)) {
- if (status.getMessage() != null
- && !status.getMessage().isEmpty()) {
+ if (status.getMessage() != null && !status.getMessage().isEmpty()) {
errorMessageIcon.setVisible(true);
- errorMessageIcon.setImage(
- SWTImagesFactory.DESC_ERROR.createImage());
+ errorMessageIcon.setImage(SWTImagesFactory.DESC_ERROR.createImage());
errorMessageLabel.setVisible(true);
errorMessageLabel.setText(status.getMessage());
}
@@ -430,28 +364,21 @@ public class ContainerDataVolumeDialog extends Dialog {
return ValidationStatus.error(null);
} else if (mountType == null) {
return ValidationStatus.error(null);
- } else if (mountType == MountType.HOST_FILE_SYSTEM
- && (hostPath == null || hostPath.isEmpty())) {
+ } else if (mountType == MountType.HOST_FILE_SYSTEM && (hostPath == null || hostPath.isEmpty())) {
return ValidationStatus.error(null);
- } else if (mountType == MountType.HOST_FILE_SYSTEM
- && !new File(hostPath).exists()) {
- return ValidationStatus
- .warning("The specified path does not exist on the host."); //$NON-NLS-1$
+ } else if (mountType == MountType.HOST_FILE_SYSTEM && !new File(hostPath).exists()) {
+ return ValidationStatus.warning("The specified path does not exist on the host."); //$NON-NLS-1$
} else if (mountType == MountType.CONTAINER) {
- final IDockerContainer container = WizardUtils
- .getContainer(connection, model.getContainerMount());
+ final IDockerContainer container = WizardUtils.getContainer(connection, model.getContainerMount());
if (container == null) {
// just make sure that the dialog cannot complete
return ValidationStatus.error(null);
}
final IDockerContainerInfo selectedContainerInfo = container.info();
- if (selectedContainerInfo != null
- && selectedContainerInfo.volumes() != null
- && !selectedContainerInfo.volumes()
- .containsKey(model.getContainerPath())) {
+ if (selectedContainerInfo != null && selectedContainerInfo.volumes() != null
+ && !selectedContainerInfo.volumes().containsKey(model.getContainerPath())) {
return ValidationStatus
- .warning(WizardMessages.getFormattedString(
- "ContainerDataVolumeDialog.volumeWarning", //$NON-NLS-1$
+ .warning(WizardMessages.getFormattedString("ContainerDataVolumeDialog.volumeWarning", //$NON-NLS-1$
model.getContainerPath()));
}
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationDelegate.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationDelegate.java
index 6c196229f9..0aedb2981c 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationDelegate.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationDelegate.java
@@ -65,13 +65,11 @@ import org.eclipse.linuxtools.docker.core.IDockerPortBinding;
import org.eclipse.linuxtools.docker.ui.launch.ContainerLauncher;
import org.eclipse.linuxtools.docker.ui.launch.IContainerLaunchListener;
-public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
- implements ILaunchConfigurationDelegate {
+public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate implements ILaunchConfigurationDelegate {
private ContainerLauncher launcher;
- private class StartGdbServerJob extends Job implements
- IContainerLaunchListener {
+ private class StartGdbServerJob extends Job implements IContainerLaunchListener {
private boolean started;
private boolean done;
@@ -104,8 +102,7 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
@Override
public void newOutput(String output) {
- if (output.contains(Messages.Gdbserver_up)
- || output.contains("gdbserver:")) { //$NON-NLS-1$
+ if (output.contains(Messages.Gdbserver_up) || output.contains("gdbserver:")) { //$NON-NLS-1$
started = true;
}
@@ -148,8 +145,8 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
}
@Override
- public void launch(ILaunchConfiguration configuration, String mode,
- ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
IPath commandPath = getCommandPath(configuration);
if (commandPath != null) {
@@ -157,12 +154,10 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
// kept
HashMap<String, String> labels = new HashMap<>();
labels.put("org.eclipse.cdt.container-launch", ""); //$NON-NLS-1$ //$NON-NLS-2$
- String projectName = configuration.getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
+ String projectName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
labels.put("org.eclipse.cdt.project-name", projectName); //$NON-NLS-1$
if (mode.equals(ILaunchManager.RUN_MODE)) {
- String commandDir = commandPath.removeLastSegments(1)
- .toPortableString();
+ String commandDir = commandPath.removeLastSegments(1).toPortableString();
String commandString = commandPath.toPortableString();
if (commandPath.getDevice() != null) {
@@ -181,15 +176,12 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
String command = b.toString();
- String workingDir = configuration
- .getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
- (String) null);
+ String workingDir = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
+ (String) null);
// if we don't have a working directory, the default is to use
// the project
if (workingDir == null && projectName != null) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(projectName);
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
workingDir = project.getLocation().toOSString();
}
@@ -200,19 +192,14 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
.replace(':', '/');
}
}
- Map<String, String> envMap = configuration.getAttribute(
- ILaunchManager.ATTR_ENVIRONMENT_VARIABLES,
+ Map<String, String> envMap = configuration.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES,
(Map<String, String>) null);
Map<String, String> origEnv = null;
- boolean appendEnv = configuration
- .getAttribute(
- ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES,
- false);
+ boolean appendEnv = configuration.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, false);
if (appendEnv) {
origEnv = System.getenv();
}
- List<String> additionalDirs = configuration.getAttribute(
- ILaunchConstants.ATTR_ADDITIONAL_DIRS,
+ List<String> additionalDirs = configuration.getAttribute(ILaunchConstants.ATTR_ADDITIONAL_DIRS,
(List<String>) null);
if (additionalDirs != null) {
List<String> dirs = new ArrayList<>();
@@ -228,21 +215,17 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
}
List<String> ports = new ArrayList<>();
- List<String> portInfos = configuration.getAttribute(
- ILaunchConstants.ATTR_EXPOSED_PORTS,
+ List<String> portInfos = configuration.getAttribute(ILaunchConstants.ATTR_EXPOSED_PORTS,
Collections.emptyList());
for (String portInfo : portInfos) {
- ExposedPortModel m = ExposedPortModel
- .createPortModel(portInfo);
+ ExposedPortModel m = ExposedPortModel.createPortModel(portInfo);
if (m.getSelected()) {
StringBuilder b1 = new StringBuilder();
- if (m.getHostAddress() != null
- && !m.getHostAddress().isEmpty()) {
+ if (m.getHostAddress() != null && !m.getHostAddress().isEmpty()) {
b1.append(m.getHostAddress());
b1.append(":"); //$NON-NLS-1$
}
- if (m.getHostPort() != null
- && !m.getHostPort().isEmpty()) {
+ if (m.getHostPort() != null && !m.getHostPort().isEmpty()) {
b1.append(m.getHostPort());
}
// regardless if we have a host port or not,
@@ -259,34 +242,24 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
}
}
- String image = configuration.getAttribute(
- ILaunchConstants.ATTR_IMAGE, (String) null);
- String connectionUri = configuration.getAttribute(
- ILaunchConstants.ATTR_CONNECTION_URI, (String) "");
- boolean keepContainer = configuration.getAttribute(
- ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, false);
-
- boolean supportStdin = configuration.getAttribute(
- ILaunchConstants.ATTR_STDIN_SUPPORT, false);
-
- boolean privilegedMode = configuration.getAttribute(
- ILaunchConstants.ATTR_PRIVILEGED_MODE, false);
-
- launcher.launch(DockerLaunchUIPlugin.PLUGIN_ID, null,
- connectionUri,
- image, command,
- commandDir, workingDir, additionalDirs, origEnv,
- envMap, ports.isEmpty() ? null : ports, keepContainer,
- supportStdin,
- privilegedMode, labels);
+ String image = configuration.getAttribute(ILaunchConstants.ATTR_IMAGE, (String) null);
+ String connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, (String) "");
+ boolean keepContainer = configuration.getAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, false);
+
+ boolean supportStdin = configuration.getAttribute(ILaunchConstants.ATTR_STDIN_SUPPORT, false);
+
+ boolean privilegedMode = configuration.getAttribute(ILaunchConstants.ATTR_PRIVILEGED_MODE, false);
+
+ launcher.launch(DockerLaunchUIPlugin.PLUGIN_ID, null, connectionUri, image, command, commandDir,
+ workingDir, additionalDirs, origEnv, envMap, ports.isEmpty() ? null : ports, keepContainer,
+ supportStdin, privilegedMode, labels);
} else if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- String gdbserverPortNumber = configuration.getAttribute(
- ILaunchConstants.ATTR_GDBSERVER_PORT,
+ String gdbserverPortNumber = configuration.getAttribute(ILaunchConstants.ATTR_GDBSERVER_PORT,
ILaunchConstants.ATTR_GDBSERVER_PORT_DEFAULT);
-
+
List<String> ports = new ArrayList<>();
- List<String> portInfos = configuration.getAttribute(
- ILaunchConstants.ATTR_EXPOSED_PORTS, Collections.emptyList());
+ List<String> portInfos = configuration.getAttribute(ILaunchConstants.ATTR_EXPOSED_PORTS,
+ Collections.emptyList());
String gdbserverPort = gdbserverPortNumber + "/tcp"; //$NON-NLS-1$
boolean gdbserverPortSpecified = false;
for (String portInfo : portInfos) {
@@ -317,15 +290,13 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
}
// if user hasn't already specified gdbserver port, we need to add it by default
if (!gdbserverPortSpecified) {
- ports.add(gdbserverPortNumber + "/tcp"); //$NON-NLS-1$
+ ports.add(gdbserverPortNumber + "/tcp"); //$NON-NLS-1$
}
- String gdbserverCommand = configuration.getAttribute(
- ILaunchConstants.ATTR_GDBSERVER_COMMAND,
+ String gdbserverCommand = configuration.getAttribute(ILaunchConstants.ATTR_GDBSERVER_COMMAND,
ILaunchConstants.ATTR_GDBSERVER_COMMAND_DEFAULT);
String commandString = commandPath.toPortableString();
- String commandDir = commandPath.removeLastSegments(1)
- .toPortableString();
+ String commandDir = commandPath.removeLastSegments(1).toPortableString();
if (commandPath.getDevice() != null) {
commandDir = "/" + commandDir.replace(':', '/'); //$NON-NLS-1$
@@ -346,15 +317,12 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
}
String command = b.toString();
- String workingDir = configuration
- .getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
- (String) null);
+ String workingDir = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
+ (String) null);
// if we don't have a working directory, the default is to use
// the project
if (workingDir == null && projectName != null) {
- IProject project = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(projectName);
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
workingDir = project.getLocation().toOSString();
}
if (workingDir != null) {
@@ -365,19 +333,14 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
}
}
- Map<String, String> envMap = configuration.getAttribute(
- ILaunchManager.ATTR_ENVIRONMENT_VARIABLES,
+ Map<String, String> envMap = configuration.getAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES,
(Map<String, String>) null);
Map<String, String> origEnv = null;
- boolean appendEnv = configuration
- .getAttribute(
- ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES,
- false);
+ boolean appendEnv = configuration.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, false);
if (appendEnv) {
origEnv = System.getenv();
}
- List<String> additionalDirs = configuration.getAttribute(
- ILaunchConstants.ATTR_ADDITIONAL_DIRS,
+ List<String> additionalDirs = configuration.getAttribute(ILaunchConstants.ATTR_ADDITIONAL_DIRS,
(List<String>) null);
if (additionalDirs != null) {
List<String> dirs = new ArrayList<>();
@@ -392,26 +355,21 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
additionalDirs = dirs;
}
- String image = configuration.getAttribute(
- ILaunchConstants.ATTR_IMAGE, (String) null);
- String connectionUri = configuration.getAttribute(
- ILaunchConstants.ATTR_CONNECTION_URI, (String) "");
+ String image = configuration.getAttribute(ILaunchConstants.ATTR_IMAGE, (String) null);
+ String connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, (String) "");
boolean isLocalConnection = true;
try {
- Pattern ipaddrPattern = Pattern.compile(
- "[a-z]*://([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)[:]*[0-9]*");
+ Pattern ipaddrPattern = Pattern.compile("[a-z]*://([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)[:]*[0-9]*");
Matcher m = ipaddrPattern.matcher(connectionUri);
if (m.matches()) {
String ipaddr = m.group(1);
InetAddress addr = InetAddress.getByName(ipaddr);
- if (addr.isAnyLocalAddress()
- || addr.isLoopbackAddress()) {
+ if (addr.isAnyLocalAddress() || addr.isLoopbackAddress()) {
isLocalConnection = true;
} else {
// Check if the address is defined on any interface
try {
- isLocalConnection = NetworkInterface
- .getByInetAddress(addr) != null;
+ isLocalConnection = NetworkInterface.getByInetAddress(addr) != null;
} catch (SocketException e) {
isLocalConnection = false;
}
@@ -422,24 +380,17 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
Activator.log(e);
}
- boolean keepContainer = configuration.getAttribute(
- ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, false);
+ boolean keepContainer = configuration.getAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, false);
- boolean supportStdin = configuration.getAttribute(
- ILaunchConstants.ATTR_STDIN_SUPPORT, false);
+ boolean supportStdin = configuration.getAttribute(ILaunchConstants.ATTR_STDIN_SUPPORT, false);
- boolean privilegedMode = configuration.getAttribute(
- ILaunchConstants.ATTR_PRIVILEGED_MODE, false);
+ boolean privilegedMode = configuration.getAttribute(ILaunchConstants.ATTR_PRIVILEGED_MODE, false);
- StartGdbServerJob job = new StartGdbServerJob(
- Messages.Gdbserver_start);
+ StartGdbServerJob job = new StartGdbServerJob(Messages.Gdbserver_start);
job.schedule();
- launcher.launch(DockerLaunchUIPlugin.PLUGIN_ID, job,
- connectionUri,
- image, command,
- commandDir, workingDir, additionalDirs, origEnv,
- envMap, ports, keepContainer, supportStdin,
- privilegedMode, labels, "seccomp:unconfined"); //$NON-NLS-1$
+ launcher.launch(DockerLaunchUIPlugin.PLUGIN_ID, job, connectionUri, image, command, commandDir,
+ workingDir, additionalDirs, origEnv, envMap, ports, keepContainer, supportStdin, privilegedMode,
+ labels, "seccomp:unconfined"); //$NON-NLS-1$
// wait until gdbserver is started successfully and we have its
// ip address or
@@ -452,39 +403,25 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
// if gdbserver started successfully and we have its ip address,
// launch the debugger
- if (job.getResult() == Status.OK_STATUS
- && job.getIpAddress() != null) {
+ if (job.getResult() == Status.OK_STATUS && job.getIpAddress() != null) {
// Let debugger know how gdbserver was started on the remote
// container
- ILaunchConfigurationWorkingCopy wc = configuration
- .getWorkingCopy();
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP,
- true);
- wc.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
+ ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_REMOTE_TCP, true);
+ wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_START_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_MODE_REMOTE);
Map<String, List<IDockerPortBinding>> hostPorts = new HashMap<>();
if (job.getPorts() != null && isLocalConnection) {
hostPorts = job.getPorts();
}
- List<IDockerPortBinding> bindingList = hostPorts
- .get(gdbserverPortNumber + "/tcp"); //$NON-NLS-1$
+ List<IDockerPortBinding> bindingList = hostPorts.get(gdbserverPortNumber + "/tcp"); //$NON-NLS-1$
if (bindingList != null && !bindingList.isEmpty()) {
IDockerPortBinding firstBinding = bindingList.get(0);
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_HOST,
- "localhost"); //$NON-NLS-1$
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_PORT,
- firstBinding.hostPort());
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_HOST, "localhost"); //$NON-NLS-1$
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_PORT, firstBinding.hostPort());
} else {
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_HOST,
- job.getIpAddress());
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_PORT,
- gdbserverPortNumber);
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_HOST, job.getIpAddress());
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_PORT, gdbserverPortNumber);
}
wc.doSave();
try {
@@ -504,43 +441,35 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
/**
* Get the program arguments and perform substitution.
- *
+ *
* @param config
* launch configuration
* @return argument String
* @throws CoreException
*/
- private String getProgramArguments(ILaunchConfiguration config)
- throws CoreException {
- String args = config.getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
- (String) "");
+ private String getProgramArguments(ILaunchConfiguration config) throws CoreException {
+ String args = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, (String) "");
if (args != null && args.length() > 0) {
- args = VariablesPlugin.getDefault().getStringVariableManager()
- .performStringSubstitution(args);
+ args = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(args);
}
return args;
}
/**
* Form command path using the project and program name.
- *
+ *
* @param configuration
* @return command path
* @throws CoreException
*/
- private IPath getCommandPath(ILaunchConfiguration configuration)
- throws CoreException {
- String projectName = configuration.getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
+ private IPath getCommandPath(ILaunchConfiguration configuration) throws CoreException {
+ String projectName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "");
if (projectName.length() > 0) {
- IProject project = CCorePlugin.getWorkspace().getRoot()
- .getProject(projectName);
+ IProject project = CCorePlugin.getWorkspace().getRoot().getProject(projectName);
if (project == null)
return null;
- String name = configuration.getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
+ String name = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "");
if (name.length() == 0)
return null;
@@ -590,8 +519,7 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
return inputString.replaceAll(" ", "\\\\ "); //$NON-NLS-1$ //$NON-NLS-2$
}
- public static IProject getProject(ILaunchConfiguration configuration)
- throws CoreException {
+ public static IProject getProject(ILaunchConfiguration configuration) throws CoreException {
// TODO - make sure this is really the correct project
return configuration.getMappedResources()[0].getProject();
}
@@ -604,37 +532,28 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
/**
* @since 1.2
*/
- protected IToolChainManager toolChainManager = CDebugCorePlugin
- .getService(IToolChainManager.class);
+ protected IToolChainManager toolChainManager = CDebugCorePlugin.getService(IToolChainManager.class);
/*
* @since 1.2
*/
- protected ICBuildConfiguration getBuildConfiguration(
- ILaunchConfiguration configuration, String mode,
- ILaunchTarget target, IProgressMonitor monitor)
- throws CoreException {
+ protected ICBuildConfiguration getBuildConfiguration(ILaunchConfiguration configuration, String mode,
+ ILaunchTarget target, IProgressMonitor monitor) throws CoreException {
IProject project = getProject(configuration);
- String toolchainId = configuration
- .getAttribute(ICBuildConfiguration.TOOLCHAIN_ID, (String) null);
+ String toolchainId = configuration.getAttribute(ICBuildConfiguration.TOOLCHAIN_ID, (String) null);
if (toolchainId != null) {
- String providerId = configuration
- .getAttribute(ICBuildConfiguration.TOOLCHAIN_TYPE, ""); //$NON-NLS-1$
- IToolChain toolchain = toolChainManager.getToolChain(providerId,
- toolchainId);
+ String providerId = configuration.getAttribute(ICBuildConfiguration.TOOLCHAIN_TYPE, ""); //$NON-NLS-1$
+ IToolChain toolchain = toolChainManager.getToolChain(providerId, toolchainId);
if (toolchain != null) {
- return configManager.getBuildConfiguration(project, toolchain,
- mode, monitor);
+ return configManager.getBuildConfiguration(project, toolchain, mode, monitor);
}
}
// Pick the first one that matches
Map<String, String> properties = new HashMap<>();
properties.putAll(target.getAttributes());
- for (IToolChain toolChain : toolChainManager
- .getToolChainsMatching(properties)) {
- ICBuildConfiguration buildConfig = configManager
- .getBuildConfiguration(project, toolChain, mode, monitor);
+ for (IToolChain toolChain : toolChainManager.getToolChainsMatching(properties)) {
+ ICBuildConfiguration buildConfig = configManager.getBuildConfiguration(project, toolChain, mode, monitor);
if (buildConfig != null) {
return buildConfig;
}
@@ -644,32 +563,27 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
}
@Override
- public boolean buildForLaunch(ILaunchConfiguration configuration,
- String mode, IProgressMonitor monitor) throws CoreException {
+ public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException {
IProject project = getProject(configuration);
String name = configuration.getName();
Pattern p = Pattern.compile(".*?\\[([^\\]]+)\\](.*)"); //$NON-NLS-1$
Matcher m = p.matcher(name);
if (m.matches()) {
- ILaunchTargetManager targetManager = CCorePlugin
- .getService(ILaunchTargetManager.class);
+ ILaunchTargetManager targetManager = CCorePlugin.getService(ILaunchTargetManager.class);
ILaunchTarget target = null;
- ILaunchTarget[] targets = targetManager.getLaunchTargetsOfType(
- ContainerTargetTypeProvider.TYPE_ID);
+ ILaunchTarget[] targets = targetManager.getLaunchTargetsOfType(ContainerTargetTypeProvider.TYPE_ID);
for (ILaunchTarget t : targets) {
- if (t.getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, "")
- .replaceAll(":", "_").equals(m.group(1))) {
+ if (t.getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, "").replaceAll(":", "_").equals(m.group(1))) {
target = t;
break;
}
}
if (target != null) {
- ICBuildConfiguration cconfig = getBuildConfiguration(
- configuration, mode, target, monitor);
+ ICBuildConfiguration cconfig = getBuildConfiguration(configuration, mode, target, monitor);
if (cconfig != null) {
IProjectDescription desc = project.getDescription();
- desc.setActiveBuildConfig(
- cconfig.getBuildConfiguration().getName());
+ desc.setActiveBuildConfig(cconfig.getBuildConfiguration().getName());
project.setDescription(desc, monitor);
}
}
@@ -679,50 +593,34 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
}
@Override
- public boolean finalLaunchCheck(ILaunchConfiguration configuration,
- String mode, IProgressMonitor monitor) throws CoreException {
+ public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException {
IProject project = getProject(configuration);
- ILaunchTargetManager targetManager = CCorePlugin
- .getService(ILaunchTargetManager.class);
+ ILaunchTargetManager targetManager = CCorePlugin.getService(ILaunchTargetManager.class);
ILaunchTarget target = null;
- ILaunchTarget[] targets = targetManager
- .getLaunchTargetsOfType(ContainerTargetTypeProvider.TYPE_ID);
- String image = configuration.getAttribute(
- IContainerLaunchTarget.ATTR_IMAGE_ID, (String) null);
- String connection = configuration.getAttribute(
- IContainerLaunchTarget.ATTR_CONNECTION_URI, (String) null);
+ ILaunchTarget[] targets = targetManager.getLaunchTargetsOfType(ContainerTargetTypeProvider.TYPE_ID);
+ String image = configuration.getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, (String) null);
+ String connection = configuration.getAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI, (String) null);
for (ILaunchTarget t : targets) {
- if (t.getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, "")
- .equals(image)) {
+ if (t.getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, "").equals(image)) {
target = t;
break;
}
}
- String program = configuration.getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
- (String) null);
+ String program = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String) null);
if (program == null) {
- ICBuildConfiguration cconfig = getBuildConfiguration(configuration,
- mode, target, monitor);
+ ICBuildConfiguration cconfig = getBuildConfiguration(configuration, mode, target, monitor);
if (cconfig != null) {
IBinary[] binaries = cconfig.getBuildOutput();
for (IBinary b : binaries) {
- if (b.isExecutable()
- && b.getElementName().contains(project.getName())) {
- ILaunchConfigurationWorkingCopy wc = configuration
- .getWorkingCopy();
- wc.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
- b.getResource().getProjectRelativePath()
- .toString());
- wc.setMappedResources(new IResource[] { b.getResource(),
- b.getResource().getProject() });
- wc.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
- (String) null); // default is the project
- // directory
- wc.setAttribute(ILaunchConstants.ATTR_CONNECTION_URI,
- connection);
+ if (b.isExecutable() && b.getElementName().contains(project.getName())) {
+ ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
+ wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
+ b.getResource().getProjectRelativePath().toString());
+ wc.setMappedResources(new IResource[] { b.getResource(), b.getResource().getProject() });
+ wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); // default is the project
+ // directory
+ wc.setAttribute(ILaunchConstants.ATTR_CONNECTION_URI, connection);
wc.setAttribute(ILaunchConstants.ATTR_IMAGE, image);
wc.doSave();
@@ -735,27 +633,22 @@ public class ContainerLaunchConfigurationDelegate extends GdbLaunchDelegate
}
@Override
- public boolean preLaunchCheck(ILaunchConfiguration config, String mode,
- IProgressMonitor monitor) throws CoreException {
- String projectName = config.getAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME,
- (String) null);
+ public boolean preLaunchCheck(ILaunchConfiguration config, String mode, IProgressMonitor monitor)
+ throws CoreException {
+ String projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null);
IProject project = null;
if (projectName == null) {
IResource[] resources = config.getMappedResources();
- if (resources != null && resources.length > 0
- && resources[0] instanceof IProject) {
+ if (resources != null && resources.length > 0 && resources[0] instanceof IProject) {
project = (IProject) resources[0];
}
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME,
- project.getName());
+ wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
wc.doSave();
} else {
projectName = projectName.trim();
if (!projectName.isEmpty()) {
- project = ResourcesPlugin.getWorkspace().getRoot()
- .getProject(projectName);
+ project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
}
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationTabGroup.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationTabGroup.java
index 556afbbc29..87910037f3 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationTabGroup.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerLaunchConfigurationTabGroup.java
@@ -26,8 +26,7 @@ import org.eclipse.debug.ui.EnvironmentTab;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.sourcelookup.SourceLookupTab;
-public class ContainerLaunchConfigurationTabGroup extends
- AbstractLaunchConfigurationTabGroup {
+public class ContainerLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup {
@Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPortDialog.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPortDialog.java
index 8e17eb3c8d..80e19808d6 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPortDialog.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPortDialog.java
@@ -49,13 +49,10 @@ public class ContainerPortDialog extends Dialog {
this.model = new ContainerPortDialogModel();
}
- public ContainerPortDialog(final Shell parentShell,
- final ExposedPortModel selectedContainerPort) {
+ public ContainerPortDialog(final Shell parentShell, final ExposedPortModel selectedContainerPort) {
super(parentShell);
- this.model = new ContainerPortDialogModel(
- selectedContainerPort.getContainerPort(),
- selectedContainerPort.getHostAddress(),
- selectedContainerPort.getHostPort());
+ this.model = new ContainerPortDialogModel(selectedContainerPort.getContainerPort(),
+ selectedContainerPort.getHostAddress(), selectedContainerPort.getHostPort());
}
@Override
@@ -69,10 +66,8 @@ public class ContainerPortDialog extends Dialog {
* Disable the 'OK' button by default
*/
@Override
- protected Button createButton(Composite parent, int id, String label,
- boolean defaultButton) {
- final Button button = super.createButton(parent, id, label,
- defaultButton);
+ protected Button createButton(Composite parent, int id, String label, boolean defaultButton) {
+ final Button button = super.createButton(parent, id, label, defaultButton);
if (id == IDialogConstants.OK_ID) {
button.setEnabled(false);
}
@@ -89,70 +84,47 @@ public class ContainerPortDialog extends Dialog {
protected Control createDialogArea(Composite parent) {
final int COLUMNS = 2;
final Composite container = new Composite(parent, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL)
- .span(COLUMNS, 1).grab(true, true).applyTo(container);
- GridLayoutFactory.fillDefaults().numColumns(COLUMNS).margins(10, 10)
- .applyTo(container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).span(COLUMNS, 1).grab(true, true).applyTo(container);
+ GridLayoutFactory.fillDefaults().numColumns(COLUMNS).margins(10, 10).applyTo(container);
final Label explanationLabel = new Label(container, SWT.NONE);
explanationLabel.setText(Messages.ContainerPortDialog_explanationLabel);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .span(COLUMNS, 1).grab(false, false).applyTo(explanationLabel);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(COLUMNS, 1).grab(false, false)
+ .applyTo(explanationLabel);
final Label containerLabel = new Label(container, SWT.NONE);
containerLabel.setText(Messages.ContainerPortDialog_containerLabel);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(false, false).applyTo(containerLabel);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(containerLabel);
final Text containerPortText = new Text(container, SWT.BORDER);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(true, false).applyTo(containerPortText);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(containerPortText);
final Label hostAddressLabel = new Label(container, SWT.NONE);
hostAddressLabel.setText(Messages.ContainerPortDialog_hostAddressLabel);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(false, false).applyTo(hostAddressLabel);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(hostAddressLabel);
final Text hostAddressText = new Text(container, SWT.BORDER);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(true, false).applyTo(hostAddressText);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(hostAddressText);
final Label hostPortLabel = new Label(container, SWT.NONE);
- hostPortLabel.setText(
- Messages.ContainerPortDialog_hostPortLabel);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(false, false).applyTo(hostPortLabel);
+ hostPortLabel.setText(Messages.ContainerPortDialog_hostPortLabel);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(false, false).applyTo(hostPortLabel);
final Text hostPortText = new Text(container, SWT.BORDER);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(true, false).applyTo(hostPortText);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(hostPortText);
// error message
final Label errorMessageLabel = new Label(container, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .span(COLUMNS, 1).grab(true, false).applyTo(errorMessageLabel);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(COLUMNS, 1).grab(true, false)
+ .applyTo(errorMessageLabel);
// listening to changes
- final ISWTObservableValue containerPortObservable = WidgetProperties
- .text(SWT.Modify).observe(containerPortText);
- dbc.bindValue(containerPortObservable,
- BeanProperties
- .value(ContainerPortDialogModel.class,
- ContainerPortDialogModel.CONTAINER_PORT)
- .observe(model));
- final ISWTObservableValue hostAddressObservable = WidgetProperties
- .text(SWT.Modify).observe(hostAddressText);
- dbc.bindValue(hostAddressObservable,
- BeanProperties
- .value(ContainerPortDialogModel.class,
- ContainerPortDialogModel.HOST_ADDRESS)
- .observe(model));
- final ISWTObservableValue hostPortObservable = WidgetProperties
- .text(SWT.Modify).observe(hostPortText);
- dbc.bindValue(hostPortObservable,
- BeanProperties
- .value(ContainerPortDialogModel.class,
- ContainerPortDialogModel.HOST_PORT)
- .observe(model));
-
- containerPortObservable.addValueChangeListener(
- onContainerPortSettingsChanged());
- hostPortObservable.addValueChangeListener(
- onContainerPortSettingsChanged());
- hostAddressObservable.addValueChangeListener(
- onContainerPortSettingsChanged());
+ final ISWTObservableValue containerPortObservable = WidgetProperties.text(SWT.Modify)
+ .observe(containerPortText);
+ dbc.bindValue(containerPortObservable, BeanProperties
+ .value(ContainerPortDialogModel.class, ContainerPortDialogModel.CONTAINER_PORT).observe(model));
+ final ISWTObservableValue hostAddressObservable = WidgetProperties.text(SWT.Modify).observe(hostAddressText);
+ dbc.bindValue(hostAddressObservable, BeanProperties
+ .value(ContainerPortDialogModel.class, ContainerPortDialogModel.HOST_ADDRESS).observe(model));
+ final ISWTObservableValue hostPortObservable = WidgetProperties.text(SWT.Modify).observe(hostPortText);
+ dbc.bindValue(hostPortObservable, BeanProperties
+ .value(ContainerPortDialogModel.class, ContainerPortDialogModel.HOST_PORT).observe(model));
+
+ containerPortObservable.addValueChangeListener(onContainerPortSettingsChanged());
+ hostPortObservable.addValueChangeListener(onContainerPortSettingsChanged());
+ hostAddressObservable.addValueChangeListener(onContainerPortSettingsChanged());
return container;
}
@@ -174,8 +146,7 @@ public class ContainerPortDialog extends Dialog {
}
public ExposedPortModel getPort() {
- return new ExposedPortModel(model.getContainerPort(), PORT_TYPE,
- model.getHostAddress(), model.getHostPort());
+ return new ExposedPortModel(model.getContainerPort(), PORT_TYPE, model.getHostAddress(), model.getHostPort());
}
class ContainerPortDialogModel extends BaseDatabindingModel {
@@ -195,8 +166,7 @@ public class ContainerPortDialog extends Dialog {
public ContainerPortDialogModel() {
}
- public ContainerPortDialogModel(final String containerPort,
- final String hostAddress, final String hostPort) {
+ public ContainerPortDialogModel(final String containerPort, final String hostAddress, final String hostPort) {
this.containerPort = containerPort;
this.hostAddress = hostAddress;
this.hostPort = hostPort;
@@ -207,8 +177,7 @@ public class ContainerPortDialog extends Dialog {
}
public void setContainerPort(final String containerPort) {
- firePropertyChange(CONTAINER_PORT, this.containerPort,
- this.containerPort = containerPort);
+ firePropertyChange(CONTAINER_PORT, this.containerPort, this.containerPort = containerPort);
}
public String getHostAddress() {
@@ -216,8 +185,7 @@ public class ContainerPortDialog extends Dialog {
}
public void setHostAddress(final String hostName) {
- firePropertyChange(HOST_ADDRESS, this.hostAddress,
- this.hostAddress = hostName);
+ firePropertyChange(HOST_ADDRESS, this.hostAddress, this.hostAddress = hostName);
}
public String getHostPort() {
@@ -225,8 +193,7 @@ public class ContainerPortDialog extends Dialog {
}
public void setHostPort(final String hostPort) {
- firePropertyChange(HOST_PORT, this.hostPort,
- this.hostPort = hostPort);
+ firePropertyChange(HOST_PORT, this.hostPort, this.hostPort = hostPort);
}
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
index ff204c550d..e1099aaeec 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyTab.java
@@ -156,8 +156,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
public ContainerPropertyTab() {
this.containerTab = this;
- this.model = new ContainerPropertyVolumesModel(
- (IDockerConnection) null);
+ this.model = new ContainerPropertyVolumesModel((IDockerConnection) null);
}
@Override
@@ -182,8 +181,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
enableButton.setLayoutData(gd);
Label connectionSelectorLabel = new Label(usercomp, SWT.NULL);
- connectionSelectorLabel
- .setText(Messages.ContainerTab_Connection_Selector_Label);
+ connectionSelectorLabel.setText(Messages.ContainerTab_Connection_Selector_Label);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 1;
gd.grabExcessHorizontalSpace = false;
@@ -236,8 +234,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
@Override
public void widgetSelected(SelectionEvent e) {
setImageId(imageCombo.getText());
- model.setSelectedImage(
- displayedImages.get(imageCombo.getSelectionIndex()));
+ model.setSelectedImage(displayedImages.get(imageCombo.getSelectionIndex()));
}
@Override
@@ -250,34 +247,28 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
try {
IProject project = iCfgd.getProjectDescription().getProject();
- IProjectNature nature = project.getNature(
- "org.eclipse.cdt.autotools.core.autotoolsNatureV2"); //$NON-NLS-1$
+ IProjectNature nature = project.getNature("org.eclipse.cdt.autotools.core.autotoolsNatureV2"); //$NON-NLS-1$
isAutotoolsProject = (nature != null);
if (isAutotoolsProject) {
launchAutotoolsButton = new Button(usercomp, SWT.CHECK);
- launchAutotoolsButton.setText(
- Messages.ContainerPropertyTab_Run_Autotools_In_Container_Msg);
- launchAutotoolsButton.setToolTipText(
- Messages.ContainerPropertyTab_Run_Autotools_In_Container_Tooltip);
+ launchAutotoolsButton.setText(Messages.ContainerPropertyTab_Run_Autotools_In_Container_Msg);
+ launchAutotoolsButton.setToolTipText(Messages.ContainerPropertyTab_Run_Autotools_In_Container_Tooltip);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 5;
launchAutotoolsButton.setLayoutData(gd);
initializeLaunchAutotoolsButton();
- launchAutotoolsButton
- .addSelectionListener(new SelectionListener() {
+ launchAutotoolsButton.addSelectionListener(new SelectionListener() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- setLaunchAutotoolsEnablement(
- launchAutotoolsButton.getSelection());
- }
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ setLaunchAutotoolsEnablement(launchAutotoolsButton.getSelection());
+ }
- @Override
- public void widgetDefaultSelected(
- SelectionEvent e) {
- // ignore
- }
- });
+ @Override
+ public void widgetDefaultSelected(SelectionEvent e) {
+ // ignore
+ }
+ });
}
} catch (CoreException e) {
DockerLaunchUIPlugin.log(e);
@@ -303,60 +294,40 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
private void createVolumeSettingsContainer(final Composite container) {
final Label volumesLabel = new Label(container, SWT.NONE);
- volumesLabel.setText(WizardMessages
- .getString("ImageRunResourceVolVarPage.dataVolumesLabel")); //$NON-NLS-1$
+ volumesLabel.setText(WizardMessages.getString("ImageRunResourceVolVarPage.dataVolumesLabel")); //$NON-NLS-1$
GridDataFactory.fillDefaults().grab(false, false).applyTo(volumesLabel);
- final CheckboxTableViewer dataVolumesTableViewer = createVolumesTable(
- container);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
- .grab(true, false).hint(400, 200)
+ final CheckboxTableViewer dataVolumesTableViewer = createVolumesTable(container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).hint(400, 200)
.applyTo(dataVolumesTableViewer.getTable());
// buttons
final Composite buttonsContainers = new Composite(container, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
- .grab(false, false).applyTo(buttonsContainers);
- GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0)
- .spacing(SWT.DEFAULT, 0).applyTo(buttonsContainers);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(false, false).applyTo(buttonsContainers);
+ GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).spacing(SWT.DEFAULT, 0).applyTo(buttonsContainers);
addButton = new Button(buttonsContainers, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
- .grab(true, false).applyTo(addButton);
- addButton.setText(WizardMessages
- .getString("ImageRunResourceVolVarPage.addButton")); //$NON-NLS-1$
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(addButton);
+ addButton.setText(WizardMessages.getString("ImageRunResourceVolVarPage.addButton")); //$NON-NLS-1$
addButton.addSelectionListener(onAddDataVolume(dataVolumesTableViewer));
if (imageCombo.getText() != null && !imageCombo.getText().equals("")) {
setVolumeControlsEnabled(new Button[] { addButton }, true);
}
final Button editButton = new Button(buttonsContainers, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
- .grab(true, false).applyTo(editButton);
- editButton.setText(WizardMessages
- .getString("ImageRunResourceVolVarPage.editButton")); //$NON-NLS-1$
- editButton
- .addSelectionListener(onEditDataVolume(dataVolumesTableViewer));
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(editButton);
+ editButton.setText(WizardMessages.getString("ImageRunResourceVolVarPage.editButton")); //$NON-NLS-1$
+ editButton.addSelectionListener(onEditDataVolume(dataVolumesTableViewer));
editButton.setEnabled(false);
final Button removeButton = new Button(buttonsContainers, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
- .grab(true, false).applyTo(removeButton);
- removeButton.setText(WizardMessages
- .getString("ImageRunResourceVolVarPage.removeButton")); //$NON-NLS-1$
- removeButton.addSelectionListener(
- onRemoveDataVolumes(dataVolumesTableViewer));
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(removeButton);
+ removeButton.setText(WizardMessages.getString("ImageRunResourceVolVarPage.removeButton")); //$NON-NLS-1$
+ removeButton.addSelectionListener(onRemoveDataVolumes(dataVolumesTableViewer));
removeButton.setEnabled(false);
// update table content when selected image changes
- bind(dataVolumesTableViewer, model.getDataVolumes(),
- BeanProperties.values(DataVolumeModel.class,
- DataVolumeModel.CONTAINER_PATH, DataVolumeModel.MOUNT,
- DataVolumeModel.READ_ONLY_VOLUME));
- dbc.bindSet(
- ViewersObservables.observeCheckedElements(
- dataVolumesTableViewer, DataVolumeModel.class),
- BeanProperties.set(
- ContainerPropertyVolumesModel.SELECTED_DATA_VOLUMES)
- .observe(model));
+ bind(dataVolumesTableViewer, model.getDataVolumes(), BeanProperties.values(DataVolumeModel.class,
+ DataVolumeModel.CONTAINER_PATH, DataVolumeModel.MOUNT, DataVolumeModel.READ_ONLY_VOLUME));
+ dbc.bindSet(ViewersObservables.observeCheckedElements(dataVolumesTableViewer, DataVolumeModel.class),
+ BeanProperties.set(ContainerPropertyVolumesModel.SELECTED_DATA_VOLUMES).observe(model));
// disable the edit and removeButton if the table is empty
- dataVolumesTableViewer.addSelectionChangedListener(
- onSelectionChanged(editButton, removeButton));
+ dataVolumesTableViewer.addSelectionChangedListener(onSelectionChanged(editButton, removeButton));
initializeVolumesTable();
}
@@ -370,25 +341,22 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
* @param input
* @param labelProperties
*/
- private void bind(final StructuredViewer viewer,
- final IObservableList input,
+ private void bind(final StructuredViewer viewer, final IObservableList input,
final IBeanValueProperty[] labelProperties) {
final ObservableListContentProvider contentProvider = new ObservableListContentProvider();
if (viewer.getInput() != null) {
viewer.setInput(null);
}
viewer.setContentProvider(contentProvider);
- viewer.setLabelProvider(
- new DataVolumesLabelProvider(Properties.observeEach(
- contentProvider.getKnownElements(), labelProperties)));
+ viewer.setLabelProvider(new DataVolumesLabelProvider(
+ Properties.observeEach(contentProvider.getKnownElements(), labelProperties)));
if (input != null) {
viewer.setInput(input);
}
}
- private ISelectionChangedListener onSelectionChanged(
- final Button... targetButtons) {
+ private ISelectionChangedListener onSelectionChanged(final Button... targetButtons) {
return e -> {
if (e.getSelection().isEmpty()) {
setVolumeControlsEnabled(targetButtons, false);
@@ -398,8 +366,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
};
}
- private static void setVolumeControlsEnabled(final Control[] controls,
- final boolean enabled) {
+ private static void setVolumeControlsEnabled(final Control[] controls, final boolean enabled) {
for (Control control : controls) {
if (control != null) {
control.setEnabled(enabled);
@@ -407,12 +374,10 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
}
}
- private SelectionListener onAddDataVolume(
- final CheckboxTableViewer dataVolumesTableViewer) {
+ private SelectionListener onAddDataVolume(final CheckboxTableViewer dataVolumesTableViewer) {
return SelectionListener.widgetSelectedAdapter(e -> {
final ContainerDataVolumeDialog dialog = new ContainerDataVolumeDialog(
- Display.getDefault().getActiveShell(),
- model.getConnection());
+ Display.getDefault().getActiveShell(), model.getConnection());
dialog.create();
if (dialog.open() == IDialogConstants.OK_ID) {
final DataVolumeModel dataVolume = dialog.getDataVolume();
@@ -425,30 +390,22 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
});
}
- private SelectionListener onEditDataVolume(
- final CheckboxTableViewer dataVolumesTableViewer) {
+ private SelectionListener onEditDataVolume(final CheckboxTableViewer dataVolumesTableViewer) {
return SelectionListener.widgetSelectedAdapter(e -> {
- final IStructuredSelection selection = (IStructuredSelection) dataVolumesTableViewer
- .getSelection();
+ final IStructuredSelection selection = (IStructuredSelection) dataVolumesTableViewer.getSelection();
if (selection.isEmpty()) {
return;
}
- final DataVolumeModel selectedDataVolume = (DataVolumeModel) selection
- .getFirstElement();
+ final DataVolumeModel selectedDataVolume = (DataVolumeModel) selection.getFirstElement();
final ContainerDataVolumeDialog dialog = new ContainerDataVolumeDialog(
- Display.getDefault().getActiveShell(),
- model.getConnection(), selectedDataVolume);
+ Display.getDefault().getActiveShell(), model.getConnection(), selectedDataVolume);
dialog.create();
if (dialog.open() == IDialogConstants.OK_ID) {
final DataVolumeModel dialogDataVolume = dialog.getDataVolume();
- selectedDataVolume.setContainerMount(
- dialogDataVolume.getContainerMount());
- selectedDataVolume
- .setMountType(dialogDataVolume.getMountType());
- selectedDataVolume
- .setHostPathMount(dialogDataVolume.getHostPathMount());
- selectedDataVolume.setContainerMount(
- dialogDataVolume.getContainerMount());
+ selectedDataVolume.setContainerMount(dialogDataVolume.getContainerMount());
+ selectedDataVolume.setMountType(dialogDataVolume.getMountType());
+ selectedDataVolume.setHostPathMount(dialogDataVolume.getHostPathMount());
+ selectedDataVolume.setContainerMount(dialogDataVolume.getContainerMount());
selectedDataVolume.setReadOnly(dialogDataVolume.isReadOnly());
model.getSelectedDataVolumes().add(selectedDataVolume);
dataVolumesTableViewer.setChecked(selectedDataVolume, true);
@@ -457,14 +414,11 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
});
}
- private SelectionListener onRemoveDataVolumes(
- final TableViewer dataVolumesTableViewer) {
+ private SelectionListener onRemoveDataVolumes(final TableViewer dataVolumesTableViewer) {
return SelectionListener.widgetSelectedAdapter(e -> {
- final IStructuredSelection selection = dataVolumesTableViewer
- .getStructuredSelection();
+ final IStructuredSelection selection = dataVolumesTableViewer.getStructuredSelection();
for (@SuppressWarnings("unchecked")
- Iterator<DataVolumeModel> iterator = selection.iterator(); iterator
- .hasNext();) {
+ Iterator<DataVolumeModel> iterator = selection.iterator(); iterator.hasNext();) {
final DataVolumeModel volume = iterator.next();
model.removeDataVolume(volume);
model.getSelectedDataVolumes().remove(volume);
@@ -474,37 +428,24 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
}
private CheckboxTableViewer createVolumesTable(final Composite container) {
- final Table table = new Table(container, SWT.CHECK | SWT.BORDER
- | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL);
+ final Table table = new Table(container,
+ SWT.CHECK | SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL);
final CheckboxTableViewer tableViewer = new CheckboxTableViewer(table);
table.setHeaderVisible(true);
table.setLinesVisible(true);
- dbc.bindSet(
- ViewersObservables.observeCheckedElements(tableViewer,
- DataVolumeModel.class),
- BeanProperties.set(
- ContainerPropertyVolumesModel.SELECTED_DATA_VOLUMES)
- .observe(model));
- addTableViewerColumn(tableViewer,
- WizardMessages.getString(
- "ImageRunResourceVolVarPage.containerPathColumn"), //$NON-NLS-1$
+ dbc.bindSet(ViewersObservables.observeCheckedElements(tableViewer, DataVolumeModel.class),
+ BeanProperties.set(ContainerPropertyVolumesModel.SELECTED_DATA_VOLUMES).observe(model));
+ addTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunResourceVolVarPage.containerPathColumn"), //$NON-NLS-1$
180);
- addTableViewerColumn(tableViewer,
- WizardMessages
- .getString("ImageRunResourceVolVarPage.mountColumn"), //$NON-NLS-1$
+ addTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunResourceVolVarPage.mountColumn"), //$NON-NLS-1$
180);
- addTableViewerColumn(tableViewer,
- WizardMessages
- .getString("ImageRunResourceVolVarPage.readonlyColumn"), //$NON-NLS-1$
+ addTableViewerColumn(tableViewer, WizardMessages.getString("ImageRunResourceVolVarPage.readonlyColumn"), //$NON-NLS-1$
60);
return tableViewer;
}
- private TableViewerColumn addTableViewerColumn(
- final TableViewer tableViewer,
- final String title, final int width) {
- final TableViewerColumn viewerColumn = new TableViewerColumn(
- tableViewer, SWT.NONE);
+ private TableViewerColumn addTableViewerColumn(final TableViewer tableViewer, final String title, final int width) {
+ final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
if (title != null) {
column.setText(title);
@@ -513,13 +454,10 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
return viewerColumn;
}
- private static final class DataVolumesLabelProvider
- extends ObservableMapLabelProvider {
+ private static final class DataVolumesLabelProvider extends ObservableMapLabelProvider {
- private Image CONTAINER_IMAGE = SWTImagesFactory.DESC_CONTAINER
- .createImage();
- private Image FOLDER_CLOSED_IMAGE = SWTImagesFactory.DESC_FOLDER_CLOSED
- .createImage();
+ private Image CONTAINER_IMAGE = SWTImagesFactory.DESC_CONTAINER.createImage();
+ private Image FOLDER_CLOSED_IMAGE = SWTImagesFactory.DESC_FOLDER_CLOSED.createImage();
private Image FILE_IMAGE = SWTImagesFactory.DESC_FILE.createImage();
public DataVolumesLabelProvider(final IObservableMap[] attributeMaps) {
@@ -567,11 +505,9 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
if (dataVolume.getMountType() != MountType.HOST_FILE_SYSTEM) {
return null;
} else if (dataVolume.isReadOnly()) {
- return WizardMessages
- .getString("ImageRunResourceVolVarPage.true"); //$NON-NLS-1$
+ return WizardMessages.getString("ImageRunResourceVolVarPage.true"); //$NON-NLS-1$
}
- return WizardMessages
- .getString("ImageRunResourceVolVarPage.false"); //$NON-NLS-1$
+ return WizardMessages.getString("ImageRunResourceVolVarPage.false"); //$NON-NLS-1$
default:
return null;
}
@@ -594,29 +530,23 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
separator = VOLUME_SEPARATOR;
}
if (iCfg instanceof IMultiConfiguration) {
- IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg)
- .getItems();
+ IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg).getItems();
for (int i = 0; i < cfs.length; i++) {
IConfiguration cfg = cfs[i];
IOptionalBuildProperties p = cfg.getOptionalBuildProperties();
- p.setProperty(ContainerCommandLauncher.VOLUMES_ID,
- buffer.toString());
- p.setProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID,
- selectedBuffer.toString());
+ p.setProperty(ContainerCommandLauncher.VOLUMES_ID, buffer.toString());
+ p.setProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID, selectedBuffer.toString());
}
} else {
IOptionalBuildProperties p = iCfg.getOptionalBuildProperties();
- p.setProperty(ContainerCommandLauncher.VOLUMES_ID,
- buffer.toString());
- p.setProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID,
- selectedBuffer.toString());
+ p.setProperty(ContainerCommandLauncher.VOLUMES_ID, buffer.toString());
+ p.setProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID, selectedBuffer.toString());
}
}
private void setEnablement(boolean enabled) {
if (iCfg instanceof IMultiConfiguration) {
- IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg)
- .getItems();
+ IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg).getItems();
for (int i = 0; i < cfs.length; i++) {
IConfiguration cfg = cfs[i];
IOptionalBuildProperties p = cfg.getOptionalBuildProperties();
@@ -630,8 +560,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
}
// if enabled, make sure we have ELF binary parsers specified
if (enabled) {
- String[] ids = CoreModelUtil
- .getBinaryParserIds(page.getCfgsEditable());
+ String[] ids = CoreModelUtil.getBinaryParserIds(page.getCfgsEditable());
List<String> idList = new ArrayList<>(Arrays.asList(ids));
if (!idList.contains(GNU_ELF_PARSER_ID)) {
idList.add(GNU_ELF_PARSER_ID);
@@ -639,32 +568,27 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
if (!idList.contains(ELF_PARSER_ID)) {
idList.add(ELF_PARSER_ID);
}
- CoreModelUtil.setBinaryParserIds(page.getCfgsEditable(),
- idList.toArray(new String[0]));
+ CoreModelUtil.setBinaryParserIds(page.getCfgsEditable(), idList.toArray(new String[0]));
}
}
private void setLaunchAutotoolsEnablement(boolean enabled) {
if (iCfg instanceof IMultiConfiguration) {
- IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg)
- .getItems();
+ IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg).getItems();
for (int i = 0; i < cfs.length; i++) {
IConfiguration cfg = cfs[i];
IOptionalBuildProperties p = cfg.getOptionalBuildProperties();
- p.setProperty(RUN_IN_CONFIGURE_LAUNCHER,
- Boolean.toString(launchAutotoolsButton.getSelection()));
+ p.setProperty(RUN_IN_CONFIGURE_LAUNCHER, Boolean.toString(launchAutotoolsButton.getSelection()));
}
} else {
IOptionalBuildProperties p = iCfg.getOptionalBuildProperties();
- p.setProperty(RUN_IN_CONFIGURE_LAUNCHER,
- Boolean.toString(launchAutotoolsButton.getSelection()));
+ p.setProperty(RUN_IN_CONFIGURE_LAUNCHER, Boolean.toString(launchAutotoolsButton.getSelection()));
}
}
private void setImageId(String imageId) {
if (iCfg instanceof IMultiConfiguration) {
- IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg)
- .getItems();
+ IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg).getItems();
for (int i = 0; i < cfs.length; i++) {
IConfiguration cfg = cfs[i];
IOptionalBuildProperties p = cfg.getOptionalBuildProperties();
@@ -678,8 +602,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
private void setConnection(String uri) {
if (iCfg instanceof IMultiConfiguration) {
- IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg)
- .getItems();
+ IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg).getItems();
for (int i = 0; i < cfs.length; i++) {
IConfiguration cfg = cfs[i];
IOptionalBuildProperties p = cfg.getOptionalBuildProperties();
@@ -703,11 +626,9 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
private void initializeEnablementButton() {
initialEnabled = false;
IOptionalBuildProperties properties = iCfg.getOptionalBuildProperties();
- String savedEnabled = properties
- .getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
+ String savedEnabled = properties.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
if (savedEnabled != null) {
- initialEnabled = Boolean
- .parseBoolean(savedEnabled);
+ initialEnabled = Boolean.parseBoolean(savedEnabled);
}
enableButton.setSelection(initialEnabled);
setControlsEnabled(initialEnabled);
@@ -727,8 +648,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
int defaultIndex = -1;
initialConnection = null;
IOptionalBuildProperties properties = iCfg.getOptionalBuildProperties();
- String id = properties
- .getProperty(ContainerCommandLauncher.CONNECTION_ID);
+ String id = properties.getProperty(ContainerCommandLauncher.CONNECTION_ID);
if (id != null) {
initialConnection = id;
}
@@ -807,19 +727,15 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
private void initializeVolumesTable() {
model.clearDataVolumes();
int imageSelectionIndex = imageCombo.getSelectionIndex();
- if (imageSelectionIndex >= 0
- && imageSelectionIndex < displayedImages.size()) {
+ if (imageSelectionIndex >= 0 && imageSelectionIndex < displayedImages.size()) {
model.setSelectedImage(displayedImages.get(imageSelectionIndex));
}
IOptionalBuildProperties properties = iCfg.getOptionalBuildProperties();
- initialVolumes = properties
- .getProperty(ContainerCommandLauncher.VOLUMES_ID);
+ initialVolumes = properties.getProperty(ContainerCommandLauncher.VOLUMES_ID);
Map<String, DataVolumeModel> volumeMap = parseVolumes(initialVolumes);
- initialSelectedVolumes = properties
- .getProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID);
- Map<String, DataVolumeModel> selectedVolumeMap = parseVolumes(
- initialSelectedVolumes);
+ initialSelectedVolumes = properties.getProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID);
+ Map<String, DataVolumeModel> selectedVolumeMap = parseVolumes(initialSelectedVolumes);
Set<DataVolumeModel> selectedVolumes = new HashSet<>();
for (DataVolumeModel dvm : selectedVolumeMap.values()) {
// we need selected volumes to be volumes that are in the volumes
@@ -836,12 +752,10 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
private Map<String, DataVolumeModel> parseVolumes(String volumesString) {
Map<String, DataVolumeModel> volumeMap = new HashMap<>();
if (volumesString != null && !volumesString.equals("")) { //$NON-NLS-1$
- String[] volumes = volumesString
- .split("[" + VOLUME_SEPARATOR + "]"); //$NON-NLS-1$ //$NON-NLS-2$
+ String[] volumes = volumesString.split("[" + VOLUME_SEPARATOR + "]"); //$NON-NLS-1$ //$NON-NLS-2$
for (String volume : volumes) {
if (volume != null && !volume.equals("")) { //$NON-NLS-1$
- DataVolumeModel dataVolume = DataVolumeModel
- .parseString(volume);
+ DataVolumeModel dataVolume = DataVolumeModel.parseString(volume);
volumeMap.put(dataVolume.getContainerPath(), dataVolume);
}
}
@@ -850,35 +764,28 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
}
@Override
- protected void performApply(ICResourceDescription src,
- ICResourceDescription dst) {
+ protected void performApply(ICResourceDescription src, ICResourceDescription dst) {
setVolumes();
boolean needToRecalculate = false;
ICConfigurationDescription defaultCfg = null;
if (page.isMultiCfg()) {
- ICMultiConfigDescription mc1 = (ICMultiConfigDescription) src
- .getConfiguration();
- ICMultiConfigDescription mc2 = (ICMultiConfigDescription) dst
- .getConfiguration();
- ICConfigurationDescription[] cds1 = (ICConfigurationDescription[]) mc1
- .getItems();
- ICConfigurationDescription[] cds2 = (ICConfigurationDescription[]) mc2
- .getItems();
+ ICMultiConfigDescription mc1 = (ICMultiConfigDescription) src.getConfiguration();
+ ICMultiConfigDescription mc2 = (ICMultiConfigDescription) dst.getConfiguration();
+ ICConfigurationDescription[] cds1 = (ICConfigurationDescription[]) mc1.getItems();
+ ICConfigurationDescription[] cds2 = (ICConfigurationDescription[]) mc2.getItems();
defaultCfg = cds1[0];
for (int i = 0; i < cds1.length; i++)
needToRecalculate |= applyToCfg(cds1[i], cds2[i]);
} else {
defaultCfg = src.getConfiguration();
- needToRecalculate = applyToCfg(src.getConfiguration(),
- dst.getConfiguration());
+ needToRecalculate = applyToCfg(src.getConfiguration(), dst.getConfiguration());
}
if (needToRecalculate) {
recalculateSpecs(defaultCfg, true);
}
}
- private boolean applyToCfg(ICConfigurationDescription c1,
- ICConfigurationDescription c2) {
+ private boolean applyToCfg(ICConfigurationDescription c1, ICConfigurationDescription c2) {
Configuration cfg01 = (Configuration) getCfg(c1);
Configuration cfg02 = (Configuration) getCfg(c2);
IOptionalBuildProperties prop1 = cfg01.getOptionalBuildProperties();
@@ -890,66 +797,45 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
ICTargetPlatformSetting tps2 = c2.getTargetPlatformSetting();
tps2.setBinaryParserIds(pids);
- String enablementProperty = prop1
- .getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
- String enablementProperty2 = prop2
- .getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
- if (enablementProperty != null
- && !enablementProperty.equals(enablementProperty2)) {
+ String enablementProperty = prop1.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
+ String enablementProperty2 = prop2.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
+ if (enablementProperty != null && !enablementProperty.equals(enablementProperty2)) {
needToRecalculate = true;
}
- prop2.setProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED,
- enablementProperty);
-
- String connectionProperty = prop1
- .getProperty(ContainerCommandLauncher.CONNECTION_ID);
- String connectionProperty2 = prop2
- .getProperty(ContainerCommandLauncher.CONNECTION_ID);
- if (connectionProperty != null
- && !connectionProperty.equals(connectionProperty2)) {
+ prop2.setProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED, enablementProperty);
+
+ String connectionProperty = prop1.getProperty(ContainerCommandLauncher.CONNECTION_ID);
+ String connectionProperty2 = prop2.getProperty(ContainerCommandLauncher.CONNECTION_ID);
+ if (connectionProperty != null && !connectionProperty.equals(connectionProperty2)) {
needToRecalculate = true;
}
- prop2.setProperty(ContainerCommandLauncher.CONNECTION_ID,
- connectionProperty);
+ prop2.setProperty(ContainerCommandLauncher.CONNECTION_ID, connectionProperty);
- String imageProperty = prop1
- .getProperty(ContainerCommandLauncher.IMAGE_ID);
- String imageProperty2 = prop2
- .getProperty(ContainerCommandLauncher.IMAGE_ID);
+ String imageProperty = prop1.getProperty(ContainerCommandLauncher.IMAGE_ID);
+ String imageProperty2 = prop2.getProperty(ContainerCommandLauncher.IMAGE_ID);
if (imageProperty != null && !imageProperty.equals(imageProperty2)) {
needToRecalculate = true;
}
prop2.setProperty(ContainerCommandLauncher.IMAGE_ID, imageProperty);
- String volumesProperty = prop1
- .getProperty(ContainerCommandLauncher.VOLUMES_ID);
+ String volumesProperty = prop1.getProperty(ContainerCommandLauncher.VOLUMES_ID);
prop2.setProperty(ContainerCommandLauncher.VOLUMES_ID, volumesProperty);
- String selectedVolumesProperty = prop1
- .getProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID);
- prop2.setProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID,
- selectedVolumesProperty);
+ String selectedVolumesProperty = prop1.getProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID);
+ prop2.setProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID, selectedVolumesProperty);
return needToRecalculate;
}
-
- protected void recalculateSpecs(ICConfigurationDescription cfgd,
- boolean performingApply) {
+ protected void recalculateSpecs(ICConfigurationDescription cfgd, boolean performingApply) {
IConfiguration cfg = getCfg(cfgd);
IOptionalBuildProperties properties = cfg.getOptionalBuildProperties();
- initialEnabled = Boolean.parseBoolean(properties
- .getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED));
- initialConnection = properties
- .getProperty(ContainerCommandLauncher.CONNECTION_ID);
- initialImageId = properties
- .getProperty(ContainerCommandLauncher.IMAGE_ID);
- initialVolumes = properties
- .getProperty(ContainerCommandLauncher.VOLUMES_ID);
- initialSelectedVolumes = properties
- .getProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID);
- initialAutotoolsLaunchEnabled = Boolean.parseBoolean(
- properties.getProperty(RUN_IN_CONFIGURE_LAUNCHER));
+ initialEnabled = Boolean.parseBoolean(properties.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED));
+ initialConnection = properties.getProperty(ContainerCommandLauncher.CONNECTION_ID);
+ initialImageId = properties.getProperty(ContainerCommandLauncher.IMAGE_ID);
+ initialVolumes = properties.getProperty(ContainerCommandLauncher.VOLUMES_ID);
+ initialSelectedVolumes = properties.getProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID);
+ initialAutotoolsLaunchEnabled = Boolean.parseBoolean(properties.getProperty(RUN_IN_CONFIGURE_LAUNCHER));
List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgd)
.getLanguageSettingProviders();
for (ILanguageSettingsProvider provider : providers) {
@@ -966,7 +852,6 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
}
}
-
@Override
protected void performOK() {
boolean needToRecalculate = false;
@@ -975,55 +860,42 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
needToRecalculate = multiChange;
} else {
IOptionalBuildProperties p = iCfg.getOptionalBuildProperties();
- if (initialEnabled != Boolean.parseBoolean(p.getProperty(
- ContainerCommandLauncher.CONTAINER_BUILD_ENABLED))) {
+ if (initialEnabled != Boolean
+ .parseBoolean(p.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED))) {
needToRecalculate = true;
} else if (initialEnabled == true) {
- if (!initialConnection.equals(
- p.getProperty(ContainerCommandLauncher.CONNECTION_ID))
- || !initialImageId.equals(p.getProperty(
- ContainerCommandLauncher.IMAGE_ID))) {
+ if (!initialConnection.equals(p.getProperty(ContainerCommandLauncher.CONNECTION_ID))
+ || !initialImageId.equals(p.getProperty(ContainerCommandLauncher.IMAGE_ID))) {
needToRecalculate = true;
}
}
}
if (needToRecalculate) {
- recalculateSpecs(
- ManagedBuildManager.getDescriptionForConfiguration(iCfg),
- false);
+ recalculateSpecs(ManagedBuildManager.getDescriptionForConfiguration(iCfg), false);
}
}
@Override
protected void performDefaults() {
if (iCfg instanceof IMultiConfiguration) {
- IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg)
- .getItems();
+ IConfiguration[] cfs = (IConfiguration[]) ((IMultiConfiguration) iCfg).getItems();
for (int i = 0; i < cfs.length; i++) {
- IOptionalBuildProperties props = cfs[i]
- .getOptionalBuildProperties();
- props.setProperty(
- ContainerCommandLauncher.CONTAINER_BUILD_ENABLED,
- Boolean.toString(false));
+ IOptionalBuildProperties props = cfs[i].getOptionalBuildProperties();
+ props.setProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED, Boolean.toString(false));
if (connections.length > 0) {
- props.setProperty(ContainerCommandLauncher.CONNECTION_ID,
- connections[0].getUri());
+ props.setProperty(ContainerCommandLauncher.CONNECTION_ID, connections[0].getUri());
} else {
- props.setProperty(ContainerCommandLauncher.CONNECTION_ID,
- null);
+ props.setProperty(ContainerCommandLauncher.CONNECTION_ID, null);
}
props.setProperty(ContainerCommandLauncher.IMAGE_ID, null);
props.setProperty(ContainerCommandLauncher.VOLUMES_ID, null);
- props.setProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID,
- null);
+ props.setProperty(ContainerCommandLauncher.SELECTED_VOLUMES_ID, null);
}
} else {
IOptionalBuildProperties props = iCfg.getOptionalBuildProperties();
- props.setProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED,
- Boolean.toString(false));
+ props.setProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED, Boolean.toString(false));
if (connections.length > 0) {
- props.setProperty(ContainerCommandLauncher.CONNECTION_ID,
- connections[0].getUri());
+ props.setProperty(ContainerCommandLauncher.CONNECTION_ID, connections[0].getUri());
} else {
props.setProperty(ContainerCommandLauncher.CONNECTION_ID, null);
}
@@ -1102,8 +974,7 @@ public class ContainerPropertyTab extends AbstractCBuildPropertyTab
}
@Override
- public void listChanged(IDockerConnection c,
- java.util.List<IDockerImage> list) {
+ public void listChanged(IDockerConnection c, java.util.List<IDockerImage> list) {
final IDockerImage[] finalList = list.toArray(new IDockerImage[0]);
if (c.getName().equals(connection.getName())) {
Display.getDefault().syncExec(new Runnable() {
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyVolumesModel.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyVolumesModel.java
index 014abbefd5..bbcb6caf95 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyVolumesModel.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerPropertyVolumesModel.java
@@ -30,14 +30,12 @@ import org.eclipse.linuxtools.docker.core.IDockerImageInfo;
* Databinding model for the {@link ContainerPropertyTab}
*
*/
-public class ContainerPropertyVolumesModel
- extends BaseDatabindingModel {
+public class ContainerPropertyVolumesModel extends BaseDatabindingModel {
public enum MountType {
NONE, HOST_FILE_SYSTEM, CONTAINER;
}
-
public static final String DATA_VOLUMES = "dataVolumes"; //$NON-NLS-1$
public static final String SELECTED_DATA_VOLUMES = "selectedDataVolumes"; //$NON-NLS-1$
@@ -54,13 +52,11 @@ public class ContainerPropertyVolumesModel
private IDockerImage selectedImage;
- public ContainerPropertyVolumesModel(
- final IDockerConnection connection) {
+ public ContainerPropertyVolumesModel(final IDockerConnection connection) {
this.connection = connection;
}
- public ContainerPropertyVolumesModel(
- final IDockerImage selectedImage) throws DockerException {
+ public ContainerPropertyVolumesModel(final IDockerImage selectedImage) throws DockerException {
this(selectedImage.getConnection());
this.selectedImage = selectedImage;
}
@@ -76,32 +72,28 @@ public class ContainerPropertyVolumesModel
/**
* Refreshes the list of Volumes to display in the for the given
- *
+ *
* @param selectedImage
*/
public void setSelectedImage(final IDockerImage selectedImage) {
- if (this.selectedImage == null
- || !this.selectedImage.equals(selectedImage)) {
+ if (this.selectedImage == null || !this.selectedImage.equals(selectedImage)) {
this.selectedImage = selectedImage;
if (selectedImage != null) {
- this.imageInfo = selectedImage.getConnection()
- .getImageInfo(selectedImage.id());
- if (this.imageInfo.config() != null
- && this.imageInfo.config().volumes() != null) {
+ this.imageInfo = selectedImage.getConnection().getImageInfo(selectedImage.id());
+ if (this.imageInfo.config() != null && this.imageInfo.config().volumes() != null) {
for (DataVolumeModel dvm : previousVolumes) {
removeDataVolume(dvm);
selectedDataVolumes.remove(dvm);
}
final List<DataVolumeModel> volumes = new ArrayList<>();
- for (String volume : this.imageInfo.config().volumes()
- .keySet()) {
+ for (String volume : this.imageInfo.config().volumes().keySet()) {
volumes.add(new DataVolumeModel(volume));
}
setDataVolumes(volumes);
previousVolumes = volumes;
}
} else {
- setDataVolumes(Collections.<DataVolumeModel> emptyList());
+ setDataVolumes(Collections.<DataVolumeModel>emptyList());
}
}
@@ -137,8 +129,7 @@ public class ContainerPropertyVolumesModel
return selectedDataVolumes;
}
- public void setSelectedDataVolumes(
- final Set<DataVolumeModel> selectedDataVolumes) {
+ public void setSelectedDataVolumes(final Set<DataVolumeModel> selectedDataVolumes) {
firePropertyChange(SELECTED_DATA_VOLUMES, this.selectedDataVolumes,
this.selectedDataVolumes = selectedDataVolumes);
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
index a1efd16614..da19557388 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTab.java
@@ -72,8 +72,8 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.osgi.service.prefs.Preferences;
-public class ContainerTab extends AbstractLaunchConfigurationTab implements
- IDockerConnectionManagerListener, IDockerImageListener {
+public class ContainerTab extends AbstractLaunchConfigurationTab
+ implements IDockerConnectionManagerListener, IDockerImageListener {
private List directoriesList;
private String imageName;
@@ -130,17 +130,14 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
@Override
public void createControl(Composite parent) {
Font font = parent.getFont();
- Composite mainComposite = createComposite(parent, 3, 1,
- GridData.FILL_HORIZONTAL);
+ Composite mainComposite = createComposite(parent, 3, 1, GridData.FILL_HORIZONTAL);
mainComposite.setFont(font);
setControl(mainComposite);
Label connectionSelectorLabel = new Label(mainComposite, SWT.NULL);
- connectionSelectorLabel
- .setText(Messages.ContainerTab_Connection_Selector_Label);
+ connectionSelectorLabel.setText(Messages.ContainerTab_Connection_Selector_Label);
- connectionSelector = new Combo(mainComposite, SWT.BORDER
- | SWT.READ_ONLY);
+ connectionSelector = new Combo(mainComposite, SWT.BORDER | SWT.READ_ONLY);
initializeConnectionSelector();
connectionSelector.addModifyListener(connectionModifyListener);
// Following is a kludge so that on Linux the Combo is read-only but
@@ -218,11 +215,9 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
private void createButtons(Composite parent) {
Font font = parent.getFont();
Composite composite = createComposite(parent, 1, 1,
- GridData.VERTICAL_ALIGN_BEGINNING
- | GridData.HORIZONTAL_ALIGN_END);
+ GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_END);
composite.setFont(font);
- newButton = createPushButton(composite,
- Messages.ContainerTab_New_Button, null); //$NON-NLS-1$
+ newButton = createPushButton(composite, Messages.ContainerTab_New_Button, null); //$NON-NLS-1$
newButton.setLayoutData(new GridData(GridData.FILL_BOTH));
GridData gdb = new GridData(GridData.VERTICAL_ALIGN_CENTER);
gdb.grabExcessHorizontalSpace = false;
@@ -236,8 +231,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
}
});
- removeButton = createPushButton(composite,
- Messages.ContainerTab_Remove_Button, null); //$NON-NLS-1$
+ removeButton = createPushButton(composite, Messages.ContainerTab_Remove_Button, null); //$NON-NLS-1$
removeButton.setLayoutData(new GridData(GridData.FILL_BOTH));
removeButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -262,86 +256,63 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
group.setLayout(new GridLayout());
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(3, 1)
- .grab(true, false).applyTo(group);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).span(3, 1).grab(true, false).applyTo(group);
group.setLayout(new GridLayout());
// specify ports
final Label portSettingsLabel = new Label(group, SWT.NONE);
portSettingsLabel.setText(Messages.ContainerTab_Specify_Ports_Label);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER)
- .grab(true, false).span(3, 1)
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(3, 1)
.applyTo(portSettingsLabel);
- final CheckboxTableViewer exposedPortsTableViewer = createPortSettingsTable(
- group);
+ final CheckboxTableViewer exposedPortsTableViewer = createPortSettingsTable(group);
tableViewer = exposedPortsTableViewer;
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
- .grab(true, false).span(3 - 1, 1).indent(INDENT, 0)
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).span(3 - 1, 1).indent(INDENT, 0)
.hint(200, 70).applyTo(exposedPortsTableViewer.getTable());
// buttons
final Composite buttonsContainers = new Composite(parent, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
- .grab(false, false).applyTo(buttonsContainers);
- GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0)
- .spacing(SWT.DEFAULT, 0).applyTo(buttonsContainers);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(false, false).applyTo(buttonsContainers);
+ GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).spacing(SWT.DEFAULT, 0).applyTo(buttonsContainers);
final Button addButton = new Button(buttonsContainers, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
- .grab(true, false).applyTo(addButton);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(addButton);
addButton.setText(Messages.ContainerTab_Add_Button);
addButton.addSelectionListener(onAddPort(exposedPortsTableViewer));
final Button editButton = new Button(buttonsContainers, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
- .grab(true, false).applyTo(editButton);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(editButton);
editButton.setText(Messages.ContainerTab_Edit_Button);
editButton.setEnabled(false);
editButton.addSelectionListener(onEditPort(exposedPortsTableViewer));
final Button removeButton = new Button(buttonsContainers, SWT.NONE);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP)
- .grab(true, false).applyTo(removeButton);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).grab(true, false).applyTo(removeButton);
removeButton.setText(Messages.ContainerTab_Remove_Button);
- removeButton
- .addSelectionListener(onRemovePorts(exposedPortsTableViewer));
+ removeButton.addSelectionListener(onRemovePorts(exposedPortsTableViewer));
ViewerSupport.bind(exposedPortsTableViewer, model.getExposedPorts(),
- BeanProperties.values(ExposedPortModel.class,
- ExposedPortModel.CONTAINER_PORT,
- ExposedPortModel.PORT_TYPE,
- ExposedPortModel.HOST_ADDRESS,
- ExposedPortModel.HOST_PORT));
- dbc.bindSet(
- ViewersObservables.observeCheckedElements(
- exposedPortsTableViewer, ExposedPortModel.class),
- BeanProperties.set(ContainerTabModel.SELECTED_PORTS)
- .observe(model));
+ BeanProperties.values(ExposedPortModel.class, ExposedPortModel.CONTAINER_PORT,
+ ExposedPortModel.PORT_TYPE, ExposedPortModel.HOST_ADDRESS, ExposedPortModel.HOST_PORT));
+ dbc.bindSet(ViewersObservables.observeCheckedElements(exposedPortsTableViewer, ExposedPortModel.class),
+ BeanProperties.set(ContainerTabModel.SELECTED_PORTS).observe(model));
checkAllElements(exposedPortsTableViewer);
// disable the edit and removeButton if the table is empty
- exposedPortsTableViewer.addSelectionChangedListener(
- onSelectionChanged(editButton, removeButton));
- exposedPortsTableViewer
- .addCheckStateListener(new ICheckStateListener() {
- @Override
- public void checkStateChanged(
- CheckStateChangedEvent event) {
- ExposedPortModel e = (ExposedPortModel) event
- .getElement();
- e.setSelected(event.getChecked());
- updateLaunchConfigurationDialog();
- }
- });
+ exposedPortsTableViewer.addSelectionChangedListener(onSelectionChanged(editButton, removeButton));
+ exposedPortsTableViewer.addCheckStateListener(new ICheckStateListener() {
+ @Override
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ ExposedPortModel e = (ExposedPortModel) event.getElement();
+ e.setSelected(event.getChecked());
+ updateLaunchConfigurationDialog();
+ }
+ });
}
- private void checkAllElements(
- final CheckboxTableViewer exposedPortsTableViewer) {
+ private void checkAllElements(final CheckboxTableViewer exposedPortsTableViewer) {
exposedPortsTableViewer.setAllChecked(true);
model.setSelectedPorts(new HashSet<>(model.getExposedPorts()));
}
- private SelectionListener onAddPort(
- final CheckboxTableViewer exposedPortsTableViewer) {
+ private SelectionListener onAddPort(final CheckboxTableViewer exposedPortsTableViewer) {
return SelectionListener.widgetSelectedAdapter(e -> {
- final ContainerPortDialog dialog = new ContainerPortDialog(
- getShell());
+ final ContainerPortDialog dialog = new ContainerPortDialog(getShell());
dialog.create();
if (dialog.open() == IDialogConstants.OK_ID) {
final ExposedPortModel port = dialog.getPort();
@@ -354,22 +325,16 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
});
}
- private SelectionListener onEditPort(
- final CheckboxTableViewer exposedPortsTableViewer) {
+ private SelectionListener onEditPort(final CheckboxTableViewer exposedPortsTableViewer) {
return SelectionListener.widgetSelectedAdapter(e -> {
- final IStructuredSelection selection = exposedPortsTableViewer
- .getStructuredSelection();
- final ExposedPortModel selectedContainerPort = (ExposedPortModel) selection
- .getFirstElement();
- final ContainerPortDialog dialog = new ContainerPortDialog(
- getShell(), selectedContainerPort);
+ final IStructuredSelection selection = exposedPortsTableViewer.getStructuredSelection();
+ final ExposedPortModel selectedContainerPort = (ExposedPortModel) selection.getFirstElement();
+ final ContainerPortDialog dialog = new ContainerPortDialog(getShell(), selectedContainerPort);
dialog.create();
if (dialog.open() == IDialogConstants.OK_ID) {
final ExposedPortModel configuredPort = dialog.getPort();
- selectedContainerPort
- .setContainerPort(configuredPort.getContainerPort());
- selectedContainerPort
- .setHostAddress(configuredPort.getHostAddress());
+ selectedContainerPort.setContainerPort(configuredPort.getContainerPort());
+ selectedContainerPort.setHostAddress(configuredPort.getHostAddress());
selectedContainerPort.setHostPort(configuredPort.getHostPort());
exposedPortsTableViewer.refresh();
updateLaunchConfigurationDialog();
@@ -377,14 +342,11 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
});
}
- private SelectionListener onRemovePorts(
- final TableViewer portsTableViewer) {
+ private SelectionListener onRemovePorts(final TableViewer portsTableViewer) {
return SelectionListener.widgetSelectedAdapter(e -> {
- final IStructuredSelection selection = portsTableViewer
- .getStructuredSelection();
+ final IStructuredSelection selection = portsTableViewer.getStructuredSelection();
for (@SuppressWarnings("unchecked")
- Iterator<ExposedPortModel> iterator = selection.iterator(); iterator
- .hasNext();) {
+ Iterator<ExposedPortModel> iterator = selection.iterator(); iterator.hasNext();) {
final ExposedPortModel port = iterator.next();
model.removeAvailablePort(port);
model.getSelectedPorts().remove(port);
@@ -393,8 +355,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
});
}
- private ISelectionChangedListener onSelectionChanged(
- final Button... targetButtons) {
+ private ISelectionChangedListener onSelectionChanged(final Button... targetButtons) {
return e -> {
if (e.getSelection().isEmpty()) {
setControlsEnabled(targetButtons, false);
@@ -404,41 +365,29 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
};
}
- private static void setControlsEnabled(final Control[] controls,
- final boolean enabled) {
+ private static void setControlsEnabled(final Control[] controls, final boolean enabled) {
for (Control control : controls) {
control.setEnabled(enabled);
}
}
- private CheckboxTableViewer createPortSettingsTable(
- final Composite container) {
- final Table table = new Table(container, SWT.BORDER | SWT.FULL_SELECTION
- | SWT.V_SCROLL | SWT.H_SCROLL | SWT.CHECK);
+ private CheckboxTableViewer createPortSettingsTable(final Composite container) {
+ final Table table = new Table(container,
+ SWT.BORDER | SWT.FULL_SELECTION | SWT.V_SCROLL | SWT.H_SCROLL | SWT.CHECK);
final CheckboxTableViewer tableViewer = new CheckboxTableViewer(table);
table.setHeaderVisible(true);
table.setLinesVisible(true);
- createTableViewerColum(tableViewer,
- Messages.ContainerTab_Port_Column,
- 100);
- createTableViewerColum(tableViewer,
- Messages.ContainerTab_Type_Column,
- 50);
- createTableViewerColum(tableViewer,
- Messages.ContainerTab_HostAddress_Column,
- 100);
- createTableViewerColum(tableViewer,
- Messages.ContainerTab_HostPort_Column,
- 100);
+ createTableViewerColum(tableViewer, Messages.ContainerTab_Port_Column, 100);
+ createTableViewerColum(tableViewer, Messages.ContainerTab_Type_Column, 50);
+ createTableViewerColum(tableViewer, Messages.ContainerTab_HostAddress_Column, 100);
+ createTableViewerColum(tableViewer, Messages.ContainerTab_HostPort_Column, 100);
tableViewer.setContentProvider(new ObservableListContentProvider());
return tableViewer;
}
- private TableViewerColumn createTableViewerColum(
- final TableViewer tableViewer, final String title,
+ private TableViewerColumn createTableViewerColum(final TableViewer tableViewer, final String title,
final int width) {
- final TableViewerColumn viewerColumn = new TableViewerColumn(
- tableViewer, SWT.NONE);
+ final TableViewerColumn viewerColumn = new TableViewerColumn(tableViewer, SWT.NONE);
final TableColumn column = viewerColumn.getColumn();
if (title != null) {
column.setText(title);
@@ -462,8 +411,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
Preferences prefs = InstanceScope.INSTANCE.getNode(DockerLaunchUIPlugin.PLUGIN_ID);
keepButton = createCheckButton(group, Messages.ContainerTab_Keep_Label);
keepButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- Boolean keepPref = prefs.getBoolean(
- PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH, false);
+ Boolean keepPref = prefs.getBoolean(PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH, false);
keepButton.setSelection(keepPref);
keepValue = keepPref;
keepButton.addSelectionListener(new SelectionListener() {
@@ -480,8 +428,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
}
});
- stdinButton = createCheckButton(group,
- Messages.ContainerTab_Stdin_Support_Label);
+ stdinButton = createCheckButton(group, Messages.ContainerTab_Stdin_Support_Label);
stdinButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
stdinValue = false;
stdinButton.addSelectionListener(new SelectionListener() {
@@ -498,8 +445,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
}
});
- privilegedButton = createCheckButton(group,
- Messages.ContainerTab_Privileged_Mode_Label);
+ privilegedButton = createCheckButton(group, Messages.ContainerTab_Privileged_Mode_Label);
privilegedButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
privilegedValue = false;
privilegedButton.addSelectionListener(new SelectionListener() {
@@ -518,8 +464,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
});
}
- private Composite createComposite(Composite parent, int columns, int hspan,
- int fill) {
+ private Composite createComposite(Composite parent, int columns, int hspan, int fill) {
Composite g = new Composite(parent, SWT.NONE);
g.setLayout(new GridLayout(columns, false));
g.setFont(parent.getFont());
@@ -618,8 +563,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
for (int i = 0; i < strs.length; i++) {
stripped.append(strs[i]);
}
- control.getAccessible().addAccessibleListener(
- new ControlAccessibleListener(stripped.toString()));
+ control.getAccessible().addAccessibleListener(new ControlAccessibleListener(stripped.toString()));
}
private class ControlAccessibleListener extends AccessibleAdapter {
@@ -637,35 +581,28 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(ILaunchConstants.ATTR_ADDITIONAL_DIRS,
- (String) null);
- configuration.setAttribute(ILaunchConstants.ATTR_EXPOSED_PORTS,
- (String) null);
+ configuration.setAttribute(ILaunchConstants.ATTR_ADDITIONAL_DIRS, (String) null);
+ configuration.setAttribute(ILaunchConstants.ATTR_EXPOSED_PORTS, (String) null);
configuration.setAttribute(ILaunchConstants.ATTR_CONNECTION_URI, ""); //$NON-NLS-1$
- Preferences prefs = InstanceScope.INSTANCE
- .getNode(DockerLaunchUIPlugin.PLUGIN_ID);
+ Preferences prefs = InstanceScope.INSTANCE.getNode(DockerLaunchUIPlugin.PLUGIN_ID);
String image = prefs.get(PreferenceConstants.DEFAULT_IMAGE, ""); //$NON-NLS-1$
configuration.setAttribute(ILaunchConstants.ATTR_IMAGE, image);
- Boolean keepContainer = prefs.getBoolean(
- PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH, false);
- configuration.setAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH,
- keepContainer);
+ Boolean keepContainer = prefs.getBoolean(PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH, false);
+ configuration.setAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, keepContainer);
configuration.setAttribute(ILaunchConstants.ATTR_STDIN_SUPPORT, false);
}
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
try {
- java.util.List<String> additionalDirs = configuration.getAttribute(
- ILaunchConstants.ATTR_ADDITIONAL_DIRS,
+ java.util.List<String> additionalDirs = configuration.getAttribute(ILaunchConstants.ATTR_ADDITIONAL_DIRS,
(java.util.List<String>) null);
if (additionalDirs != null)
directoriesList.setItems(additionalDirs.toArray(new String[0]));
- java.util.List<String> exposedPortInfos = configuration
- .getAttribute(ILaunchConstants.ATTR_EXPOSED_PORTS,
- Collections.<String> emptyList());
+ java.util.List<String> exposedPortInfos = configuration.getAttribute(ILaunchConstants.ATTR_EXPOSED_PORTS,
+ Collections.<String>emptyList());
model.removeExposedPorts();
for (String port : exposedPortInfos) {
ExposedPortModel m = ExposedPortModel.createPortModel(port);
@@ -675,11 +612,9 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
tableViewer.setChecked(m, true);
}
}
- connectionUri = configuration.getAttribute(
- ILaunchConstants.ATTR_CONNECTION_URI, (String) "");
+ connectionUri = configuration.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, (String) "");
int defaultIndex = 0;
- connections = DockerConnectionManager.getInstance()
- .getConnections();
+ connections = DockerConnectionManager.getInstance().getConnections();
if (connections.length > 0) {
if (!connectionUri.isEmpty()) {
String[] connectionNames = new String[connections.length];
@@ -693,22 +628,17 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
connectionUri = connections[0].getUri();
}
}
- imageName = configuration.getAttribute(ILaunchConstants.ATTR_IMAGE,
- "");
+ imageName = configuration.getAttribute(ILaunchConstants.ATTR_IMAGE, "");
imageCombo.setText(imageName);
- keepValue = configuration.getAttribute(
- ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, false);
+ keepValue = configuration.getAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, false);
keepButton.setSelection(keepValue);
- stdinValue = configuration.getAttribute(
- ILaunchConstants.ATTR_STDIN_SUPPORT, false);
+ stdinValue = configuration.getAttribute(ILaunchConstants.ATTR_STDIN_SUPPORT, false);
stdinButton.setSelection(stdinValue);
- privilegedValue = configuration
- .getAttribute(ILaunchConstants.ATTR_PRIVILEGED_MODE, false);
+ privilegedValue = configuration.getAttribute(ILaunchConstants.ATTR_PRIVILEGED_MODE, false);
privilegedButton.setSelection(privilegedValue);
} catch (CoreException e) {
- setErrorMessage(Messages.bind(
- Messages.ContainerTab_Error_Reading_Configuration, e
- .getStatus().getMessage())); //$NON-NLS-1$
+ setErrorMessage(
+ Messages.bind(Messages.ContainerTab_Error_Reading_Configuration, e.getStatus().getMessage())); //$NON-NLS-1$
DockerLaunchUIPlugin.log(e);
}
}
@@ -716,18 +646,13 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
String[] dirs = directoriesList.getItems();
- configuration.setAttribute(ILaunchConstants.ATTR_ADDITIONAL_DIRS,
- Arrays.asList(dirs));
+ configuration.setAttribute(ILaunchConstants.ATTR_ADDITIONAL_DIRS, Arrays.asList(dirs));
String image = imageCombo.getText();
configuration.setAttribute(ILaunchConstants.ATTR_IMAGE, image);
- configuration.setAttribute(ILaunchConstants.ATTR_CONNECTION_URI,
- connectionUri);
- configuration.setAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH,
- keepButton.getSelection());
- configuration.setAttribute(ILaunchConstants.ATTR_STDIN_SUPPORT,
- stdinButton.getSelection());
- configuration.setAttribute(ILaunchConstants.ATTR_PRIVILEGED_MODE,
- privilegedButton.getSelection());
+ configuration.setAttribute(ILaunchConstants.ATTR_CONNECTION_URI, connectionUri);
+ configuration.setAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, keepButton.getSelection());
+ configuration.setAttribute(ILaunchConstants.ATTR_STDIN_SUPPORT, stdinButton.getSelection());
+ configuration.setAttribute(ILaunchConstants.ATTR_PRIVILEGED_MODE, privilegedButton.getSelection());
configuration.setAttribute(ILaunchConstants.ATTR_EXPOSED_PORTS,
ExposedPortModel.toArrayString(model.getExposedPorts()));
}
@@ -735,21 +660,18 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
@Override
public boolean isValid(ILaunchConfiguration launchConfig) {
try {
- String image = launchConfig
- .getAttribute(ILaunchConstants.ATTR_IMAGE, (String) null);
+ String image = launchConfig.getAttribute(ILaunchConstants.ATTR_IMAGE, (String) null);
if (image == null)
return false;
int index = image.lastIndexOf(':'); //$NON-NLS-1$
if (index <= 0)
return false;
- if (connection.hasImage(image.substring(0, index),
- image.substring(index + 1))) {
+ if (connection.hasImage(image.substring(0, index), image.substring(index + 1))) {
setWarningMessage(null);
return true;
} else {
- setWarningMessage(Messages.bind(
- Messages.ContainerTab_Warning_Image_Not_Found,
- image, connections[0].getName()));
+ setWarningMessage(
+ Messages.bind(Messages.ContainerTab_Warning_Image_Not_Found, image, connections[0].getName()));
}
} catch (CoreException e) {
return false;
@@ -806,8 +728,7 @@ public class ContainerTab extends AbstractLaunchConfigurationTab implements
connectionSelector.addModifyListener(connectionModifyListener);
}
- public void listChanged(IDockerConnection c,
- java.util.List<IDockerImage> list) {
+ public void listChanged(IDockerConnection c, java.util.List<IDockerImage> list) {
setErrorMessage(null);
final IDockerImage[] finalList = list.toArray(new IDockerImage[0]);
if (finalList.length == 0) {
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTabModel.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTabModel.java
index f22cdb8288..aae8fe282a 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTabModel.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ContainerTabModel.java
@@ -42,8 +42,7 @@ public class ContainerTabModel extends BaseDatabindingModel {
}
public void setPublishAllPorts(boolean publishAllPorts) {
- firePropertyChange(PUBLISH_ALL_PORTS, this.publishAllPorts,
- this.publishAllPorts = publishAllPorts);
+ firePropertyChange(PUBLISH_ALL_PORTS, this.publishAllPorts, this.publishAllPorts = publishAllPorts);
}
public WritableList<ExposedPortModel> getExposedPorts() {
@@ -83,8 +82,7 @@ public class ContainerTabModel extends BaseDatabindingModel {
}
public void setSelectedPorts(final Set<ExposedPortModel> ports) {
- firePropertyChange(SELECTED_PORTS, this.selectedPorts,
- this.selectedPorts = ports);
+ firePropertyChange(SELECTED_PORTS, this.selectedPorts, this.selectedPorts = ports);
}
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/DataVolumeModel.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/DataVolumeModel.java
index 4225271a51..fe7bfe9870 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/DataVolumeModel.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/DataVolumeModel.java
@@ -24,8 +24,7 @@ import org.eclipse.core.runtime.Platform;
* Data binding model for container data volumes
*
*/
-public class DataVolumeModel extends BaseDatabindingModel
- implements Comparable<DataVolumeModel> {
+public class DataVolumeModel extends BaseDatabindingModel implements Comparable<DataVolumeModel> {
private static final String SEPARATOR = ":"; //$NON-NLS-1$
@@ -59,7 +58,6 @@ public class DataVolumeModel extends BaseDatabindingModel
private boolean selected;
-
/**
* Default constructor
*/
@@ -68,7 +66,7 @@ public class DataVolumeModel extends BaseDatabindingModel
/**
* Constructor
- *
+ *
* @param containerPath
* the container path
*/
@@ -77,8 +75,7 @@ public class DataVolumeModel extends BaseDatabindingModel
this.mountType = MountType.NONE;
}
- public DataVolumeModel(final String containerPath, final String hostPath,
- final boolean readOnly) {
+ public DataVolumeModel(final String containerPath, final String hostPath, final boolean readOnly) {
this.containerPath = containerPath;
this.mountType = MountType.HOST_FILE_SYSTEM;
this.hostPathMount = hostPath;
@@ -108,12 +105,11 @@ public class DataVolumeModel extends BaseDatabindingModel
/**
* Create a DataVolumeModel from a toString() output.
- *
+ *
* @param fromString
* @return DataVolumeModel
*/
- public static DataVolumeModel parseString(
- final String fromString) {
+ public static DataVolumeModel parseString(final String fromString) {
final DataVolumeModel model = new DataVolumeModel();
final String[] items = fromString.split(SEPARATOR); // $NON-NLS-1$
model.containerPath = items[0];
@@ -128,8 +124,7 @@ public class DataVolumeModel extends BaseDatabindingModel
// a windows drive using the : separator, we have to form the
// host path by merging the path back together. If the user
// has specified an alternate format, we don't do this.
- if (Platform.OS_WIN32.equals(Platform.getOS())
- && items.length > 5) {
+ if (Platform.OS_WIN32.equals(Platform.getOS()) && items.length > 5) {
model.setHostPathMount(items[2] + SEPARATOR + items[3]);
model.setReadOnly(Boolean.valueOf(items[4]));
model.setSelected(Boolean.valueOf(items[5]));
@@ -148,12 +143,12 @@ public class DataVolumeModel extends BaseDatabindingModel
/**
* creates a {@link DataVolumeModel} from the 'volumeFrom' container info
- *
+ *
* @param volumeFrom
* the value to parse.
- *
+ *
* Format: <code>&lt;containerName&gt;</code>
- *
+ *
* @See <a href="https://docs.docker.com/engine/userguide/dockervolumes/">
* https://docs.docker.com/engine/userguide/dockervolumes/</a>
*/
@@ -167,18 +162,18 @@ public class DataVolumeModel extends BaseDatabindingModel
/**
* creates a {@link DataVolumeModel} from the 'volumeFrom' container info
- *
+ *
* @param volumeFrom
* the value to parse. Format:
* <code>&lt;host_path&gt;:&lt;container_path&gt;:&lt;label_suffix_flag&gt;</code>
- *
+ *
* @See <a href="https://docs.docker.com/engine/userguide/dockervolumes/">
* https://docs.docker.com/engine/userguide/dockervolumes/</a>
*/
public static DataVolumeModel parseHostBinding(String volumeFrom) {
final DataVolumeModel model = new DataVolumeModel();
final String[] items = volumeFrom.split(SEPARATOR); // $NON-NLS-1$
- // converts the host path to a valid Win32 path if Platform OS is Win32
+ // converts the host path to a valid Win32 path if Platform OS is Win32
model.setHostPathMount(convertToWin32Path(Platform.getOS(), items[0]));
model.containerPath = items[1];
model.mountType = MountType.HOST_FILE_SYSTEM;
@@ -194,7 +189,7 @@ public class DataVolumeModel extends BaseDatabindingModel
/**
* Converts the given path to a portable form, replacing all "\" and ": "
* with "/" if the given <code>os</code> is {@link Platform#OS_WIN32}.
- *
+ *
* @param os
* the current OS
* @param path
@@ -202,8 +197,7 @@ public class DataVolumeModel extends BaseDatabindingModel
* @return the converted path or the given path
* @see {@link Platform#getOS()}
*/
- public static String convertToWin32Path(final String os,
- final String path) {
+ public static String convertToWin32Path(final String os, final String path) {
if (os != null && os.equals(Platform.OS_WIN32)) {
// replace all "/" with "\" and then drive info (eg "/c/" to "C:/")
final Matcher m = Pattern.compile("^/([a-zA-Z])/").matcher(path); //$NON-NLS-1$
@@ -224,8 +218,7 @@ public class DataVolumeModel extends BaseDatabindingModel
}
public void setContainerPath(final String containerPath) {
- firePropertyChange(CONTAINER_PATH, this.containerPath,
- this.containerPath = containerPath);
+ firePropertyChange(CONTAINER_PATH, this.containerPath, this.containerPath = containerPath);
}
public String getMount() {
@@ -247,8 +240,7 @@ public class DataVolumeModel extends BaseDatabindingModel
if (mountType == null) {
return;
}
- firePropertyChange(MOUNT_TYPE, this.mountType,
- this.mountType = mountType);
+ firePropertyChange(MOUNT_TYPE, this.mountType, this.mountType = mountType);
if (this.mountType == MountType.NONE) {
setMount("");
}
@@ -260,8 +252,7 @@ public class DataVolumeModel extends BaseDatabindingModel
}
public void setHostPathMount(final String hostPathMount) {
- firePropertyChange(HOST_PATH_MOUNT, this.hostPathMount,
- this.hostPathMount = hostPathMount);
+ firePropertyChange(HOST_PATH_MOUNT, this.hostPathMount, this.hostPathMount = hostPathMount);
if (this.mountType == MountType.HOST_FILE_SYSTEM) {
setMount(this.hostPathMount);
}
@@ -272,8 +263,7 @@ public class DataVolumeModel extends BaseDatabindingModel
}
public void setReadOnly(final boolean readOnly) {
- firePropertyChange(READ_ONLY_VOLUME, this.readOnly,
- this.readOnly = readOnly);
+ firePropertyChange(READ_ONLY_VOLUME, this.readOnly, this.readOnly = readOnly);
}
public String getContainerMount() {
@@ -281,8 +271,7 @@ public class DataVolumeModel extends BaseDatabindingModel
}
public void setContainerMount(final String containerMount) {
- firePropertyChange(CONTAINER_MOUNT, this.containerMount,
- this.containerMount = containerMount);
+ firePropertyChange(CONTAINER_MOUNT, this.containerMount, this.containerMount = containerMount);
if (this.mountType == MountType.CONTAINER) {
setMount(this.containerMount);
}
@@ -305,8 +294,7 @@ public class DataVolumeModel extends BaseDatabindingModel
@Override
public String toString() {
final StringBuffer buffer = new StringBuffer();
- buffer.append(
- this.containerPath + SEPARATOR + getMountType() + SEPARATOR);
+ buffer.append(this.containerPath + SEPARATOR + getMountType() + SEPARATOR);
switch (getMountType()) {
case CONTAINER:
buffer.append(getContainerMount());
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ExposedPortModel.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ExposedPortModel.java
index 107cd33dd1..12e9a8cacf 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ExposedPortModel.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ExposedPortModel.java
@@ -20,8 +20,7 @@ import java.util.UUID;
import org.eclipse.core.runtime.Assert;
-public class ExposedPortModel extends BaseDatabindingModel
- implements Comparable<ExposedPortModel> {
+public class ExposedPortModel extends BaseDatabindingModel implements Comparable<ExposedPortModel> {
private static final String SEPARATOR = ":"; //$NON-NLS-1$
@@ -52,17 +51,15 @@ public class ExposedPortModel extends BaseDatabindingModel
/**
* Parses and converts the {@link List} of the given {@link String} values
* into a {@link List} of {@link ExposedPortModel}
- *
+ *
* @param exposedPortInfos
* the input values
* @return the corresponding {@link ExposedPortModel}s
*/
- public static List<ExposedPortModel> fromStrings(
- final Collection<String> exposedPortInfos) {
+ public static List<ExposedPortModel> fromStrings(final Collection<String> exposedPortInfos) {
final List<ExposedPortModel> exposedPorts = new ArrayList<>();
for (String exposedPortInfo : exposedPortInfos) {
- final ExposedPortModel exposedPort = ExposedPortModel
- .fromString(exposedPortInfo);
+ final ExposedPortModel exposedPort = ExposedPortModel.fromString(exposedPortInfo);
if (exposedPort != null) {
exposedPorts.add(exposedPort);
}
@@ -73,14 +70,13 @@ public class ExposedPortModel extends BaseDatabindingModel
/**
* Converts a collection of ExposedPortModel to a {@link List} of
* {@link String} values
- *
- *
+ *
+ *
* @param exposedPorts
* collection of ExposedPortModel instances
* @return the corresponding {@link List} of {@link String}s
*/
- public static List<String> toArrayString(
- final Collection<ExposedPortModel> exposedPorts) {
+ public static List<String> toArrayString(final Collection<ExposedPortModel> exposedPorts) {
final List<String> exposedPortList = new ArrayList<>();
for (ExposedPortModel exposedPort : exposedPorts) {
final String exposedPortString = exposedPort.toString();
@@ -94,51 +90,41 @@ public class ExposedPortModel extends BaseDatabindingModel
/**
* Parse the given value and returns an instance of
* {@link ExposedPortModel}.
- *
+ *
* @param exposedPortInfo
* the value to parse
* @return the corresponding {@link ExposedPortModel}
*/
public static ExposedPortModel fromString(final String exposedPortInfo) {
- final String privatePort = exposedPortInfo.substring(0,
- exposedPortInfo.indexOf(CONTAINER_TYPE_SEPARATOR));
+ final String privatePort = exposedPortInfo.substring(0, exposedPortInfo.indexOf(CONTAINER_TYPE_SEPARATOR));
// exposed ports without host IP/port info
final int firstColumnSeparator = exposedPortInfo.indexOf(SEPARATOR);
- if (firstColumnSeparator == -1
- && exposedPortInfo.indexOf(CONTAINER_TYPE_SEPARATOR) != -1) {
- final String type = exposedPortInfo.substring(
- exposedPortInfo.indexOf(CONTAINER_TYPE_SEPARATOR)); // $NON-NLS-1$
- final ExposedPortModel exposedPort = new ExposedPortModel(
- privatePort, type, "", privatePort); // $NON-NLS-1$
+ if (firstColumnSeparator == -1 && exposedPortInfo.indexOf(CONTAINER_TYPE_SEPARATOR) != -1) {
+ final String type = exposedPortInfo.substring(exposedPortInfo.indexOf(CONTAINER_TYPE_SEPARATOR)); // $NON-NLS-1$
+ final ExposedPortModel exposedPort = new ExposedPortModel(privatePort, type, "", privatePort); // $NON-NLS-1$
return exposedPort; // $NON-NLS-1$
} else {
- final int secondColumnSeparator = exposedPortInfo.indexOf(SEPARATOR,
- firstColumnSeparator + 1);
- final String type = exposedPortInfo.substring(
- exposedPortInfo.indexOf(CONTAINER_TYPE_SEPARATOR), // $NON-NLS-1$
+ final int secondColumnSeparator = exposedPortInfo.indexOf(SEPARATOR, firstColumnSeparator + 1);
+ final String type = exposedPortInfo.substring(exposedPortInfo.indexOf(CONTAINER_TYPE_SEPARATOR), // $NON-NLS-1$
firstColumnSeparator); // $NON-NLS-1$
- final String hostIP = exposedPortInfo
- .substring(firstColumnSeparator + 1, secondColumnSeparator);
- final String hostPort = exposedPortInfo
- .substring(secondColumnSeparator + 1);
- final ExposedPortModel exposedPort = new ExposedPortModel(
- privatePort, type, hostIP, hostPort); // $NON-NLS-1$
+ final String hostIP = exposedPortInfo.substring(firstColumnSeparator + 1, secondColumnSeparator);
+ final String hostPort = exposedPortInfo.substring(secondColumnSeparator + 1);
+ final ExposedPortModel exposedPort = new ExposedPortModel(privatePort, type, hostIP, hostPort); // $NON-NLS-1$
return exposedPort; // $NON-NLS-1$
}
}
/**
* Full constructor
- *
+ *
* @param privatePort
* @param portType
* @param hostAddress
* @param hostPort
*/
- public ExposedPortModel(final String privatePort, final String type,
- final String hostAddress, final String hostPort) {
- Assert.isNotNull(privatePort,
- "Port Mapping privatePort cannot be null"); //$NON-NLS-1$
+ public ExposedPortModel(final String privatePort, final String type, final String hostAddress,
+ final String hostPort) {
+ Assert.isNotNull(privatePort, "Port Mapping privatePort cannot be null"); //$NON-NLS-1$
Assert.isNotNull(type, "Port Mapping portType cannot be null"); //$NON-NLS-1$
this.containerPort = privatePort;
this.hostPort = hostPort;
@@ -148,19 +134,17 @@ public class ExposedPortModel extends BaseDatabindingModel
/**
* Create an ExposedPortModel from its toString output
- *
+ *
* @param stringValue
* @return ExposedPortModel
*/
static public ExposedPortModel createPortModel(String stringValue) {
final String[] elements = stringValue.split(SEPARATOR);
- final String[] containerPortElements = elements[0]
- .split(CONTAINER_TYPE_SEPARATOR);
- ExposedPortModel model = new ExposedPortModel(containerPortElements[0],
- containerPortElements[1], elements[1], elements[2]);
+ final String[] containerPortElements = elements[0].split(CONTAINER_TYPE_SEPARATOR);
+ ExposedPortModel model = new ExposedPortModel(containerPortElements[0], containerPortElements[1], elements[1],
+ elements[2]);
// check the last argument if exists otherwise assume 'true'
- model.selected = (elements.length == 4) ? Boolean.valueOf(elements[3])
- : true;
+ model.selected = (elements.length == 4) ? Boolean.valueOf(elements[3]) : true;
return model;
}
@@ -169,8 +153,7 @@ public class ExposedPortModel extends BaseDatabindingModel
}
public void setContainerPort(final String containerPort) {
- firePropertyChange(CONTAINER_PORT, this.containerPort,
- this.containerPort = containerPort);
+ firePropertyChange(CONTAINER_PORT, this.containerPort, this.containerPort = containerPort);
}
public String getPortType() {
@@ -202,8 +185,7 @@ public class ExposedPortModel extends BaseDatabindingModel
}
public void setHostAddress(final String hostAddress) {
- firePropertyChange(HOST_ADDRESS, this.hostAddress,
- this.hostAddress = hostAddress);
+ firePropertyChange(HOST_ADDRESS, this.hostAddress, this.hostAddress = hostAddress);
}
@Override
@@ -240,9 +222,8 @@ public class ExposedPortModel extends BaseDatabindingModel
@Override
public String toString() {
StringBuffer buffer = new StringBuffer();
- buffer.append(containerPort + CONTAINER_TYPE_SEPARATOR + portType
- + SEPARATOR + (hostAddress != null ? hostAddress : "")
- + SEPARATOR + hostPort + SEPARATOR + selected);
+ buffer.append(containerPort + CONTAINER_TYPE_SEPARATOR + portType + SEPARATOR
+ + (hostAddress != null ? hostAddress : "") + SEPARATOR + hostPort + SEPARATOR + selected);
return buffer.toString();
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/GdbDebuggerPage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/GdbDebuggerPage.java
index 2ba223f60e..ff90177863 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/GdbDebuggerPage.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/GdbDebuggerPage.java
@@ -60,7 +60,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
protected Button fReverseCheckBox;
protected Button fUpdateThreadlistOnSuspend;
protected Button fDebugOnFork;
-
+
/**
* A combo box to let the user choose if fast tracepoints should be used or not.
*/
@@ -78,8 +78,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
comp.setLayout(new GridLayout());
comp.setLayoutData(new GridData(GridData.FILL_BOTH));
fTabFolder = new TabFolder(comp, SWT.NONE);
- fTabFolder.setLayoutData(
- new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL));
+ fTabFolder.setLayoutData(new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL));
createTabs(fTabFolder);
fTabFolder.setSelection(0);
setControl(parent);
@@ -87,31 +86,20 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
- IPreferenceStore preferenceStore = GdbUIPlugin.getDefault()
- .getPreferenceStore();
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
- preferenceStore.getString(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND));
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_GDB_INIT,
- preferenceStore.getString(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_INIT));
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
- preferenceStore.getBoolean(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_NON_STOP));
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
+ IPreferenceStore preferenceStore = GdbUIPlugin.getDefault().getPreferenceStore();
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
+ preferenceStore.getString(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND));
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT,
+ preferenceStore.getString(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_INIT));
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
+ preferenceStore.getBoolean(IGdbDebugPreferenceConstants.PREF_DEFAULT_NON_STOP));
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT);
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT);
if (fSolibBlock != null)
@@ -132,8 +120,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
}
/** utility method to cut down on clutter */
- private String getStringAttr(ILaunchConfiguration config,
- String attributeName, String defaultValue) {
+ private String getStringAttr(ILaunchConfiguration config, String attributeName, String defaultValue) {
try {
return config.getAttribute(attributeName, defaultValue);
} catch (CoreException e) {
@@ -142,8 +129,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
}
/** utility method to cut down on clutter */
- private boolean getBooleanAttr(ILaunchConfiguration config,
- String attributeName, boolean defaultValue) {
+ private boolean getBooleanAttr(ILaunchConfiguration config, String attributeName, boolean defaultValue) {
try {
return config.getAttribute(attributeName, defaultValue);
} catch (CoreException e) {
@@ -154,22 +140,14 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
setInitializing(true);
- IPreferenceStore preferenceStore = GdbUIPlugin.getDefault()
- .getPreferenceStore();
- String gdbCommand = getStringAttr(configuration,
- IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
- preferenceStore.getString(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND));
- String gdbInit = getStringAttr(configuration,
- IGDBLaunchConfigurationConstants.ATTR_GDB_INIT,
- preferenceStore.getString(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_INIT));
- boolean nonStopMode = getBooleanAttr(configuration,
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
- preferenceStore.getBoolean(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_NON_STOP));
- boolean reverseEnabled = getBooleanAttr(configuration,
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
+ IPreferenceStore preferenceStore = GdbUIPlugin.getDefault().getPreferenceStore();
+ String gdbCommand = getStringAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
+ preferenceStore.getString(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND));
+ String gdbInit = getStringAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_GDB_INIT,
+ preferenceStore.getString(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_INIT));
+ boolean nonStopMode = getBooleanAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
+ preferenceStore.getBoolean(IGdbDebugPreferenceConstants.PREF_DEFAULT_NON_STOP));
+ boolean reverseEnabled = getBooleanAttr(configuration, IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT);
boolean updateThreadsOnSuspend = getBooleanAttr(configuration,
IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
@@ -198,17 +176,14 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT);
- if (tracepointMode.equals(
- IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_NORMAL_ONLY)) {
+ if (tracepointMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_NORMAL_ONLY)) {
fTracepointModeCombo.setText(TP_NORMAL_ONLY);
- } else if (tracepointMode.equals(
- IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_ONLY)) {
+ } else if (tracepointMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_ONLY)) {
fTracepointModeCombo.setText(TP_FAST_ONLY);
- } else if (tracepointMode.equals(
- IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_THEN_NORMAL)) {
+ } else if (tracepointMode.equals(IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_THEN_NORMAL)) {
fTracepointModeCombo.setText(TP_AUTOMATIC);
} else {
- assert false : "Unknown Tracepoint Mode: " + tracepointMode; // //$NON-NLS-1$
+ assert false : "Unknown Tracepoint Mode: " + tracepointMode; // //$NON-NLS-1$
fTracepointModeCombo.setText(TP_NORMAL_ONLY);
}
}
@@ -217,14 +192,11 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
protected String getSelectedTracepointMode() {
if (fTracepointModeCombo != null) {
int selectedIndex = fTracepointModeCombo.getSelectionIndex();
- if (fTracepointModeCombo.getItem(selectedIndex)
- .equals(TP_NORMAL_ONLY)) {
+ if (fTracepointModeCombo.getItem(selectedIndex).equals(TP_NORMAL_ONLY)) {
return IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_NORMAL_ONLY;
- } else if (fTracepointModeCombo.getItem(selectedIndex)
- .equals(TP_FAST_ONLY)) {
+ } else if (fTracepointModeCombo.getItem(selectedIndex).equals(TP_FAST_ONLY)) {
return IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_ONLY;
- } else if (fTracepointModeCombo.getItem(selectedIndex)
- .equals(TP_AUTOMATIC)) {
+ } else if (fTracepointModeCombo.getItem(selectedIndex).equals(TP_AUTOMATIC)) {
return IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_FAST_THEN_NORMAL;
} else {
assert false : "Unknown Tracepoint mode: " //$NON-NLS-1$
@@ -236,28 +208,19 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
- fGDBCommandText.getText().trim());
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_GDB_INIT,
- fGDBInitText.getText().trim());
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME, fGDBCommandText.getText().trim());
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT, fGDBInitText.getText().trim());
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
fNonStopCheckBox.getSelection());
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
fReverseCheckBox.getSelection());
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
fUpdateThreadlistOnSuspend.getSelection());
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
fDebugOnFork.getSelection());
if (fTracepointModeCombo != null) {
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
getSelectedTracepointMode());
}
@@ -288,7 +251,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
/*
* (non-Javadoc)
- *
+ *
* @see java.util.Observer#update(java.util.Observable, java.lang.Object)
*/
@Override
@@ -298,8 +261,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
}
public IMILaunchConfigurationComponent createSolibBlock(Composite parent) {
- IMILaunchConfigurationComponent block = new GDBSolibBlock(
- new SolibSearchPathBlock(), true, true);
+ IMILaunchConfigurationComponent block = new GDBSolibBlock(new SolibSearchPathBlock(), true, true);
block.createControl(parent);
return block;
}
@@ -312,22 +274,18 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
public void createMainTab(TabFolder tabFolder) {
TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
tabItem.setText(Messages.GDBDebuggerPage_main_tab_name);
- Composite comp = ControlFactory.createCompositeEx(tabFolder, 1,
- GridData.FILL_BOTH);
+ Composite comp = ControlFactory.createCompositeEx(tabFolder, 1, GridData.FILL_BOTH);
((GridLayout) comp.getLayout()).makeColumnsEqualWidth = false;
comp.setFont(tabFolder.getFont());
tabItem.setControl(comp);
- Composite subComp = ControlFactory.createCompositeEx(comp, 3,
- GridData.FILL_HORIZONTAL);
+ Composite subComp = ControlFactory.createCompositeEx(comp, 3, GridData.FILL_HORIZONTAL);
((GridLayout) subComp.getLayout()).makeColumnsEqualWidth = false;
subComp.setFont(tabFolder.getFont());
- Label label = ControlFactory.createLabel(subComp,
- Messages.GDBDebuggerPage_gdb_debugger);
+ Label label = ControlFactory.createLabel(subComp, Messages.GDBDebuggerPage_gdb_debugger);
GridData gd = new GridData();
// gd.horizontalSpan = 2;
label.setLayoutData(gd);
- fGDBCommandText = ControlFactory.createTextField(subComp,
- SWT.SINGLE | SWT.BORDER);
+ fGDBCommandText = ControlFactory.createTextField(subComp, SWT.SINGLE | SWT.BORDER);
fGDBCommandText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent evt) {
@@ -335,8 +293,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
updateLaunchConfigurationDialog();
}
});
- Button button = createPushButton(subComp,
- Messages.GDBDebuggerPage_gdb_browse, null);
+ Button button = createPushButton(subComp, Messages.GDBDebuggerPage_gdb_browse, null);
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
@@ -368,13 +325,11 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
fGDBCommandText.setText(res);
}
});
- label = ControlFactory.createLabel(subComp,
- Messages.GDBDebuggerPage_gdb_command_file);
+ label = ControlFactory.createLabel(subComp, Messages.GDBDebuggerPage_gdb_command_file);
gd = new GridData();
// gd.horizontalSpan = 2;
label.setLayoutData(gd);
- fGDBInitText = ControlFactory.createTextField(subComp,
- SWT.SINGLE | SWT.BORDER);
+ fGDBInitText = ControlFactory.createTextField(subComp, SWT.SINGLE | SWT.BORDER);
gd = new GridData(GridData.FILL_HORIZONTAL);
fGDBInitText.setLayoutData(gd);
fGDBInitText.addModifyListener(new ModifyListener() {
@@ -384,8 +339,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
updateLaunchConfigurationDialog();
}
});
- button = createPushButton(subComp,
- Messages.GDBDebuggerPage_gdb_cmdfile_browse, null);
+ button = createPushButton(subComp, Messages.GDBDebuggerPage_gdb_cmdfile_browse, null);
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
@@ -399,8 +353,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
String gdbCommand = fGDBInitText.getText().trim();
int lastSeparatorIndex = gdbCommand.lastIndexOf(File.separator);
if (lastSeparatorIndex != -1) {
- dialog.setFilterPath(
- gdbCommand.substring(0, lastSeparatorIndex));
+ dialog.setFilterPath(gdbCommand.substring(0, lastSeparatorIndex));
}
String res = dialog.open();
if (res == null) {
@@ -410,9 +363,8 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
}
});
- label = ControlFactory.createLabel(subComp,
- Messages.GDBDebuggerPage_cmdfile_warning,
- 200, SWT.DEFAULT, SWT.WRAP);
+ label = ControlFactory.createLabel(subComp, Messages.GDBDebuggerPage_cmdfile_warning, 200, SWT.DEFAULT,
+ SWT.WRAP);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 3;
@@ -421,23 +373,17 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
// TODO: Ideally, this field should be disabled if the back-end doesn't support non-stop debugging
// TODO: Find a way to determine if non-stop is supported (i.e. find the GDB version) then grey out the check box if necessary
- fNonStopCheckBox = addCheckbox(subComp,
- Messages.GDBDebuggerPage_nonstop_mode);
+ fNonStopCheckBox = addCheckbox(subComp, Messages.GDBDebuggerPage_nonstop_mode);
// TODO: Ideally, this field should be disabled if the back-end doesn't support reverse debugging
// TODO: Find a way to determine if reverse is supported (i.e. find the GDB version) then grey out the check box if necessary
- fReverseCheckBox = addCheckbox(subComp,
- Messages.GDBDebuggerPage_reverse_Debugging);
- fUpdateThreadlistOnSuspend = addCheckbox(subComp,
- Messages.GDBDebuggerPage_update_thread_list_on_suspend);
+ fReverseCheckBox = addCheckbox(subComp, Messages.GDBDebuggerPage_reverse_Debugging);
+ fUpdateThreadlistOnSuspend = addCheckbox(subComp, Messages.GDBDebuggerPage_update_thread_list_on_suspend);
// This checkbox needs an explanation. Attach context help to it.
- PlatformUI.getWorkbench().getHelpSystem().setHelp(
- fUpdateThreadlistOnSuspend,
- GdbUIPlugin.PLUGIN_ID
- + ".update_threadlist_button_context"); //$NON-NLS-1$
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(fUpdateThreadlistOnSuspend,
+ GdbUIPlugin.PLUGIN_ID + ".update_threadlist_button_context"); //$NON-NLS-1$
- fDebugOnFork = addCheckbox(subComp,
- Messages.GDBDebuggerPage_Automatically_debug_forked_processes);
+ fDebugOnFork = addCheckbox(subComp, Messages.GDBDebuggerPage_Automatically_debug_forked_processes);
createTracepointModeCombo(subComp);
}
@@ -460,13 +406,11 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
protected void createTracepointModeCombo(Composite parent) {
// Add a combo to choose the type of tracepoint mode to use
- Label label = ControlFactory.createLabel(parent,
- Messages.GDBDebuggerPage_tracepoint_mode_label);
+ Label label = ControlFactory.createLabel(parent, Messages.GDBDebuggerPage_tracepoint_mode_label);
label.setLayoutData(new GridData());
fTracepointModeCombo = new Combo(parent, SWT.READ_ONLY | SWT.DROP_DOWN);
- fTracepointModeCombo.setLayoutData(
- new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
+ fTracepointModeCombo.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1));
fTracepointModeCombo.add(TP_NORMAL_ONLY);
fTracepointModeCombo.add(TP_FAST_ONLY);
fTracepointModeCombo.add(TP_AUTOMATIC);
@@ -487,8 +431,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
public void createSolibTab(TabFolder tabFolder) {
TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
tabItem.setText(Messages.GDBDebuggerPage10);
- Composite comp = ControlFactory.createCompositeEx(fTabFolder, 1,
- GridData.FILL_BOTH);
+ Composite comp = ControlFactory.createCompositeEx(fTabFolder, 1, GridData.FILL_BOTH);
comp.setFont(tabFolder.getFont());
tabItem.setControl(comp);
fSolibBlock = createSolibBlock(comp);
@@ -498,7 +441,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
*/
@Override
@@ -513,7 +456,7 @@ public class GdbDebuggerPage extends AbstractCDebuggerPage implements Observer {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug
* .core.ILaunchConfigurationWorkingCopy)
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ILaunchConstants.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ILaunchConstants.java
index f28979ca4d..62dc1b902b 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ILaunchConstants.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ILaunchConstants.java
@@ -18,35 +18,26 @@ import org.eclipse.debug.core.DebugPlugin;
public interface ILaunchConstants {
- public final static String LAUNCH_ID = DockerLaunchUIPlugin
- .getUniqueIdentifier() + ".launchConfigurationType"; //$NON-NLS-1$
+ public final static String LAUNCH_ID = DockerLaunchUIPlugin.getUniqueIdentifier() + ".launchConfigurationType"; //$NON-NLS-1$
- public final static String ATTR_ADDITIONAL_DIRS = DockerLaunchUIPlugin
- .getUniqueIdentifier() + ".additional_dirs"; //$NON-NLS-1$
+ public final static String ATTR_ADDITIONAL_DIRS = DockerLaunchUIPlugin.getUniqueIdentifier() + ".additional_dirs"; //$NON-NLS-1$
- public final static String ATTR_EXPOSED_PORTS = DockerLaunchUIPlugin
- .getUniqueIdentifier() + ".exposed_ports"; //$NON-NLS-1$
+ public final static String ATTR_EXPOSED_PORTS = DockerLaunchUIPlugin.getUniqueIdentifier() + ".exposed_ports"; //$NON-NLS-1$
- public final static String ATTR_IMAGE = DockerLaunchUIPlugin.getUniqueIdentifier()
- + ".image"; //$NON-NLS-1$
+ public final static String ATTR_IMAGE = DockerLaunchUIPlugin.getUniqueIdentifier() + ".image"; //$NON-NLS-1$
- public final static String ATTR_CONNECTION_URI = DockerLaunchUIPlugin
- .getUniqueIdentifier() + ".connection_uri"; //$NON-NLS-1$
+ public final static String ATTR_CONNECTION_URI = DockerLaunchUIPlugin.getUniqueIdentifier() + ".connection_uri"; //$NON-NLS-1$
- public final static String ATTR_KEEP_AFTER_LAUNCH = DockerLaunchUIPlugin
- .getUniqueIdentifier() + ".keep_after_launch"; //$NON-NLS-1$
+ public final static String ATTR_KEEP_AFTER_LAUNCH = DockerLaunchUIPlugin.getUniqueIdentifier()
+ + ".keep_after_launch"; //$NON-NLS-1$
- public final static String ATTR_STDIN_SUPPORT = DockerLaunchUIPlugin
- .getUniqueIdentifier() + ".support_std_input"; //$NON-NLS-1$
+ public final static String ATTR_STDIN_SUPPORT = DockerLaunchUIPlugin.getUniqueIdentifier() + ".support_std_input"; //$NON-NLS-1$
- public final static String ATTR_PRIVILEGED_MODE = DockerLaunchUIPlugin
- .getUniqueIdentifier() + ".privileged_mode"; //$NON-NLS-1$
+ public final static String ATTR_PRIVILEGED_MODE = DockerLaunchUIPlugin.getUniqueIdentifier() + ".privileged_mode"; //$NON-NLS-1$
// Attributes that need to match CDT attribute names
- public static final String ATTR_GDBSERVER_PORT = DebugPlugin
- .getUniqueIdentifier() + ".ATTR_GDBSERVER_PORT"; //$NON-NLS-1$
- public static final String ATTR_GDBSERVER_COMMAND = DebugPlugin
- .getUniqueIdentifier() + ".ATTR_GDBSERVER_COMMAND"; //$NON-NLS-1$
+ public static final String ATTR_GDBSERVER_PORT = DebugPlugin.getUniqueIdentifier() + ".ATTR_GDBSERVER_PORT"; //$NON-NLS-1$
+ public static final String ATTR_GDBSERVER_COMMAND = DebugPlugin.getUniqueIdentifier() + ".ATTR_GDBSERVER_COMMAND"; //$NON-NLS-1$
public static final String ATTR_GDBSERVER_PORT_DEFAULT = "2345"; //$NON-NLS-1$
public static final String ATTR_GDBSERVER_COMMAND_DEFAULT = "gdbserver"; //$NON-NLS-1$
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
index 34a9751681..f40abf3441 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/LaunchShortcut.java
@@ -96,17 +96,16 @@ public class LaunchShortcut implements ILaunchShortcut {
/**
* Method getLaunchConfigType.
- *
+ *
* @return ILaunchConfigurationType
*/
protected ILaunchConfigurationType getLaunchConfigType() {
- return getLaunchManager()
- .getLaunchConfigurationType(ILaunchConstants.LAUNCH_ID);
+ return getLaunchManager().getLaunchConfigurationType(ILaunchConstants.LAUNCH_ID);
}
/**
* Search and launch binary.
- *
+ *
* @param elements
* Binaries to search.
* @param mode
@@ -119,31 +118,22 @@ public class LaunchShortcut implements ILaunchShortcut {
bin = (IBinary) elements[0];
} else {
final List<IBinary> results = new ArrayList<>();
- ProgressMonitorDialog dialog = new ProgressMonitorDialog(
- getActiveWorkbenchShell());
+ ProgressMonitorDialog dialog = new ProgressMonitorDialog(getActiveWorkbenchShell());
IRunnableWithProgress runnable = new IRunnableWithProgress() {
@Override
- public void run(IProgressMonitor pm)
- throws InterruptedException {
+ public void run(IProgressMonitor pm) throws InterruptedException {
int nElements = elements.length;
- pm.beginTask(
- Messages.LaunchShortcut_Looking_for_executables,
- nElements);
+ pm.beginTask(Messages.LaunchShortcut_Looking_for_executables, nElements);
try {
IProgressMonitor sub = new SubProgressMonitor(pm, 1);
for (int i = 0; i < nElements; i++) {
if (elements[i] instanceof IAdaptable) {
- IResource r = (IResource) ((IAdaptable) elements[i])
- .getAdapter(IResource.class);
+ IResource r = (IResource) ((IAdaptable) elements[i]).getAdapter(IResource.class);
if (r != null) {
- ICProject cproject = CoreModel
- .getDefault().create(
- r.getProject());
+ ICProject cproject = CoreModel.getDefault().create(r.getProject());
if (cproject != null) {
try {
- IBinary[] bins = cproject
- .getBinaryContainer()
- .getBinaries();
+ IBinary[] bins = cproject.getBinaryContainer().getBinaries();
for (IBinary bin : bins) {
if (bin.isExecutable()) {
@@ -194,7 +184,7 @@ public class LaunchShortcut implements ILaunchShortcut {
/**
* Prompts the user to select a binary
- *
+ *
* @param binList
* The list of binaries.
* @param mode
@@ -219,8 +209,7 @@ public class LaunchShortcut implements ILaunchShortcut {
if (element instanceof IBinary) {
IBinary bin = (IBinary) element;
StringBuilder name = new StringBuilder();
- name.append(bin.getCPU()
- + (bin.isLittleEndian() ? "le" : "be")); //$NON-NLS-1$ //$NON-NLS-2$
+ name.append(bin.getCPU() + (bin.isLittleEndian() ? "le" : "be")); //$NON-NLS-1$ //$NON-NLS-2$
name.append(" - "); //$NON-NLS-1$
name.append(bin.getPath().toString());
return name.toString();
@@ -229,8 +218,7 @@ public class LaunchShortcut implements ILaunchShortcut {
}
};
- TwoPaneElementSelector dialog = new TwoPaneElementSelector(
- getActiveWorkbenchShell(), programLabelProvider,
+ TwoPaneElementSelector dialog = new TwoPaneElementSelector(getActiveWorkbenchShell(), programLabelProvider,
qualifierLabelProvider);
dialog.setElements(binList.toArray());
dialog.setTitle(Messages.LaunchShortcut_Launcher);
@@ -246,14 +234,13 @@ public class LaunchShortcut implements ILaunchShortcut {
}
protected void handleFail(String message) {
- MessageDialog.openError(getActiveWorkbenchShell(),
- Messages.LaunchShortcut_Launcher, message);
+ MessageDialog.openError(getActiveWorkbenchShell(), Messages.LaunchShortcut_Launcher, message);
}
/**
* Locate a configuration to launch for the given type. If one cannot be
* found, create one.
- *
+ *
* @param bin
* The binary to look launch for.
* @param mode
@@ -261,8 +248,7 @@ public class LaunchShortcut implements ILaunchShortcut {
*
* @return A re-useable config or <code>null</code> if none.
*/
- protected ILaunchConfiguration findLaunchConfiguration(IBinary bin,
- String mode) {
+ protected ILaunchConfiguration findLaunchConfiguration(IBinary bin, String mode) {
ILaunchConfiguration configuration = null;
ILaunchConfigurationType configType = getLaunchConfigType();
List<ILaunchConfiguration> candidateConfigs = Collections.emptyList();
@@ -275,33 +261,25 @@ public class LaunchShortcut implements ILaunchShortcut {
cbcfg = buildConfig.getAdapter(ICBuildConfiguration.class);
if (cbcfg != null) {
IToolChain toolChain = cbcfg.getToolChain();
- connectionUri = toolChain.getProperty(
- IContainerLaunchTarget.ATTR_CONNECTION_URI);
- imageName = toolChain
- .getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
+ connectionUri = toolChain.getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI);
+ imageName = toolChain.getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
}
} catch (CoreException e1) {
// do nothing
}
if (cbcfg == null) {
- ICConfigurationDescription cfgd = CoreModel.getDefault()
- .getProjectDescription(project).getActiveConfiguration();
+ ICConfigurationDescription cfgd = CoreModel.getDefault().getProjectDescription(project)
+ .getActiveConfiguration();
if (cfgd != null) {
- IConfiguration cfg = ManagedBuildManager
- .getConfigurationForDescription(cfgd);
+ IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgd);
if (cfg != null) {
- IOptionalBuildProperties props = cfg
- .getOptionalBuildProperties();
- String containerBuild = props.getProperty(
- ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
+ IOptionalBuildProperties props = cfg.getOptionalBuildProperties();
+ String containerBuild = props.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
if (containerBuild != null) {
- boolean containerBuildEnabled = Boolean
- .parseBoolean(containerBuild);
+ boolean containerBuildEnabled = Boolean.parseBoolean(containerBuild);
if (containerBuildEnabled) {
- connectionUri = props.getProperty(
- ContainerCommandLauncher.CONNECTION_ID);
- imageName = props.getProperty(
- ContainerCommandLauncher.IMAGE_ID);
+ connectionUri = props.getProperty(ContainerCommandLauncher.CONNECTION_ID);
+ imageName = props.getProperty(ContainerCommandLauncher.IMAGE_ID);
}
}
}
@@ -309,12 +287,10 @@ public class LaunchShortcut implements ILaunchShortcut {
}
if (connectionUri == null) {
- IDockerConnection[] connections = DockerConnectionManager
- .getInstance().getConnections();
+ IDockerConnection[] connections = DockerConnectionManager.getInstance().getConnections();
if (connections != null && connections.length > 0) {
connectionUri = connections[0].getUri();
- Preferences prefs = InstanceScope.INSTANCE
- .getNode(DockerLaunchUIPlugin.PLUGIN_ID);
+ Preferences prefs = InstanceScope.INSTANCE.getNode(DockerLaunchUIPlugin.PLUGIN_ID);
imageName = prefs.get(PreferenceConstants.DEFAULT_IMAGE, null);
if (imageName == null) {
List<IDockerImage> images = connections[0].getImages();
@@ -325,38 +301,30 @@ public class LaunchShortcut implements ILaunchShortcut {
}
try {
- ILaunchConfiguration[] configs = DebugPlugin.getDefault()
- .getLaunchManager().getLaunchConfigurations(configType);
+ ILaunchConfiguration[] configs = DebugPlugin.getDefault().getLaunchManager()
+ .getLaunchConfigurations(configType);
candidateConfigs = new ArrayList<>(configs.length);
for (ILaunchConfiguration config : configs) {
IPath programPath = CDebugUtils.getProgramPath(config);
String projectName = CDebugUtils.getProjectName(config);
IPath binPath = bin.getResource().getProjectRelativePath();
- if (projectName != null && projectName
- .equals(bin.getCProject().getProject().getName())) {
+ if (projectName != null && projectName.equals(bin.getCProject().getProject().getName())) {
if (programPath != null) {
if (programPath.equals(binPath)) {
// if we have an active configuration with container
// build properties, make sure they match, otherwise
// add the launch config as a candidate
- if (connectionUri != null
- && connectionUri.equals(config.getAttribute(
- ILaunchConstants.ATTR_CONNECTION_URI,
- (String) null))) {
- if (imageName != null
- && imageName.equals(config.getAttribute(
- ILaunchConstants.ATTR_IMAGE,
- (String) null))) {
+ if (connectionUri != null && connectionUri
+ .equals(config.getAttribute(ILaunchConstants.ATTR_CONNECTION_URI, (String) null))) {
+ if (imageName != null && imageName
+ .equals(config.getAttribute(ILaunchConstants.ATTR_IMAGE, (String) null))) {
candidateConfigs.add(config);
}
}
}
} else if (cbcfg != null && candidateConfigs.isEmpty()) {
- ILaunchConfigurationWorkingCopy wc = config
- .getWorkingCopy();
- populateLaunchConfiguration(wc, mode, bin,
- projectName,
- connectionUri, imageName);
+ ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
+ populateLaunchConfiguration(wc, mode, bin, projectName, connectionUri, imageName);
wc.doSave();
candidateConfigs.add(config);
break;
@@ -388,53 +356,39 @@ public class LaunchShortcut implements ILaunchShortcut {
return configuration;
}
- private void populateLaunchConfiguration(ILaunchConfigurationWorkingCopy wc,
- String mode, IBinary bin, String projectName, String connectionUri,
- String imageName) {
+ private void populateLaunchConfiguration(ILaunchConfigurationWorkingCopy wc, String mode, IBinary bin,
+ String projectName, String connectionUri, String imageName) {
// DSF settings...use GdbUIPlugin preference store for defaults
- IPreferenceStore preferenceStore = GdbUIPlugin.getDefault()
- .getPreferenceStore();
+ IPreferenceStore preferenceStore = GdbUIPlugin.getDefault().getPreferenceStore();
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
- preferenceStore.getString(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND));
+ preferenceStore.getString(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND));
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT,
- preferenceStore.getString(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_INIT));
+ preferenceStore.getString(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_INIT));
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
- preferenceStore.getBoolean(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_NON_STOP));
+ preferenceStore.getBoolean(IGdbDebugPreferenceConstants.PREF_DEFAULT_NON_STOP));
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT);
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT);
wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
bin.getResource().getProjectRelativePath().toString());
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME,
- projectName);
- wc.setMappedResources(new IResource[] { bin.getResource(),
- bin.getResource().getProject() });
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
- (String) null); // default is the project directory
-
- Preferences prefs = InstanceScope.INSTANCE
- .getNode(DockerLaunchUIPlugin.PLUGIN_ID);
-
- Boolean keepPref = prefs.getBoolean(
- PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH, false);
+ wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
+ wc.setMappedResources(new IResource[] { bin.getResource(), bin.getResource().getProject() });
+ wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); // default is the project directory
+
+ Preferences prefs = InstanceScope.INSTANCE.getNode(DockerLaunchUIPlugin.PLUGIN_ID);
+
+ Boolean keepPref = prefs.getBoolean(PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH, false);
wc.setAttribute(ILaunchConstants.ATTR_KEEP_AFTER_LAUNCH, keepPref);
// For Debug mode we need to set gdbserver info as well
if (mode.equals(ILaunchManager.DEBUG_MODE)) {
- wc.setAttribute(ILaunchConstants.ATTR_GDBSERVER_COMMAND,
- "gdbserver"); //$NON-NLS-1$
+ wc.setAttribute(ILaunchConstants.ATTR_GDBSERVER_COMMAND, "gdbserver"); //$NON-NLS-1$
wc.setAttribute(ILaunchConstants.ATTR_GDBSERVER_PORT, "2345"); //$NON-NLS-1$
}
wc.setAttribute(ILaunchConstants.ATTR_CONNECTION_URI, connectionUri);
@@ -452,8 +406,7 @@ public class LaunchShortcut implements ILaunchShortcut {
* resource, and false if it should not be saved.
* @return a launch configuration generated for the binary.
*/
- protected ILaunchConfiguration createConfiguration(IBinary bin,
- String mode, boolean save) {
+ protected ILaunchConfiguration createConfiguration(IBinary bin, String mode, boolean save) {
ILaunchConfiguration config = null;
try {
IProject project = bin.getResource().getProject();
@@ -462,54 +415,39 @@ public class LaunchShortcut implements ILaunchShortcut {
String connectionId = null;
String imageName = null;
IBuildConfiguration buildConfig = project.getActiveBuildConfig();
- ICBuildConfiguration cbuildcfg = buildConfig
- .getAdapter(ICBuildConfiguration.class);
+ ICBuildConfiguration cbuildcfg = buildConfig.getAdapter(ICBuildConfiguration.class);
if (cbuildcfg != null) {
IToolChain toolChain = cbuildcfg.getToolChain();
- connectionId = toolChain.getProperty(
- IContainerLaunchTarget.ATTR_CONNECTION_URI);
- imageName = toolChain
- .getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
+ connectionId = toolChain.getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI);
+ imageName = toolChain.getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
} else {
- ICConfigurationDescription cfgd = CoreModel.getDefault()
- .getProjectDescription(project)
+ ICConfigurationDescription cfgd = CoreModel.getDefault().getProjectDescription(project)
.getActiveConfiguration();
- IConfiguration cfg = ManagedBuildManager
- .getConfigurationForDescription(cfgd);
+ IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgd);
- IOptionalBuildProperties options = cfg
- .getOptionalBuildProperties();
+ IOptionalBuildProperties options = cfg.getOptionalBuildProperties();
if (options != null) {
- String containerBuildString = options.getProperty(
- ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
+ String containerBuildString = options.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED);
if (containerBuildString != null) {
containerBuild = Boolean
- .parseBoolean(options.getProperty(
- ContainerCommandLauncher.CONTAINER_BUILD_ENABLED));
+ .parseBoolean(options.getProperty(ContainerCommandLauncher.CONTAINER_BUILD_ENABLED));
}
if (containerBuild) {
- connectionId = options.getProperty(
- ContainerCommandLauncher.CONNECTION_ID);
- imageName = options
- .getProperty(ContainerCommandLauncher.IMAGE_ID);
+ connectionId = options.getProperty(ContainerCommandLauncher.CONNECTION_ID);
+ imageName = options.getProperty(ContainerCommandLauncher.IMAGE_ID);
}
}
}
ILaunchConfigurationType configType = getLaunchConfigType();
- ILaunchConfigurationWorkingCopy wc = configType.newInstance(
- null,
+ ILaunchConfigurationWorkingCopy wc = configType.newInstance(null,
getLaunchManager().generateLaunchConfigurationName(
- bin.getResource().getName() + (imageName != null
- ? ("[" + imageName + "]") //$NON-NLS-1$ //$NON-NLS-2$
+ bin.getResource().getName() + (imageName != null ? ("[" + imageName + "]") //$NON-NLS-1$ //$NON-NLS-2$
: ""))); //$NON-NLS-1$
-
-
- Preferences prefs = InstanceScope.INSTANCE
- .getNode(DockerLaunchUIPlugin.PLUGIN_ID);
+ Preferences prefs = InstanceScope.INSTANCE.getNode(DockerLaunchUIPlugin.PLUGIN_ID);
// get the connection using following order:
// 1. connection used in build of project
@@ -517,16 +455,13 @@ public class LaunchShortcut implements ILaunchShortcut {
// 3. first connection
IDockerConnection connection = null;
if (connectionId != null) {
- connection = DockerConnectionManager.getInstance()
- .getConnectionByUri(connectionId);
+ connection = DockerConnectionManager.getInstance().getConnectionByUri(connectionId);
}
if (connection == null) {
- connection = ConnectionListener.getInstance()
- .getCurrentConnection();
+ connection = ConnectionListener.getInstance().getCurrentConnection();
}
if (connection == null) {
- IDockerConnection[] connections = DockerConnectionManager
- .getInstance().getConnections();
+ IDockerConnection[] connections = DockerConnectionManager.getInstance().getConnections();
if (connections != null && connections.length > 0)
connection = connections[0];
}
@@ -536,17 +471,14 @@ public class LaunchShortcut implements ILaunchShortcut {
@Override
public void run() {
- MessageDialog.openError(
- Display.getCurrent().getActiveShell(),
- Messages.LaunchShortcut_Error_Launching,
- Messages.LaunchShortcut_No_Connections);
+ MessageDialog.openError(Display.getCurrent().getActiveShell(),
+ Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Connections);
}
});
return null;
}
-
// use build image if one is specified, otherwise, see if a default
// image is set in preferences, otherwise find first image in image
// list
@@ -567,18 +499,15 @@ public class LaunchShortcut implements ILaunchShortcut {
@Override
public void run() {
- MessageDialog.openError(
- Display.getCurrent().getActiveShell(),
- Messages.LaunchShortcut_Error_Launching,
- Messages.LaunchShortcut_No_Images);
+ MessageDialog.openError(Display.getCurrent().getActiveShell(),
+ Messages.LaunchShortcut_Error_Launching, Messages.LaunchShortcut_No_Images);
}
});
return null;
}
- populateLaunchConfiguration(wc, mode, bin, project.getName(),
- connection.getUri(), image);
+ populateLaunchConfiguration(wc, mode, bin, project.getName(), connection.getUri(), image);
if (save) {
config = wc.doSave();
@@ -598,7 +527,7 @@ public class LaunchShortcut implements ILaunchShortcut {
/**
* Show a selection dialog that allows the user to choose one of the
* specified launch configurations.
- *
+ *
* @param configList
* The list of launch configurations to choose from.
* @param mode
@@ -606,12 +535,9 @@ public class LaunchShortcut implements ILaunchShortcut {
* @return The chosen config, or <code>null</code> if the user cancelled the
* dialog.
*/
- protected ILaunchConfiguration chooseConfiguration(
- List<ILaunchConfiguration> configList, String mode) {
- IDebugModelPresentation labelProvider = DebugUITools
- .newDebugModelPresentation();
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(
- getActiveWorkbenchShell(), labelProvider);
+ protected ILaunchConfiguration chooseConfiguration(List<ILaunchConfiguration> configList, String mode) {
+ IDebugModelPresentation labelProvider = DebugUITools.newDebugModelPresentation();
+ ElementListSelectionDialog dialog = new ElementListSelectionDialog(getActiveWorkbenchShell(), labelProvider);
dialog.setElements(configList.toArray());
dialog.setTitle(Messages.LaunchShortcut_Launch_Configuration_Selection);
dialog.setMessage(Messages.LaunchShortcut_Choose_a_launch_configuration);
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/Messages.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/Messages.java
index 2ac47015ae..3d2565222d 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/Messages.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/Messages.java
@@ -72,7 +72,7 @@ public class Messages extends NLS {
public static String Port_number_textfield_label;
public static String Gdbserver_start;
public static String Gdbserver_up;
-
+
public static String GDBDebuggerPage0;
public static String GDBDebuggerPage1;
public static String GDBDebuggerPage2;
@@ -86,7 +86,7 @@ public class Messages extends NLS {
public static String GDBDebuggerPage10;
public static String GDBDebuggerPage11;
public static String GDBDebuggerPage12;
-
+
public static String GDBDebuggerPage_gdb_executable_not_specified;
public static String GDBDebuggerPage_tab_name;
public static String GDBDebuggerPage_main_tab_name;
@@ -106,7 +106,7 @@ public class Messages extends NLS {
public static String GDBDebuggerPage_tracepoint_mode_fast;
public static String GDBDebuggerPage_tracepoint_mode_normal;
public static String GDBDebuggerPage_tracepoint_mode_auto;
-
+
public static String StandardGDBDebuggerPage14;
public static String ContainerPropertyTab_Title;
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerPage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerPage.java
index 771fcc3ca0..9b6f3f7062 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerPage.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerPage.java
@@ -1,16 +1,16 @@
/*******************************************************************************
* Copyright (c) 2006, 2018 PalmSource, Inc. and others.
*
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
+ * This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License 2.0
+ * which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
* Ewa Matejska (PalmSource)
- *
+ *
* Referenced GDBDebuggerPage code to write this.
* Anna Dushistova (Mentor Graphics) - moved to org.eclipse.cdt.launch.remote.tabs
* Red Hat Inc. - modified to work with CDT Container Launcher
@@ -62,13 +62,10 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
super.setDefaults(configuration);
configuration.setAttribute(ILaunchConstants.ATTR_GDBSERVER_COMMAND,
ILaunchConstants.ATTR_GDBSERVER_COMMAND_DEFAULT);
- configuration.setAttribute(ILaunchConstants.ATTR_GDBSERVER_PORT,
- ILaunchConstants.ATTR_GDBSERVER_PORT_DEFAULT);
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
+ configuration.setAttribute(ILaunchConstants.ATTR_GDBSERVER_PORT, ILaunchConstants.ATTR_GDBSERVER_PORT_DEFAULT);
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
LaunchUtils.getRemoteTimeoutEnabledDefault());
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
LaunchUtils.getRemoteTimeoutValueDefault());
}
@@ -80,14 +77,12 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
boolean remoteTimeoutEnabled = false;
String remoteTimeoutValue = null;
try {
- gdbserverCommand = configuration.getAttribute(
- ILaunchConstants.ATTR_GDBSERVER_COMMAND,
+ gdbserverCommand = configuration.getAttribute(ILaunchConstants.ATTR_GDBSERVER_COMMAND,
ILaunchConstants.ATTR_GDBSERVER_COMMAND_DEFAULT);
} catch (CoreException e) {
}
try {
- gdbserverPortNumber = configuration.getAttribute(
- ILaunchConstants.ATTR_GDBSERVER_PORT,
+ gdbserverPortNumber = configuration.getAttribute(ILaunchConstants.ATTR_GDBSERVER_PORT,
ILaunchConstants.ATTR_GDBSERVER_PORT_DEFAULT);
} catch (CoreException e) {
}
@@ -115,20 +110,15 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
super.performApply(configuration);
String str = fGDBServerCommandText.getText();
str.trim();
- configuration
- .setAttribute(ILaunchConstants.ATTR_GDBSERVER_COMMAND, str);
+ configuration.setAttribute(ILaunchConstants.ATTR_GDBSERVER_COMMAND, str);
str = fGDBServerPortNumberText.getText();
str.trim();
configuration.setAttribute(ILaunchConstants.ATTR_GDBSERVER_PORT, str);
boolean b = fRemoteTimeoutEnabledCheckbox.getSelection();
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED,
- b);
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_ENABLED, b);
str = fRemoteTimeoutValueText.getText();
str.trim();
- configuration.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE,
- str);
+ configuration.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REMOTE_TIMEOUT_VALUE, str);
}
protected void createGdbserverSettingsTab(TabFolder tabFolder) {
@@ -178,27 +168,22 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
});
fRemoteTimeoutEnabledCheckbox = new Button(subComp, SWT.CHECK);
- fRemoteTimeoutEnabledCheckbox
- .setText(Messages.Gdbserver_Settings_Remotetimeout_label);
- fRemoteTimeoutEnabledCheckbox
- .setToolTipText(
- Messages.Gdbserver_Settings_Remotetimeout_tooltip);
+ fRemoteTimeoutEnabledCheckbox.setText(Messages.Gdbserver_Settings_Remotetimeout_label);
+ fRemoteTimeoutEnabledCheckbox.setToolTipText(Messages.Gdbserver_Settings_Remotetimeout_tooltip);
gd = new GridData();
fRemoteTimeoutEnabledCheckbox.setLayoutData(gd);
- fRemoteTimeoutEnabledCheckbox
- .addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- remoteTimeoutEnabledChanged();
- updateLaunchConfigurationDialog();
- }
- });
+ fRemoteTimeoutEnabledCheckbox.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ remoteTimeoutEnabledChanged();
+ updateLaunchConfigurationDialog();
+ }
+ });
fRemoteTimeoutValueText = new Text(subComp, SWT.SINGLE | SWT.BORDER);
data = new GridData(SWT.FILL, SWT.TOP, true, false);
fRemoteTimeoutValueText.setLayoutData(data);
- fRemoteTimeoutValueText.setToolTipText(
- Messages.Gdbserver_Settings_Remotetimeout_tooltip);
+ fRemoteTimeoutValueText.setToolTipText(Messages.Gdbserver_Settings_Remotetimeout_tooltip);
fRemoteTimeoutValueText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent evt) {
@@ -209,13 +194,12 @@ public class RemoteDebuggerPage extends GdbDebuggerPage {
}
private void remoteTimeoutEnabledChanged() {
- fRemoteTimeoutValueText
- .setEnabled(fRemoteTimeoutEnabledCheckbox.getSelection());
+ fRemoteTimeoutValueText.setEnabled(fRemoteTimeoutEnabledCheckbox.getSelection());
}
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.cdt.debug.mi.internal.ui.GDBDebuggerPage#createTabs(org.eclipse
* .swt.widgets.TabFolder)
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerTab.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerTab.java
index 1f5a9fa552..35ab0ff106 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerTab.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/RemoteDebuggerTab.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Anna Dushistova (Mentor Graphics) - initial API and implementation
* Anna Dushistova (Mentor Graphics) - moved to org.eclipse.cdt.launch.remote.tabs
@@ -78,8 +78,7 @@ public class RemoteDebuggerTab extends CDebuggerTab {
return;
}
// Ask the dynamic UI to create its Control
- debuggerPage
- .setLaunchConfigurationDialog(getLaunchConfigurationDialog());
+ debuggerPage.setLaunchConfigurationDialog(getLaunchConfigurationDialog());
debuggerPage.createControl(dynamicTabHolder);
debuggerPage.getControl().setVisible(true);
dynamicTabHolder.layout(true);
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/SWTImagesFactory.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/SWTImagesFactory.java
index 4be09c4614..f05af73572 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/SWTImagesFactory.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/SWTImagesFactory.java
@@ -24,9 +24,7 @@ import org.eclipse.swt.graphics.Image;
public class SWTImagesFactory {
// The plug-in registry
- private static ImageRegistry imageRegistry = DockerLaunchUIPlugin
- .getDefault()
- .getImageRegistry();
+ private static ImageRegistry imageRegistry = DockerLaunchUIPlugin.getDefault().getImageRegistry();
// Sub-directory (under the package containing this class) where 16 color
// images are
@@ -34,43 +32,33 @@ public class SWTImagesFactory {
static {
try {
- fgIconBaseURL = new URL(
- DockerLaunchUIPlugin.getDefault().getBundle()
- .getEntry("/"), "icons/"); //$NON-NLS-1$ //$NON-NLS-2$
+ fgIconBaseURL = new URL(DockerLaunchUIPlugin.getDefault().getBundle().getEntry("/"), "icons/"); //$NON-NLS-1$ //$NON-NLS-2$
} catch (MalformedURLException e) {
DockerLaunchUIPlugin.log(e);
}
}
- private static final String NAME_PREFIX = DockerLaunchUIPlugin.PLUGIN_ID
- + '.';
+ private static final String NAME_PREFIX = DockerLaunchUIPlugin.PLUGIN_ID + '.';
private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length();
- public static final String IMG_CONTAINER = NAME_PREFIX
- + "repository-middle.gif"; //$NON-NLS-1$
- public static final String IMG_FOLDER_CLOSED = NAME_PREFIX
- + "folder_closed.gif"; //$NON-NLS-1$
+ public static final String IMG_CONTAINER = NAME_PREFIX + "repository-middle.gif"; //$NON-NLS-1$
+ public static final String IMG_FOLDER_CLOSED = NAME_PREFIX + "folder_closed.gif"; //$NON-NLS-1$
public static final String IMG_FILE = NAME_PREFIX + "file_obj.gif"; //$NON-NLS-1$
public static final String IMG_WARNING = NAME_PREFIX + "warning_obj.gif"; //$NON-NLS-1$
public static final String IMG_ERROR = NAME_PREFIX + "error_obj.gif"; //$NON-NLS-1$
- public static final ImageDescriptor DESC_CONTAINER = createManaged("",
- IMG_CONTAINER);
- public static final ImageDescriptor DESC_FOLDER_CLOSED = createManaged("",
- IMG_FOLDER_CLOSED);
+ public static final ImageDescriptor DESC_CONTAINER = createManaged("", IMG_CONTAINER);
+ public static final ImageDescriptor DESC_FOLDER_CLOSED = createManaged("", IMG_FOLDER_CLOSED);
public static final ImageDescriptor DESC_FILE = createManaged("", IMG_FILE);
- public static final ImageDescriptor DESC_WARNING = createManaged("",
- IMG_WARNING);
- public static final ImageDescriptor DESC_ERROR = createManaged("",
- IMG_ERROR);
+ public static final ImageDescriptor DESC_WARNING = createManaged("", IMG_WARNING);
+ public static final ImageDescriptor DESC_ERROR = createManaged("", IMG_ERROR);
private static ImageDescriptor createManaged(String prefix, String name) {
return createManaged(imageRegistry, prefix, name);
}
- private static ImageDescriptor createManaged(ImageRegistry registry,
- String prefix, String name) {
- ImageDescriptor result = ImageDescriptor.createFromURL(makeIconFileURL(
- prefix, name.substring(NAME_PREFIX_LENGTH)));
+ private static ImageDescriptor createManaged(ImageRegistry registry, String prefix, String name) {
+ ImageDescriptor result = ImageDescriptor
+ .createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH)));
registry.put(name, result);
return result;
}
@@ -96,7 +84,7 @@ public class SWTImagesFactory {
/**
* Sets all available image descriptors for the given action.
- *
+ *
* @param action
* to set descriptor for
* @param type
@@ -104,8 +92,7 @@ public class SWTImagesFactory {
* @param relPath
* relative path
*/
- public static void setImageDescriptors(IAction action, String type,
- String relPath) {
+ public static void setImageDescriptors(IAction action, String type, String relPath) {
if (relPath.startsWith(NAME_PREFIX))
relPath = relPath.substring(NAME_PREFIX_LENGTH);
action.setDisabledImageDescriptor(create("d" + type, relPath)); //$NON-NLS-1$
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java
index ecc575c061..dceb3f3a1e 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChain.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - modified for use in Container build
*******************************************************************************/
@@ -64,11 +64,10 @@ import org.eclipse.linuxtools.docker.ui.Activator;
/**
* The Container GCC toolchain. It represents a GCC that will run in a Docker
* Container. It can be overridden to change environment variable settings.
- *
+ *
* @since 1.2
*/
-public class ContainerGCCToolChain extends PlatformObject
- implements IToolChain, IToolChain2 {
+public class ContainerGCCToolChain extends PlatformObject implements IToolChain, IToolChain2 {
public static final String TYPE_ID = "org.eclipse.cdt.docker.launcher.gcc"; //$NON-NLS-1$
@@ -82,9 +81,7 @@ public class ContainerGCCToolChain extends PlatformObject
private String cppCommand;
private String[] commands;
-
- public ContainerGCCToolChain(String id, IToolChainProvider provider,
- Map<String, String> properties,
+ public ContainerGCCToolChain(String id, IToolChainProvider provider, Map<String, String> properties,
IEnvironmentVariable[] envVars) {
this.provider = provider;
this.path = new File("/usr/bin/gcc").toPath(); //$NON-NLS-1$
@@ -171,7 +168,7 @@ public class ContainerGCCToolChain extends PlatformObject
public void setProperty(String key, String value) {
properties.put(key, value);
}
-
+
@Override
public String getBinaryParserId() {
return CCorePlugin.PLUGIN_ID + ".ELF"; //$NON-NLS-1$
@@ -185,9 +182,9 @@ public class ContainerGCCToolChain extends PlatformObject
}
@Override
- synchronized public IExtendedScannerInfo getScannerInfo(
- IBuildConfiguration buildConfig, List<String> commandStrings,
- IExtendedScannerInfo baseScannerInfo, IResource resource, URI buildDirectoryURI) {
+ synchronized public IExtendedScannerInfo getScannerInfo(IBuildConfiguration buildConfig,
+ List<String> commandStrings, IExtendedScannerInfo baseScannerInfo, IResource resource,
+ URI buildDirectoryURI) {
try {
Path buildDirectory = Paths.get(buildDirectoryURI);
@@ -225,8 +222,7 @@ public class ContainerGCCToolChain extends PlatformObject
}
addDiscoveryOptions(commandLine);
- commandLine.addAll(
- commandStrings.subList(offset + 1, commandStrings.size()));
+ commandLine.addAll(commandStrings.subList(offset + 1, commandStrings.size()));
// Strip surrounding quotes from the args on Windows
if (Platform.OS_WIN32.equals(Platform.getOS())) {
@@ -305,8 +301,7 @@ public class ContainerGCCToolChain extends PlatformObject
}
@Override
- synchronized public IExtendedScannerInfo getDefaultScannerInfo(
- IBuildConfiguration buildConfig,
+ synchronized public IExtendedScannerInfo getDefaultScannerInfo(IBuildConfiguration buildConfig,
IExtendedScannerInfo baseScannerInfo, ILanguage language, URI buildDirectoryURI) {
try {
String[] commands = getCompileCommands(language);
@@ -332,7 +327,7 @@ public class ContainerGCCToolChain extends PlatformObject
commandLine.add("-I" + includePath); //$NON-NLS-1$
}
}
-
+
if (baseScannerInfo.getDefinedSymbols() != null) {
for (Map.Entry<String, String> macro : baseScannerInfo.getDefinedSymbols().entrySet()) {
if (macro.getValue() != null && !macro.getValue().isEmpty()) {
@@ -377,26 +372,22 @@ public class ContainerGCCToolChain extends PlatformObject
// Startup the command
ContainerCommandLauncher commandLauncher = new ContainerCommandLauncher();
- ICBuildConfiguration cconfig = buildConfig
- .getAdapter(ICBuildConfiguration.class);
+ ICBuildConfiguration cconfig = buildConfig.getAdapter(ICBuildConfiguration.class);
commandLauncher.setBuildConfiguration(cconfig);
commandLauncher.setProject(buildConfig.getProject());
// CCorePlugin.getDefault().getBuildEnvironmentManager().setEnvironment(processBuilder.environment(),
// buildConfig, true);
- org.eclipse.core.runtime.IPath commandPath = new org.eclipse.core.runtime.Path(
- commandLine.get(0));
- String[] args = commandLine.subList(1, commandLine.size())
- .toArray(new String[0]);
- org.eclipse.core.runtime.IPath workingDirectory = new org.eclipse.core.runtime.Path(
- buildDirectory.toString());
+ org.eclipse.core.runtime.IPath commandPath = new org.eclipse.core.runtime.Path(commandLine.get(0));
+ String[] args = commandLine.subList(1, commandLine.size()).toArray(new String[0]);
+ org.eclipse.core.runtime.IPath workingDirectory = new org.eclipse.core.runtime.Path(buildDirectory.toString());
Process process;
try (ByteArrayOutputStream stdout = new ByteArrayOutputStream();
ByteArrayOutputStream stderr = new ByteArrayOutputStream()) {
- process = commandLauncher.execute(commandPath, args, new String[0],
- workingDirectory, new NullProgressMonitor());
- if (process != null && commandLauncher.waitAndRead(stdout, stderr,
- new NullProgressMonitor()) != ICommandLauncher.OK) {
+ process = commandLauncher.execute(commandPath, args, new String[0], workingDirectory,
+ new NullProgressMonitor());
+ if (process != null
+ && commandLauncher.waitAndRead(stdout, stderr, new NullProgressMonitor()) != ICommandLauncher.OK) {
String errMsg = commandLauncher.getErrorMessage();
DockerLaunchUIPlugin.logErrorMessage(errMsg);
return null;
@@ -410,14 +401,11 @@ public class ContainerGCCToolChain extends PlatformObject
// concatenate stdout after stderr as stderr has the include paths
// and stdout has the defines
- String[] outlines = stdout.toString(StandardCharsets.UTF_8.name())
- .split("\\r?\\n"); //$NON-NLS-1$
- String[] errlines = stderr.toString(StandardCharsets.UTF_8.name())
- .split("\\r?\\n"); //$NON-NLS-1$
+ String[] outlines = stdout.toString(StandardCharsets.UTF_8.name()).split("\\r?\\n"); //$NON-NLS-1$
+ String[] errlines = stderr.toString(StandardCharsets.UTF_8.name()).split("\\r?\\n"); //$NON-NLS-1$
String[] lines = new String[errlines.length + outlines.length];
System.arraycopy(errlines, 0, lines, 0, errlines.length);
- System.arraycopy(outlines, 0, lines, errlines.length,
- outlines.length);
+ System.arraycopy(outlines, 0, lines, errlines.length, outlines.length);
for (String line : lines) {
line = line.trim();
@@ -426,11 +414,9 @@ public class ContainerGCCToolChain extends PlatformObject
inIncludePaths = false;
} else {
String include = line.trim();
- org.eclipse.core.runtime.IPath path = new org.eclipse.core.runtime.Path(
- include);
+ org.eclipse.core.runtime.IPath path = new org.eclipse.core.runtime.Path(include);
if (!path.isAbsolute()) {
- org.eclipse.core.runtime.IPath newPath = workingDirectory
- .append(path);
+ org.eclipse.core.runtime.IPath newPath = workingDirectory.append(path);
include = newPath.makeAbsolute().toPortableString();
}
includePath.add(include);
@@ -447,8 +433,7 @@ public class ContainerGCCToolChain extends PlatformObject
// Process include paths for scanner info and point to any copied
// header directories
- includePath = CommandLauncherManager.getInstance()
- .processIncludePaths(cconfig, includePath);
+ includePath = CommandLauncherManager.getInstance().processIncludePaths(cconfig, includePath);
ExtendedScannerInfo info = new ExtendedScannerInfo(symbols,
includePath.toArray(new String[includePath.size()]));
@@ -621,10 +606,9 @@ public class ContainerGCCToolChain extends PlatformObject
}
@Override
- public Process startBuildProcess(ICBuildConfiguration config,
- List<String> command, String buildDirectory,
- IEnvironmentVariable[] envVars, IConsole console,
- IProgressMonitor monitor) throws CoreException, IOException {
+ public Process startBuildProcess(ICBuildConfiguration config, List<String> command, String buildDirectory,
+ IEnvironmentVariable[] envVars, IConsole console, IProgressMonitor monitor)
+ throws CoreException, IOException {
IPath cmdPath = new org.eclipse.core.runtime.Path("/usr/bin/env"); //$NON-NLS-1$
@@ -644,29 +628,24 @@ public class ContainerGCCToolChain extends PlatformObject
buf.deleteCharAt(buf.length() - 1); // remove last blank;
argList.add(buf.toString());
- ICommandLauncher launcher = CommandLauncherManager.getInstance()
- .getCommandLauncher(config);
+ ICommandLauncher launcher = CommandLauncherManager.getInstance().getCommandLauncher(config);
// Bug 536884 - following is a kludge to allow us to check if the
// Container headers have been deleted by the user in which case
// we need to re-perform scanner info collection and copy headers
// to the host.
// TODO: make this cleaner
- CommandLauncherManager.getInstance().processIncludePaths(config,
- Collections.emptyList());
+ CommandLauncherManager.getInstance().processIncludePaths(config, Collections.emptyList());
launcher.setProject(config.getBuildConfiguration().getProject());
if (launcher instanceof ICBuildCommandLauncher) {
((ICBuildCommandLauncher) launcher).setBuildConfiguration(config);
- console.getOutputStream().write(
- ((ICBuildCommandLauncher) launcher).getConsoleHeader());
+ console.getOutputStream().write(((ICBuildCommandLauncher) launcher).getConsoleHeader());
}
- org.eclipse.core.runtime.Path workingDir = new org.eclipse.core.runtime.Path(
- buildDirectory);
+ org.eclipse.core.runtime.Path workingDir = new org.eclipse.core.runtime.Path(buildDirectory);
- Process p = launcher.execute(cmdPath, argList.toArray(new String[0]),
- new String[0], workingDir, monitor);
+ Process p = launcher.execute(cmdPath, argList.toArray(new String[0]), new String[0], workingDir, monitor);
return p;
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChainProvider.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChainProvider.java
index f9bb6cbe1d..754eec9608 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChainProvider.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/ContainerGCCToolChainProvider.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial contribution
*******************************************************************************/
@@ -40,14 +40,13 @@ import org.eclipse.linuxtools.docker.core.IDockerConnectionManagerListener;
import org.eclipse.linuxtools.docker.core.IDockerImage;
/**
- *
+ *
* @author jjohnstn
*
* @since 1.2
- *
+ *
*/
-public class ContainerGCCToolChainProvider
- implements IToolChainProvider, IDockerConnectionManagerListener {
+public class ContainerGCCToolChainProvider implements IToolChainProvider, IDockerConnectionManagerListener {
public static final String PROVIDER_ID = "org.eclipse.cdt.docker.launcher.gcc.provider"; //$NON-NLS-1$
public static final String CONTAINER_LINUX_CONFIG_ID = "linux-container-id"; //$NON-NLS-1$
@@ -60,11 +59,9 @@ public class ContainerGCCToolChainProvider
}
@Override
- public synchronized void init(IToolChainManager manager)
- throws CoreException {
+ public synchronized void init(IToolChainManager manager) throws CoreException {
this.toolChainManager = manager;
- IDockerConnection[] connections = DockerConnectionManager.getInstance()
- .getConnections();
+ IDockerConnection[] connections = DockerConnectionManager.getInstance().getConnections();
Map<String, IDockerConnection> connectionMap = new HashMap<>();
for (IDockerConnection connection : connections) {
connectionMap.put(connection.getUri(), connection);
@@ -74,17 +71,12 @@ public class ContainerGCCToolChainProvider
Map<String, String> properties = new HashMap<>();
- properties.put(ILaunchTarget.ATTR_OS,
- ContainerTargetTypeProvider.CONTAINER_LINUX);
- properties.put(ILaunchTarget.ATTR_ARCH,
- Platform.getOSArch());
- properties.put(IContainerLaunchTarget.ATTR_CONNECTION_URI,
- connection.getUri());
- properties.put(IContainerLaunchTarget.ATTR_IMAGE_ID,
- image.repoTags().get(0));
+ properties.put(ILaunchTarget.ATTR_OS, ContainerTargetTypeProvider.CONTAINER_LINUX);
+ properties.put(ILaunchTarget.ATTR_ARCH, Platform.getOSArch());
+ properties.put(IContainerLaunchTarget.ATTR_CONNECTION_URI, connection.getUri());
+ properties.put(IContainerLaunchTarget.ATTR_IMAGE_ID, image.repoTags().get(0));
// following can be used for naming build configurations
- properties.put(CONTAINER_LINUX_CONFIG_ID,
- image.repoTags().get(0).replace(':', '_'));
+ properties.put(CONTAINER_LINUX_CONFIG_ID, image.repoTags().get(0).replace(':', '_'));
// .replace('/', '_'));
ContainerGCCToolChain toolChain = new ContainerGCCToolChain(
@@ -98,8 +90,7 @@ public class ContainerGCCToolChainProvider
// add a Docker Connection listener to handle enablement/disablement of
// Connections
- DockerConnectionManager.getInstance()
- .addConnectionManagerListener(this);
+ DockerConnectionManager.getInstance().addConnectionManagerListener(this);
// re-check configs in case an enabled Connection has made old configs
// valid again do this in a separate job to prevent a possible
@@ -111,8 +102,7 @@ public class ContainerGCCToolChainProvider
// call the recheckConfigs method in case any disabled targets
// are now
// ok
- ICBuildConfigurationManager mgr = CCorePlugin
- .getService(ICBuildConfigurationManager.class);
+ ICBuildConfigurationManager mgr = CCorePlugin.getService(ICBuildConfigurationManager.class);
ICBuildConfigurationManager2 cbuildmanager = (ICBuildConfigurationManager2) mgr;
cbuildmanager.recheckConfigs();
return Status.OK_STATUS;
@@ -123,8 +113,7 @@ public class ContainerGCCToolChainProvider
}
@Override
- public synchronized void changeEvent(IDockerConnection connection,
- int type) {
+ public synchronized void changeEvent(IDockerConnection connection, int type) {
final ContainerGCCToolChainProvider provider = this;
@@ -132,43 +121,34 @@ public class ContainerGCCToolChainProvider
@Override
protected IStatus run(IProgressMonitor monitor) {
- ICBuildConfigurationManager mgr = CCorePlugin
- .getService(ICBuildConfigurationManager.class);
+ ICBuildConfigurationManager mgr = CCorePlugin.getService(ICBuildConfigurationManager.class);
ICBuildConfigurationManager2 manager = (ICBuildConfigurationManager2) mgr;
if (type == IDockerConnectionManagerListener.ADD_EVENT
|| type == IDockerConnectionManagerListener.ENABLE_EVENT) {
List<IDockerImage> images = connection.getImages();
for (IDockerImage image : images) {
- if (!image.isDangling()
- && !image.isIntermediateImage()) {
+ if (!image.isDangling() && !image.isIntermediateImage()) {
Map<String, String> properties = new HashMap<>();
- properties.put(ILaunchTarget.ATTR_OS,
- ContainerTargetTypeProvider.CONTAINER_LINUX);
- properties.put(ILaunchTarget.ATTR_ARCH,
- Platform.getOSArch());
- properties.put(
- IContainerLaunchTarget.ATTR_CONNECTION_URI,
- connection.getUri());
- properties.put(IContainerLaunchTarget.ATTR_IMAGE_ID,
- image.repoTags().get(0));
+ properties.put(ILaunchTarget.ATTR_OS, ContainerTargetTypeProvider.CONTAINER_LINUX);
+ properties.put(ILaunchTarget.ATTR_ARCH, Platform.getOSArch());
+ properties.put(IContainerLaunchTarget.ATTR_CONNECTION_URI, connection.getUri());
+ properties.put(IContainerLaunchTarget.ATTR_IMAGE_ID, image.repoTags().get(0));
// following can be used for naming build
// configurations
- properties.put(CONTAINER_LINUX_CONFIG_ID,
- image.repoTags().get(0).replace(':', '_'));
+ properties.put(CONTAINER_LINUX_CONFIG_ID, image.repoTags().get(0).replace(':', '_'));
// .replace('/', '_'));
-
Collection<IToolChain> toolChains;
try {
- toolChains = toolChainManager
- .getToolChainsMatching(properties);
+ toolChains = toolChainManager.getToolChainsMatching(properties);
if (toolChains.isEmpty()) {
ContainerGCCToolChain toolChain = new ContainerGCCToolChain(
"gcc-img-" + image.id().substring(0, //$NON-NLS-1$
- 19), provider, properties, null);
+ 19),
+ provider, properties, null);
toolChainManager.addToolChain(toolChain);
}
} catch (CoreException e) {
@@ -183,11 +163,9 @@ public class ContainerGCCToolChainProvider
|| type == IDockerConnectionManagerListener.DISABLE_EVENT) {
try {
String connectionURI = connection.getUri();
- Collection<IToolChain> toolChains = toolChainManager
- .getAllToolChains();
+ Collection<IToolChain> toolChains = toolChainManager.getAllToolChains();
for (IToolChain toolChain : toolChains) {
- String uri = toolChain.getProperty(
- IContainerLaunchTarget.ATTR_CONNECTION_URI);
+ String uri = toolChain.getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI);
if (connectionURI.equals(uri)) {
toolChainManager.removeToolChain(toolChain);
}
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/CoreBuildContainerLaunchConfigProvider.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/CoreBuildContainerLaunchConfigProvider.java
index 99971bb0d2..eb76f9d4d2 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/CoreBuildContainerLaunchConfigProvider.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/CoreBuildContainerLaunchConfigProvider.java
@@ -46,8 +46,7 @@ public class CoreBuildContainerLaunchConfigProvider extends AbstractLaunchConfig
@Override
public boolean supports(ILaunchDescriptor descriptor, ILaunchTarget target) throws CoreException {
- return target != null && ContainerTargetTypeProvider.TYPE_ID
- .equals(target.getTypeId());
+ return target != null && ContainerTargetTypeProvider.TYPE_ID.equals(target.getTypeId());
}
@Override
@@ -66,10 +65,8 @@ public class CoreBuildContainerLaunchConfigProvider extends AbstractLaunchConfig
if (configMap == null) {
configMap = new HashMap<>();
}
- String connection = target.getAttribute(
- IContainerLaunchTarget.ATTR_CONNECTION_URI, ""); //$NON-NLS-1$
- String imageId = target
- .getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, ""); //$NON-NLS-1$
+ String connection = target.getAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI, ""); //$NON-NLS-1$
+ String imageId = target.getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, ""); //$NON-NLS-1$
String imageName = connection + "-" + imageId; //$NON-NLS-1$
config = configMap.get(imageName);
if (config == null) {
@@ -81,15 +78,11 @@ public class CoreBuildContainerLaunchConfigProvider extends AbstractLaunchConfig
return config;
}
- private String getImageName(ILaunchConfiguration config)
- throws CoreException {
+ private String getImageName(ILaunchConfiguration config) throws CoreException {
IProject project = config.getMappedResources()[0].getProject();
- ICBuildConfiguration cconfig = project.getActiveBuildConfig()
- .getAdapter(ICBuildConfiguration.class);
- String image = cconfig.getToolChain()
- .getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
- String connection = cconfig.getToolChain()
- .getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI); // $NON-NLS-1$
+ ICBuildConfiguration cconfig = project.getActiveBuildConfig().getAdapter(ICBuildConfiguration.class);
+ String image = cconfig.getToolChain().getProperty(IContainerLaunchTarget.ATTR_IMAGE_ID);
+ String connection = cconfig.getToolChain().getProperty(IContainerLaunchTarget.ATTR_CONNECTION_URI); // $NON-NLS-1$
String imageName = "unknown"; //$NON-NLS-1$
if (connection != null && image != null) {
imageName = connection + "-" + image; //$NON-NLS-1$
@@ -105,40 +98,29 @@ public class CoreBuildContainerLaunchConfigProvider extends AbstractLaunchConfig
// Set the project and the connection
IProject project = descriptor.getAdapter(IProject.class);
- wc.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME,
- project.getName());
+ wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
wc.setAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI,
- target.getAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI,
- null));
- wc.setAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, target
- .getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, null));
+ target.getAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI, null));
+ wc.setAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID,
+ target.getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, null));
// DSF settings...use GdbUIPlugin preference store for defaults
- IPreferenceStore preferenceStore = GdbUIPlugin.getDefault()
- .getPreferenceStore();
+ IPreferenceStore preferenceStore = GdbUIPlugin.getDefault().getPreferenceStore();
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUG_NAME,
- preferenceStore.getString(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND));
+ preferenceStore.getString(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_COMMAND));
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_GDB_INIT,
- preferenceStore.getString(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_INIT));
+ preferenceStore.getString(IGdbDebugPreferenceConstants.PREF_DEFAULT_GDB_INIT));
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_NON_STOP,
- preferenceStore.getBoolean(
- IGdbDebugPreferenceConstants.PREF_DEFAULT_NON_STOP));
+ preferenceStore.getBoolean(IGdbDebugPreferenceConstants.PREF_DEFAULT_NON_STOP));
wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_REVERSE,
IGDBLaunchConfigurationConstants.DEBUGGER_REVERSE_DEFAULT);
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND,
IGDBLaunchConfigurationConstants.DEBUGGER_UPDATE_THREADLIST_ON_SUSPEND_DEFAULT);
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_DEBUG_ON_FORK,
IGDBLaunchConfigurationConstants.DEBUGGER_DEBUG_ON_FORK_DEFAULT);
- wc.setAttribute(
- IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
+ wc.setAttribute(IGDBLaunchConfigurationConstants.ATTR_DEBUGGER_TRACEPOINT_MODE,
IGDBLaunchConfigurationConstants.DEBUGGER_TRACEPOINT_MODE_DEFAULT);
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
- (String) null); // default is the project directory
+ wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null); // default is the project directory
wc.setMappedResources(new IResource[] { project });
}
@@ -163,10 +145,8 @@ public class CoreBuildContainerLaunchConfigProvider extends AbstractLaunchConfig
@Override
public boolean launchConfigurationRemoved(ILaunchConfiguration configuration) throws CoreException {
- for (Entry<IProject, Map<String, ILaunchConfiguration>> entry : configs
- .entrySet()) {
- for (Entry<String, ILaunchConfiguration> innerEntry : entry
- .getValue().entrySet()) {
+ for (Entry<IProject, Map<String, ILaunchConfiguration>> entry : configs.entrySet()) {
+ for (Entry<String, ILaunchConfiguration> innerEntry : entry.getValue().entrySet()) {
if (configuration.equals(innerEntry.getValue())) {
entry.getValue().remove(innerEntry.getKey());
return true;
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/CoreBuildContainerLaunchDescriptorType.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/CoreBuildContainerLaunchDescriptorType.java
index 24ba66b1ca..843938a328 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/CoreBuildContainerLaunchDescriptorType.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/CoreBuildContainerLaunchDescriptorType.java
@@ -21,7 +21,7 @@ import org.eclipse.launchbar.core.internal.Activator;
/**
* The launch descriptor type for launch objects built with the Core Build
* System.
- *
+ *
* @since 1.2
*/
public class CoreBuildContainerLaunchDescriptorType implements ILaunchDescriptorType {
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/Messages.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/Messages.java
index 9e47f729ef..7ea7bc1ebb 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/Messages.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/Messages.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Red Hat Inc. - initial version
*******************************************************************************/
package org.eclipse.cdt.internal.docker.launcher.ui.launchbar;
@@ -26,7 +26,7 @@ public class Messages extends NLS {
public static String ContainerGCCToolChainProvider_Saving;
public static String ContainerGCCToolChainProvider_NotOurs;
public static String ContainerGCCToolChainProvider_Loading;
-
+
public static String NewContainerTargetWizard_title;
public static String NewContainerTargetWizardPage_name;
public static String NewContainerTargetWizardPage_title;
@@ -40,7 +40,6 @@ public class Messages extends NLS {
public static String EditContainerTargetWizardPage_title;
public static String EditContainerTargetWizardPage_description;
-
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
@@ -49,4 +48,3 @@ public class Messages extends NLS {
private Messages() {
}
}
-
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizard.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizard.java
index 6af7eac219..61ac6eb045 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizard.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizard.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Red Hat Inc. - initial contribution
*******************************************************************************/
@@ -41,8 +41,7 @@ import org.eclipse.launchbar.ui.target.LaunchTargetWizard;
public class NewContainerTargetWizard extends LaunchTargetWizard {
private NewContainerTargetWizardPage page;
- protected IToolChainManager toolChainManager = CDebugCorePlugin
- .getService(IToolChainManager.class);
+ protected IToolChainManager toolChainManager = CDebugCorePlugin.getService(IToolChainManager.class);
public NewContainerTargetWizard() {
if (getLaunchTarget() == null) {
@@ -62,8 +61,7 @@ public class NewContainerTargetWizard extends LaunchTargetWizard {
@Override
public boolean performFinish() {
- ILaunchTargetManager manager = CDebugUIPlugin
- .getService(ILaunchTargetManager.class);
+ ILaunchTargetManager manager = CDebugUIPlugin.getService(ILaunchTargetManager.class);
String typeId = ContainerTargetTypeProvider.TYPE_ID;
String id = page.getTargetName();
@@ -75,12 +73,9 @@ public class NewContainerTargetWizard extends LaunchTargetWizard {
ILaunchTargetWorkingCopy wc = target.getWorkingCopy();
wc.setId(id);
wc.setAttribute(ILaunchTarget.ATTR_OS, Platform.getOS());
- wc.setAttribute(ILaunchTarget.ATTR_ARCH,
- ContainerTargetTypeProvider.CONTAINER_LINUX);
- wc.setAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI,
- page.getConnectionURI());
- wc.setAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID,
- page.getImageId());
+ wc.setAttribute(ILaunchTarget.ATTR_ARCH, ContainerTargetTypeProvider.CONTAINER_LINUX);
+ wc.setAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI, page.getConnectionURI());
+ wc.setAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, page.getImageId());
wc.save();
// Pick the first one that matches
@@ -109,8 +104,7 @@ public class NewContainerTargetWizard extends LaunchTargetWizard {
@Override
public void performDelete() {
- ILaunchTargetManager manager = Activator
- .getService(ILaunchTargetManager.class);
+ ILaunchTargetManager manager = Activator.getService(ILaunchTargetManager.class);
ILaunchTarget target = getLaunchTarget();
if (target != null) {
manager.removeLaunchTarget(getLaunchTarget());
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java
index 90722f21b1..8c10068430 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/launchbar/NewContainerTargetWizardPage.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contibutors:
* Red Hat Inc. - initial implementation
*******************************************************************************/
@@ -60,7 +60,6 @@ public class NewContainerTargetWizardPage extends WizardPage
private String connectionName;
private String connectionUri = "";
-
public NewContainerTargetWizardPage(ILaunchTarget launchTarget) {
super(NewContainerTargetWizardPage.class.getName());
if (launchTarget == null) {
@@ -73,10 +72,8 @@ public class NewContainerTargetWizardPage extends WizardPage
this.launchTarget = launchTarget;
this.wizardPage = this;
if (launchTarget != null) {
- connectionUri = launchTarget.getAttribute(
- IContainerLaunchTarget.ATTR_CONNECTION_URI, null);
- imageName = launchTarget
- .getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, null);
+ connectionUri = launchTarget.getAttribute(IContainerLaunchTarget.ATTR_CONNECTION_URI, null);
+ imageName = launchTarget.getAttribute(IContainerLaunchTarget.ATTR_IMAGE_ID, null);
}
}
@@ -183,8 +180,7 @@ public class NewContainerTargetWizardPage extends WizardPage
int defaultIndex = -1;
connections = DockerConnectionManager.getInstance().getConnections();
if (connections.length == 0) {
- setErrorMessage(
- Messages.NewContainerTargetWizardPage_no_connections);
+ setErrorMessage(Messages.NewContainerTargetWizardPage_no_connections);
return;
}
String[] connectionNames = new String[connections.length];
@@ -209,8 +205,7 @@ public class NewContainerTargetWizardPage extends WizardPage
if (connection != null) {
java.util.List<IDockerImage> images = connection.getImages();
if (images == null || images.size() == 0) {
- setErrorMessage(
- Messages.NewContainerTargetWizardPage_no_images);
+ setErrorMessage(Messages.NewContainerTargetWizardPage_no_images);
return;
}
connection.removeImageListener(wizardPage);
@@ -259,12 +254,10 @@ public class NewContainerTargetWizardPage extends WizardPage
connectionUri = connection.getUri();
java.util.List<IDockerImage> images = connection.getImages();
if (images == null || images.size() == 0) {
- setErrorMessage(
- Messages.NewContainerTargetWizardPage_no_images);
+ setErrorMessage(Messages.NewContainerTargetWizardPage_no_images);
}
} else {
- setErrorMessage(
- Messages.NewContainerTargetWizardPage_no_connections);
+ setErrorMessage(Messages.NewContainerTargetWizardPage_no_connections);
connection = null;
connectionUri = "";
connectionSelector.setText("");
@@ -272,8 +265,7 @@ public class NewContainerTargetWizardPage extends WizardPage
connectionSelector.addModifyListener(connectionModifyListener);
}
- public void listChanged(IDockerConnection c,
- java.util.List<IDockerImage> list) {
+ public void listChanged(IDockerConnection c, java.util.List<IDockerImage> list) {
setErrorMessage(null);
final IDockerImage[] finalList = list.toArray(new IDockerImage[0]);
if (finalList.length == 0) {
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/DockerHeaderPreferencePage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/DockerHeaderPreferencePage.java
index 0e0269ab90..6886972d96 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/DockerHeaderPreferencePage.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/DockerHeaderPreferencePage.java
@@ -36,8 +36,7 @@ import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-public class DockerHeaderPreferencePage extends PreferencePage
- implements IWorkbenchPreferencePage, Listener {
+public class DockerHeaderPreferencePage extends PreferencePage implements IWorkbenchPreferencePage, Listener {
// SWT Widgets and content providers
private Table hdrTable;
@@ -46,8 +45,7 @@ public class DockerHeaderPreferencePage extends PreferencePage
private Button removeButton;
private List<IPath> directories;
- private final class HeaderContentProvider
- implements IStructuredContentProvider, ITableLabelProvider {
+ private final class HeaderContentProvider implements IStructuredContentProvider, ITableLabelProvider {
/**
* @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(Object)
@@ -69,8 +67,7 @@ public class DockerHeaderPreferencePage extends PreferencePage
* Object, Object)
*/
@Override
- public void inputChanged(Viewer viewer, Object oldInput,
- Object newInput) {
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
}
/**
@@ -90,8 +87,7 @@ public class DockerHeaderPreferencePage extends PreferencePage
String name = path.lastSegment();
if (namePath.toFile().exists()) {
try (FileReader reader = new FileReader(namePath.toFile());
- BufferedReader bufferReader = new BufferedReader(
- reader);) {
+ BufferedReader bufferReader = new BufferedReader(reader);) {
name = bufferReader.readLine();
} catch (IOException e) {
// ignore
@@ -149,9 +145,7 @@ public class DockerHeaderPreferencePage extends PreferencePage
@Override
public void init(IWorkbench workbench) {
directories = new ArrayList<>();
- IPath pluginPath = Platform
- .getStateLocation(
- Platform.getBundle(DockerLaunchUIPlugin.PLUGIN_ID))
+ IPath pluginPath = Platform.getStateLocation(Platform.getBundle(DockerLaunchUIPlugin.PLUGIN_ID))
.append("HEADERS"); //$NON-NLS-1$
File d = pluginPath.toFile();
@@ -162,9 +156,7 @@ public class DockerHeaderPreferencePage extends PreferencePage
File[] images = connection.listFiles();
for (File image : images) {
if (image.isDirectory()) {
- directories
- .add(pluginPath.append(connection.getName())
- .append(image.getName()));
+ directories.add(pluginPath.append(connection.getName()).append(image.getName()));
}
}
}
@@ -174,8 +166,7 @@ public class DockerHeaderPreferencePage extends PreferencePage
@Override
protected Control createContents(Composite parent) {
- Composite page = createComposite(parent, 1, 2, false, null, -1, -1,
- GridData.FILL);
+ Composite page = createComposite(parent, 1, 2, false, null, -1, -1, GridData.FILL);
GridData gd = (GridData) page.getLayoutData();
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
@@ -184,8 +175,7 @@ public class DockerHeaderPreferencePage extends PreferencePage
// SystemResources.RESID_PREF_SIGNON_DESCRIPTION, 2);
// Header table
- hdrTable = new Table(page, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL
- | SWT.H_SCROLL | SWT.BORDER);
+ hdrTable = new Table(page, SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
hdrTable.setLinesVisible(true);
hdrTable.setHeaderVisible(true);
hdrTable.addListener(SWT.Selection, this);
@@ -203,8 +193,7 @@ public class DockerHeaderPreferencePage extends PreferencePage
// Connection column
TableColumn connectionColumn = new TableColumn(hdrTable, SWT.NONE);
- connectionColumn
- .setText(Messages.HeaderPreferencePage_Connection_Label);
+ connectionColumn.setText(Messages.HeaderPreferencePage_Connection_Label);
// Image column
TableColumn imageColumn = new TableColumn(hdrTable, SWT.NONE);
@@ -216,23 +205,20 @@ public class DockerHeaderPreferencePage extends PreferencePage
hdrTableViewer.setInput(directories);
// Create the Button bar for add, change and remove
- Composite buttonBar = createComposite(page, 1, 1, false, null, -1, -1,
- GridData.FILL);
+ Composite buttonBar = createComposite(page, 1, 1, false, null, -1, -1, GridData.FILL);
gd = (GridData) buttonBar.getLayoutData();
gd.grabExcessHorizontalSpace = false;
gd.grabExcessVerticalSpace = true;
- removeButton = createPushButton(buttonBar, this,
- Messages.HeaderPreferencePage_Remove_Label,
+ removeButton = createPushButton(buttonBar, this, Messages.HeaderPreferencePage_Remove_Label,
Messages.HeaderPreferencePage_Remove_Tooltip);
removeButton.setEnabled(false);
return parent;
}
- private static Composite createComposite(Composite parent, int parentSpan,
- int numColumns, boolean border, String label, int marginSize,
- int spacingSize, int verticalAlignment) {
+ private static Composite createComposite(Composite parent, int parentSpan, int numColumns, boolean border,
+ String label, int marginSize, int spacingSize, int verticalAlignment) {
// border = true;
boolean borderNeeded = border;
if (label != null)
@@ -273,8 +259,7 @@ public class DockerHeaderPreferencePage extends PreferencePage
return composite;
}
- public static Button createPushButton(Composite group, Listener listener,
- String label, String tooltip) {
+ public static Button createPushButton(Composite group, Listener listener, String label, String tooltip) {
Button button = new Button(group, SWT.PUSH);
button.setText(label);
if (listener != null)
@@ -353,4 +338,3 @@ public class DockerHeaderPreferencePage extends PreferencePage
dir.delete();
}
}
-
diff --git a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/DockerLaunchPreferencePage.java b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/DockerLaunchPreferencePage.java
index 3851ec24d0..9375b9fc8a 100644
--- a/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/DockerLaunchPreferencePage.java
+++ b/launch/org.eclipse.cdt.docker.launcher/src/org/eclipse/cdt/internal/docker/launcher/ui/preferences/DockerLaunchPreferencePage.java
@@ -22,8 +22,7 @@ import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-public class DockerLaunchPreferencePage extends FieldEditorPreferencePage
- implements IWorkbenchPreferencePage {
+public class DockerLaunchPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
private StringFieldEditor defaultImage;
private BooleanFieldEditor keepContainerAfterLaunch;
@@ -39,12 +38,11 @@ public class DockerLaunchPreferencePage extends FieldEditorPreferencePage
* editor knows how to save and restore itself.
*/
public void createFieldEditors() {
- defaultImage = new StringFieldEditor(PreferenceConstants.DEFAULT_IMAGE,
- Messages.Default_Image, getFieldEditorParent());
+ defaultImage = new StringFieldEditor(PreferenceConstants.DEFAULT_IMAGE, Messages.Default_Image,
+ getFieldEditorParent());
addField(defaultImage);
- keepContainerAfterLaunch = new BooleanFieldEditor(
- PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH,
+ keepContainerAfterLaunch = new BooleanFieldEditor(PreferenceConstants.KEEP_CONTAINER_AFTER_LAUNCH,
Messages.Keep_Container_After_Launch, getFieldEditorParent());
addField(keepContainerAfterLaunch);
@@ -52,7 +50,7 @@ public class DockerLaunchPreferencePage extends FieldEditorPreferencePage
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
*/
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
index da3cc26982..4a1fecef8f 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate.java
@@ -90,62 +90,64 @@ import com.ibm.icu.text.MessageFormat;
*/
abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegate {
- /**
+ /**
* @since 6.0
*/
- public class CLaunch extends Launch {
-
- private final AtomicBoolean fRefreshDone;
-
- public CLaunch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
- super(launchConfiguration, mode, locator);
- fRefreshDone = new AtomicBoolean(false);
- }
-
- public void refresh() {
- if (fRefreshDone.compareAndSet(false, true)) {
- final ILaunchConfiguration config = getLaunchConfiguration();
- try {
- if (RefreshTab.getRefreshScope(config) != null) {
- Job refreshJob = new Job(LaunchMessages.AbstractCLaunchDelegate_Refresh) {
-
- /* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- RefreshTab.refreshResources(config, monitor);
- } catch (CoreException e) {
- return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1, e.getLocalizedMessage(), e);
- }
- return Status.OK_STATUS;
- }};
- refreshJob.setSystem(true);
- refreshJob.schedule();
- }
- } catch(CoreException e) {
- LaunchUIPlugin.log(e.getStatus());
- }
- }
- }
- }
+ public class CLaunch extends Launch {
+
+ private final AtomicBoolean fRefreshDone;
+
+ public CLaunch(ILaunchConfiguration launchConfiguration, String mode, ISourceLocator locator) {
+ super(launchConfiguration, mode, locator);
+ fRefreshDone = new AtomicBoolean(false);
+ }
+
+ public void refresh() {
+ if (fRefreshDone.compareAndSet(false, true)) {
+ final ILaunchConfiguration config = getLaunchConfiguration();
+ try {
+ if (RefreshTab.getRefreshScope(config) != null) {
+ Job refreshJob = new Job(LaunchMessages.AbstractCLaunchDelegate_Refresh) {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ RefreshTab.refreshResources(config, monitor);
+ } catch (CoreException e) {
+ return new Status(IStatus.ERROR, LaunchUIPlugin.PLUGIN_ID, 1,
+ e.getLocalizedMessage(), e);
+ }
+ return Status.OK_STATUS;
+ }
+ };
+ refreshJob.setSystem(true);
+ refreshJob.schedule();
+ }
+ } catch (CoreException e) {
+ LaunchUIPlugin.log(e.getStatus());
+ }
+ }
+ }
+ }
private static final String EMPTY_STR = ""; //$NON-NLS-1$
-
- public AbstractCLaunchDelegate() {
+
+ public AbstractCLaunchDelegate() {
super();
}
/* (non-Javadoc)
- * @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#getLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String)
- */
- @Override
- public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {
- return new CLaunch(configuration, mode, null);
- }
-
- /**
+ * @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#getLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String)
+ */
+ @Override
+ public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {
+ return new CLaunch(configuration, mode, null);
+ }
+
+ /**
* The project containing the programs file being launched
*/
private IProject project;
@@ -161,15 +163,15 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
private boolean workspaceBuildBeforeLaunch;
/** Flag set to true if build before launch failed, or was cancelled. */
private boolean buildFailed;
-
+
@Override
- abstract public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
- throws CoreException;
+ abstract public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch,
+ IProgressMonitor monitor) throws CoreException;
/**
* Returns the working directory specified by the given launch
* configuration, or <code>null</code> if none.
- *
+ *
* @deprecated Should use getWorkingDirectory()
* @param configuration
* launch configuration
@@ -186,7 +188,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
/**
* Returns the working directory specified by the given launch
* configuration, or <code>null</code> if none.
- *
+ *
* @param configuration
* launch configuration
* @return the working directory specified by the given launch
@@ -203,7 +205,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
* configuration. Returns <code>null</code> if a working directory is not
* specified. If specified, the working is verified to point to an existing
* directory in the local file system.
- *
+ *
* @param configuration launch configuration
* @return an absolute path to a directory in the local file system, or
* <code>null</code> if unspecified
@@ -213,7 +215,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
* file system
*/
protected IPath getWorkingDirectoryPath(ILaunchConfiguration config) throws CoreException {
- String location = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
+ String location = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
if (location != null) {
String expandedLocation = LaunchUtils.getStringVariableManager().performStringSubstitution(location);
if (expandedLocation.length() > 0) {
@@ -226,7 +228,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
/**
* Throws a core exception with an error status object built from the given
* message, lower level exception, and error code.
- *
+ *
* @param message
* the status message
* @param exception
@@ -240,9 +242,9 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
if (exception != null) {
MultiStatus multiStatus = new MultiStatus(getPluginID(), code, message, exception);
multiStatus.add(new Status(IStatus.ERROR, getPluginID(), code, exception.getLocalizedMessage(), exception));
- status= multiStatus;
+ status = multiStatus;
} else {
- status= new Status(IStatus.ERROR, getPluginID(), code, message, null);
+ status = new Status(IStatus.ERROR, getPluginID(), code, message, null);
}
throw new CoreException(status);
}
@@ -257,38 +259,38 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
*/
abstract protected String getPluginID();
- /**
- * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
- */
+ /**
+ * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
+ */
@Deprecated
public static ICProject getCProject(ILaunchConfiguration configuration) throws CoreException {
- return CDebugUtils.getCProject(configuration);
+ return CDebugUtils.getCProject(configuration);
}
- /**
- * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
- */
+ /**
+ * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
+ */
@Deprecated
public static String getProjectName(ILaunchConfiguration configuration) throws CoreException {
- return CDebugUtils.getProjectName(configuration);
+ return CDebugUtils.getProjectName(configuration);
}
- /**
- * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
- */
+ /**
+ * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
+ */
@Deprecated
public static String getProgramName(ILaunchConfiguration configuration) throws CoreException {
- return CDebugUtils.getProgramName(configuration);
+ return CDebugUtils.getProgramName(configuration);
}
- /**
- * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
- */
+ /**
+ * @deprecated Use {@link org.eclipse.cdt.debug.core.CDebugUtils} instead.
+ */
@Deprecated
public static IPath getProgramPath(ILaunchConfiguration configuration) throws CoreException {
- return CDebugUtils.getProgramPath(configuration);
+ return CDebugUtils.getProgramPath(configuration);
}
-
+
/**
* @param launch
* @param config
@@ -304,7 +306,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
* Assigns a default source locator to the given launch if a source locator
* has not yet been assigned to it, and the associated launch configuration
* does not specify a source locator.
- *
+ *
* @param launch
* launch object
* @param configuration
@@ -316,18 +318,19 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
// set default source locator if none specified
if (launch.getSourceLocator() == null) {
IPersistableSourceLocator sourceLocator;
- String id = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String)null);
+ String id = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_ID, (String) null);
if (id == null) {
ICProject cProject = CDebugUtils.getCProject(configuration);
if (cProject == null) {
- abort(LaunchMessages.Launch_common_Project_does_not_exist, null,
+ abort(LaunchMessages.Launch_common_Project_does_not_exist, null,
ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
}
sourceLocator = CDebugUIPlugin.createDefaultSourceLocator();
sourceLocator.initializeDefaults(configuration);
} else {
sourceLocator = DebugPlugin.getDefault().getLaunchManager().newSourceLocator(id);
- String memento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO, (String)null);
+ String memento = configuration.getAttribute(ILaunchConfiguration.ATTR_SOURCE_LOCATOR_MEMENTO,
+ (String) null);
if (memento == null) {
sourceLocator.initializeDefaults(configuration);
} else {
@@ -340,7 +343,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
/**
* Returns the program arguments as a String.
- *
+ *
* @return the program arguments as a String
*/
public String getProgramArguments(ILaunchConfiguration config) throws CoreException {
@@ -349,7 +352,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
/**
* Returns the program arguments as an array of individual arguments.
- *
+ *
* @return the program arguments as an array of individual arguments
*/
public String[] getProgramArgumentsArray(ILaunchConfiguration config) throws CoreException {
@@ -359,7 +362,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
protected String renderProcessLabel(String commandLine) {
String format = "{0} ({1})"; //$NON-NLS-1$
String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis()));
- return MessageFormat.format(format, new Object[]{commandLine, timestamp});
+ return MessageFormat.format(format, new Object[] { commandLine, timestamp });
}
// temporary fix for #66015
@@ -370,11 +373,10 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
protected String renderDebuggerProcessLabel() {
String format = "{0} ({1})"; //$NON-NLS-1$
String timestamp = DateFormat.getInstance().format(new Date(System.currentTimeMillis()));
- return MessageFormat.format(format, new Object[]{
- LaunchMessages.AbstractCLaunchDelegate_Debugger_Process, timestamp});
+ return MessageFormat.format(format,
+ new Object[] { LaunchMessages.AbstractCLaunchDelegate_Debugger_Process, timestamp });
}
-
/**
* @param config
* @return
@@ -386,15 +388,14 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
ICProject cproject = CDebugUtils.verifyCProject(config);
String fileName = CDebugUtils.getProgramName(config);
if (fileName == null) {
- abort(LaunchMessages.AbstractCLaunchDelegate_Program_file_not_specified, null,
+ abort(LaunchMessages.AbstractCLaunchDelegate_Program_file_not_specified, null,
ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM);
}
- IFile programPath = ((IProject)cproject.getResource()).getFile(fileName);
+ IFile programPath = ((IProject) cproject.getResource()).getFile(fileName);
if (programPath == null || !programPath.exists() || !programPath.getLocation().toFile().exists()) {
abort(LaunchMessages.AbstractCLaunchDelegate_Program_file_does_not_exist,
- new FileNotFoundException(
- NLS.bind(LaunchMessages.AbstractCLaunchDelegate_PROGRAM_PATH_not_found,
+ new FileNotFoundException(NLS.bind(LaunchMessages.AbstractCLaunchDelegate_PROGRAM_PATH_not_found,
programPath.getLocation().toOSString())),
ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST);
}
@@ -425,7 +426,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
* Verifies the working directory specified by the given launch
* configuration exists, and returns the working directory, or
* <code>null</code> if none is specified.
- *
+ *
* @param configuration
* launch configuration
* @return the working directory specified by the given launch
@@ -460,8 +461,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
}
abort(LaunchMessages.AbstractCLaunchDelegate_Working_directory_does_not_exist,
new FileNotFoundException(
- NLS.bind(
- LaunchMessages.AbstractCLaunchDelegate_WORKINGDIRECTORY_PATH_not_found,
+ NLS.bind(LaunchMessages.AbstractCLaunchDelegate_WORKINGDIRECTORY_PATH_not_found,
path.toOSString())),
ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
}
@@ -471,7 +471,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
/**
* Recursively creates a set of projects referenced by the current project
- *
+ *
* @param proj
* The current project
* @param referencedProjSet
@@ -495,7 +495,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
/**
* creates a list of project ordered by their build order from an unordered
* list of projects.
- *
+ *
* @param resourceCollection
* The list of projects to sort.
* @return A new list of projects, ordered by build order.
@@ -512,7 +512,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
for (int i = 0; i < orderedNames.length; i++) {
String projectName = orderedNames[i];
for (int j = 0; j < resourceCollection.size(); j++) {
- IProject proj = (IProject)resourceCollection.get(j);
+ IProject proj = (IProject) resourceCollection.get(j);
if (proj.getName().equals(projectName)) {
orderedProjs.add(proj);
unorderedProjects.remove(proj);
@@ -527,7 +527,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
// Try the project prerequisite order then
IProject[] projects = new IProject[resourceCollection.size()];
- projects = (IProject[])resourceCollection.toArray(projects);
+ projects = (IProject[]) resourceCollection.toArray(projects);
IWorkspace.ProjectOrder po = ResourcesPlugin.getWorkspace().computeProjectOrder(projects);
ArrayList orderedProjs = new ArrayList();
orderedProjs.addAll(Arrays.asList(po.projects));
@@ -537,7 +537,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
/**
* Builds the current project and all of it's prerequisite projects if
* necessary. Respects specified build order if any exists.
- *
+ *
* @param configuration
* the configuration being launched
* @param mode
@@ -550,13 +550,15 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
* if an exception occurs while building
*/
@Override
- public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
+ public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException {
buildFailed = false;
workspaceBuildBeforeLaunch = true;
-
+
// check the build before launch setting and honor it
- int buildBeforeLaunchValue = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH,
+ int buildBeforeLaunchValue = configuration.getAttribute(
+ ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH,
ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING);
// we shouldn't be getting called if the workspace setting is disabled, so assume we need to
@@ -564,33 +566,35 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
if (buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED) {
return false;
}
-
+
//This matches the old code, but I don't know that it is the right behavior.
//We should be building the local project as well, not just the ordered projects
- if(orderedProjects == null) {
+ if (orderedProjects == null) {
return false;
}
-
- if(monitor == null) {
+
+ if (monitor == null) {
monitor = new NullProgressMonitor();
}
-
+
int scale = 1000;
int totalWork = (orderedProjects.size() + 1) * scale;
-
+
try {
- monitor.beginTask(LaunchMessages.AbstractCLaunchDelegate_building_projects, totalWork);
+ monitor.beginTask(LaunchMessages.AbstractCLaunchDelegate_building_projects, totalWork);
try {
for (Iterator i = orderedProjects.iterator(); i.hasNext();) {
- IProject proj = (IProject)i.next();
- monitor.subTask(LaunchMessages.AbstractCLaunchDelegate_building + proj.getName());
- proj.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new LaunchUtils.BuildProgressMonitor(monitor, scale));
+ IProject proj = (IProject) i.next();
+ monitor.subTask(LaunchMessages.AbstractCLaunchDelegate_building + proj.getName());
+ proj.build(IncrementalProjectBuilder.INCREMENTAL_BUILD,
+ new LaunchUtils.BuildProgressMonitor(monitor, scale));
}
- monitor.subTask(LaunchMessages.AbstractCLaunchDelegate_building + project.getName());
+ monitor.subTask(LaunchMessages.AbstractCLaunchDelegate_building + project.getName());
setBuildConfiguration(configuration, project);
- project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new LaunchUtils.BuildProgressMonitor(monitor, scale));
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD,
+ new LaunchUtils.BuildProgressMonitor(monitor, scale));
} catch (Exception e) {
// Catch CoreException or OperationCancelledException possibly thrown by the build contract.
// Still allow the user to continue to the launch
@@ -600,16 +604,16 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
monitor.done();
}
- return false;
+ return false;
}
/**
* Sets up a project for building by making sure the active configuration is set to the configuration chosen to
* be built before the launch.
- *
+ *
* If the configuration to be built before launch was set to be automatically discovered, it is set to the unique
* build configuration for the project that outputs to the directory containing the program to be launched.
- *
+ *
* @param configuration The launch configuration being launched.
* @param buildProject The project to be build before the launch configuration is launched.
*/
@@ -619,13 +623,17 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
String buildConfigID = null;
if (configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_AUTO, false)) {
- String programPath = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, EMPTY_STR);
- programPath = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(programPath);
- ICConfigurationDescription buildConfig = LaunchUtils.getBuildConfigByProgramPath(buildProject, programPath);
+ String programPath = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
+ EMPTY_STR);
+ programPath = VariablesPlugin.getDefault().getStringVariableManager()
+ .performStringSubstitution(programPath);
+ ICConfigurationDescription buildConfig = LaunchUtils.getBuildConfigByProgramPath(buildProject,
+ programPath);
if (buildConfig != null)
buildConfigID = buildConfig.getId();
} else {
- buildConfigID = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, EMPTY_STR);
+ buildConfigID = configuration
+ .getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, EMPTY_STR);
}
if (buildConfigID != null && buildConfigID.length() > 0 && projDes != null) {
ICConfigurationDescription buildConfiguration = projDes.getConfigurationById(buildConfigID);
@@ -635,15 +643,16 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
CDTPropertyManager.performOk(null);
}
}
-
- } catch (CoreException e) {}
+
+ } catch (CoreException e) {
+ }
}
/**
* Searches for compile errors in the current project and any of its
* prerequisite projects. If any compile errors, give the user a chance to
* abort the launch and correct the errors.
- *
+ *
* @param configuration
* @param mode
* @param monitor
@@ -652,20 +661,24 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
* if an exception occurs while checking for compile errors.
*/
@Override
- public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
+ public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException {
if (!workspaceBuildBeforeLaunch) {
// buildForLaunch was not called which means that the workspace pref is disabled. see if the user enabled the
// launch specific setting in the main tab. if so, we do call buildBeforeLaunch here.
- if (ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED == configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH,
+ if (ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED == configuration.getAttribute(
+ ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH,
ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING)) {
-
+
try {
- IProgressMonitor buildMonitor = new LaunchUtils.BuildProgressMonitor(monitor, 10, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
- buildMonitor.beginTask(LaunchMessages.AbstractCLaunchDelegate_BuildBeforeLaunch, 10);
- buildMonitor.subTask(LaunchMessages.AbstractCLaunchDelegate_PerformingBuild);
+ IProgressMonitor buildMonitor = new LaunchUtils.BuildProgressMonitor(monitor, 10,
+ SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
+ buildMonitor.beginTask(LaunchMessages.AbstractCLaunchDelegate_BuildBeforeLaunch, 10);
+ buildMonitor.subTask(LaunchMessages.AbstractCLaunchDelegate_PerformingBuild);
if (buildForLaunch(configuration, mode, new SubProgressMonitor(buildMonitor, 7))) {
- buildMonitor.subTask(LaunchMessages.AbstractCLaunchDelegate_PerformingIncrementalBuild);
- ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new SubProgressMonitor(buildMonitor, 3));
+ buildMonitor.subTask(LaunchMessages.AbstractCLaunchDelegate_PerformingIncrementalBuild);
+ ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD,
+ new SubProgressMonitor(buildMonitor, 3));
} else {
buildMonitor.worked(3); /* No incremental build required */
}
@@ -678,25 +691,25 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
}
boolean continueLaunch = true;
- if(orderedProjects == null) {
+ if (orderedProjects == null) {
return continueLaunch;
}
- if(monitor == null) {
+ if (monitor == null) {
monitor = new NullProgressMonitor();
}
-
+
int scale = 1000;
int totalWork = (orderedProjects.size() + 1) * scale;
try {
- monitor.beginTask(LaunchMessages.AbstractCLaunchDelegate_searching_for_errors, totalWork);
+ monitor.beginTask(LaunchMessages.AbstractCLaunchDelegate_searching_for_errors, totalWork);
boolean compileErrorsInProjs = buildFailed;
//check prerequisite projects for compile errors.
if (!compileErrorsInProjs) {
for (Iterator i = orderedProjects.iterator(); i.hasNext();) {
- IProject proj = (IProject)i.next();
- monitor.subTask(LaunchMessages.AbstractCLaunchDelegate_searching_for_errors_in + proj.getName());
+ IProject proj = (IProject) i.next();
+ monitor.subTask(LaunchMessages.AbstractCLaunchDelegate_searching_for_errors_in + proj.getName());
monitor.worked(scale);
compileErrorsInProjs = existsErrors(proj);
if (compileErrorsInProjs) {
@@ -707,7 +720,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
//check current project, if prerequite projects were ok
if (!compileErrorsInProjs) {
- monitor.subTask(LaunchMessages.AbstractCLaunchDelegate_searching_for_errors_in + project.getName());
+ monitor.subTask(LaunchMessages.AbstractCLaunchDelegate_searching_for_errors_in + project.getName());
monitor.worked(scale);
compileErrorsInProjs = existsErrors(project);
}
@@ -716,16 +729,16 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
if (compileErrorsInProjs) {
IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(promptStatus);
if (prompter != null) {
- continueLaunch = ((Boolean)prompter.handleStatus(complileErrorPromptStatus, null)).booleanValue();
+ continueLaunch = ((Boolean) prompter.handleStatus(complileErrorPromptStatus, null)).booleanValue();
}
}
} finally {
monitor.done();
}
-
+
if (continueLaunch) // If no problems then restore the previous build configuration. Otherwise leave it so the user can fix the build issues.
resetBuildConfiguration(project);
-
+
return continueLaunch;
}
@@ -733,10 +746,10 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
// Restore the active configuration if it was changed for the launch
if (preLaunchBuildConfiguration != null) {
ICProjectDescription projDes = CDTPropertyManager.getProjectDescription(buildProject);
-
- if (preLaunchBuildConfiguration.length() > 0 && projDes != null)
- {
- ICConfigurationDescription buildConfiguration = projDes.getConfigurationById(preLaunchBuildConfiguration);
+
+ if (preLaunchBuildConfiguration.length() > 0 && projDes != null) {
+ ICConfigurationDescription buildConfiguration = projDes
+ .getConfigurationById(preLaunchBuildConfiguration);
if (buildConfiguration != null) {
buildConfiguration.setActive();
CDTPropertyManager.performOk(null);
@@ -749,7 +762,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
/**
* Searches for compile errors in the specified project
- *
+ *
* @param proj
* The project to search
* @return true if compile errors exist, otherwise false
@@ -772,28 +785,28 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.core.model.ILaunchConfigurationDelegate2#preLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration,
* java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
- public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
- if(monitor == null) {
+ public boolean preLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException {
+ if (monitor == null) {
monitor = new NullProgressMonitor();
}
-
- if(!mode.equals(ILaunchManager.RUN_MODE))
- org.eclipse.cdt.launch.LaunchUtils.enableActivity("org.eclipse.cdt.debug.cdigdbActivity", true); //$NON-NLS-1$
+ if (!mode.equals(ILaunchManager.RUN_MODE))
+ org.eclipse.cdt.launch.LaunchUtils.enableActivity("org.eclipse.cdt.debug.cdigdbActivity", true); //$NON-NLS-1$
workspaceBuildBeforeLaunch = false;
int scale = 1000;
int totalWork = 2 * scale;
-
+
try {
- monitor.beginTask(LaunchMessages.AbstractCLaunchDelegate_20, totalWork);
-
+ monitor.beginTask(LaunchMessages.AbstractCLaunchDelegate_20, totalWork);
+
// build project list
orderedProjects = null;
ICProject cProject = CDebugUtils.getCProject(configuration);
@@ -804,7 +817,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
orderedProjects = getBuildOrder(new ArrayList(projectSet));
}
monitor.worked(scale);
-
+
// do generic launch checks
return super.preLaunchCheck(configuration, mode, new SubProgressMonitor(monitor, scale));
} finally {
@@ -825,10 +838,11 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
} catch (ClassCastException e) {
exception = e;
}
- Status status = new Status(IStatus.ERROR,getPluginID(),
- ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_BINARY,
- LaunchMessages.AbstractCLaunchDelegate_Program_is_not_a_recognized_executable + " " + exePath.toOSString(), //$NON-NLS-1$
- exception);
+ Status status = new Status(IStatus.ERROR, getPluginID(),
+ ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_BINARY,
+ LaunchMessages.AbstractCLaunchDelegate_Program_is_not_a_recognized_executable + " " //$NON-NLS-1$
+ + exePath.toOSString(),
+ exception);
throw new CoreException(status);
}
@@ -839,8 +853,8 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
*/
protected Properties getEnvironmentAsProperty(ILaunchConfiguration config) throws CoreException {
String[] envp = getEnvironment(config);
- Properties p = new Properties( );
- for( int i = 0; i < envp.length; i++ ) {
+ Properties p = new Properties();
+ for (int i = 0; i < envp.length; i++) {
int idx = envp[i].indexOf('=');
if (idx != -1) {
String key = envp[i].substring(0, idx);
@@ -862,24 +876,25 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
protected String[] getEnvironment(ILaunchConfiguration config) throws CoreException {
try {
// Migrate old env settings to new.
- Map map = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map)null);
+ Map map = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
if (map != null) {
wc.setAttribute(ILaunchManager.ATTR_ENVIRONMENT_VARIABLES, map);
- wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map)null);
+ wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
config = wc.doSave();
}
- boolean append = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true);
+ boolean append = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT,
+ true);
wc.setAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, append);
} catch (CoreException e) {
- }
+ }
String[] array = DebugPlugin.getDefault().getLaunchManager().getEnvironment(config);
if (array == null) {
return new String[0];
}
return array;
}
-
+
/**
* Return the save environment variables in the configuration. The array
* does not include the default environment of the target. array[n] :
@@ -890,7 +905,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
protected String[] getEnvironmentArray(ILaunchConfiguration config) {
Map env = null;
try {
- env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map)null);
+ env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
} catch (CoreException e) {
}
if (env == null) {
@@ -900,8 +915,8 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
Iterator entries = env.entrySet().iterator();
Entry entry;
for (int i = 0; entries.hasNext() && i < array.length; i++) {
- entry = (Entry)entries.next();
- array[i] = ((String)entry.getKey()) + "=" + ((String)entry.getValue()); //$NON-NLS-1$
+ entry = (Entry) entries.next();
+ array[i] = ((String) entry.getKey()) + "=" + ((String) entry.getValue()); //$NON-NLS-1$
}
return array;
}
@@ -916,7 +931,7 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
Properties prop = new Properties();
Map env = null;
try {
- env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map)null);
+ env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
} catch (CoreException e) {
}
if (env == null)
@@ -924,15 +939,15 @@ abstract public class AbstractCLaunchDelegate extends LaunchConfigurationDelegat
Iterator entries = env.entrySet().iterator();
Entry entry;
while (entries.hasNext()) {
- entry = (Entry)entries.next();
- prop.setProperty((String)entry.getKey(), (String)entry.getValue());
+ entry = (Entry) entries.next();
+ prop.setProperty((String) entry.getKey(), (String) entry.getValue());
}
return prop;
}
/**
* Returns the default process attribute map for C/C++ processes.
- *
+ *
* @return default process attribute map for C/C++ processes
*/
protected Map getDefaultProcessMap() {
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java
index 69a97ec590..0ee855ec3f 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/AbstractCLaunchDelegate2.java
@@ -68,7 +68,7 @@ import org.eclipse.osgi.util.NLS;
/**
* AbstractCLaunchDelegate2 is used by most DSF based debuggers. It replaces AbstractCLaunchDelegate
* which is the launch delegate used by most CDI based debuggers.
- *
+ *
* While it is technically possible to merge the two, AbstractCLaunchDelegate has been left
* unmodified because it is commonly used by CDT clients and contains lots of obscure code
* created long ago to handle issues whose relevance is unclear today.
@@ -81,7 +81,7 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
private boolean workspaceBuildBeforeLaunch;
/** Flag set to true if build before launch failed, or was cancelled. */
private boolean buildFailed;
-
+
/**
* Flag specified at construction time to indicate if a project-less
* launch is supported for this type of launch delegate.
@@ -100,7 +100,7 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
/**
* Recursively creates a set of projects referenced by the current project
- *
+ *
* @param proj
* The current project
* @param referencedProjSet
@@ -109,7 +109,8 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
* if an error occurs while getting referenced projects from the
* current project
*/
- private HashSet<IProject> getReferencedProjectSet(IProject proj, HashSet<IProject> referencedProjSet) throws CoreException {
+ private HashSet<IProject> getReferencedProjectSet(IProject proj, HashSet<IProject> referencedProjSet)
+ throws CoreException {
// The top project is a reference too and it must be added at the top to avoid cycles
referencedProjSet.add(proj);
@@ -131,7 +132,7 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
* project will, under the covers, cause its CDT-referenced projects to be
* built as well (a function of CDT build). So, any files in such projects
* should be saved before launch.
- *
+ *
* @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#getBuildOrder(org.eclipse.debug.core.ILaunchConfiguration,
* java.lang.String)
*/
@@ -176,7 +177,7 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
/**
* Searches for compile errors in the specified project
- * Used in finalLaunchCheck()
+ * Used in finalLaunchCheck()
* @param proj
* The project to search
* @return true if compile errors exist, otherwise false
@@ -186,7 +187,7 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
IMarker[] markers = proj.findMarkers(ICModelMarker.C_MODEL_PROBLEM_MARKER, true, IResource.DEPTH_INFINITE);
if (markers.length > 0) {
for (IMarker marker : markers) {
- Integer severity = (Integer)marker.getAttribute(IMarker.SEVERITY);
+ Integer severity = (Integer) marker.getAttribute(IMarker.SEVERITY);
if (severity != null && severity.intValue() >= IMarker.SEVERITY_ERROR) {
return true;
}
@@ -198,7 +199,7 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
/**
* Throws a core exception with an error status object built from the given
* message, lower level exception, and error code.
- *
+ *
* @param message
* the status message
* @param exception
@@ -212,22 +213,23 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
if (exception != null) {
MultiStatus multiStatus = new MultiStatus(getPluginID(), code, message, exception);
multiStatus.add(new Status(IStatus.ERROR, getPluginID(), code, exception.getLocalizedMessage(), exception));
- status= multiStatus;
+ status = multiStatus;
} else {
- status= new Status(IStatus.ERROR, getPluginID(), code, message, null);
+ status = new Status(IStatus.ERROR, getPluginID(), code, message, null);
}
throw new CoreException(status);
}
@Override
- public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
+ public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor)
+ throws CoreException {
// TODO Auto-generated method stub
-
+
}
/**
* Builds the project referenced in the launch configuration
- *
+ *
* @param configuration
* the configuration being launched
* @param mode
@@ -240,7 +242,8 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
* if an exception occurs while building
*/
@Override
- public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
+ public boolean buildForLaunch(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException {
try {
SubMonitor submon = SubMonitor.convert(monitor, "", 1); //$NON-NLS-1$
@@ -251,15 +254,16 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
if (cProject != null) {
project = cProject.getProject();
}
-
+
if (project == null) {
return false;
}
-
+
// check the build before launch setting and honor it
- int buildBeforeLaunchValue = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH,
+ int buildBeforeLaunchValue = configuration.getAttribute(
+ ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH,
ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING);
-
+
// we shouldn't be getting called if the workspace setting is disabled, so assume we need to
// build unless the user explicitly disabled it in the main tab of the launch.
if (buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED) {
@@ -271,7 +275,8 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
// If automatic configuration detection then discover the build config corresponding to the executable
if (configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_AUTO, false)) {
String programPath = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); //$NON-NLS-1$
- programPath = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(programPath);
+ programPath = VariablesPlugin.getDefault().getStringVariableManager()
+ .performStringSubstitution(programPath);
ICConfigurationDescription buildConfig = LaunchUtils.getBuildConfigByProgramPath(project, programPath);
if (buildConfig != null)
buildConfigID = buildConfig.getId();
@@ -279,7 +284,8 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
// The attribute value will be "" if 'Use Active' is selected
if (buildConfigID == null) {
- buildConfigID = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, ""); //$NON-NLS-1$
+ buildConfigID = configuration
+ .getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, ""); //$NON-NLS-1$
if (buildConfigID.length() == 0) {
buildConfigID = null;
}
@@ -294,14 +300,13 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
idIsGood = desc.getConfigurationById(buildConfigID) != null;
}
if (!idIsGood) {
- buildConfigID = null; // use active configuration
+ buildConfigID = null; // use active configuration
}
}
-
+
buildProject(project, buildConfigID, submon.newChild(1));
return false;
- }
- finally {
+ } finally {
if (monitor != null) {
monitor.done();
}
@@ -313,7 +318,7 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
* LaunchConfigurationDelegate#buildProjects(IProject[], IProgressMonitor).
* It builds only one project and it builds a particular CDT build
* configuration of it. It was added to address bug 309126 and 312709
- *
+ *
* @param project
* the project to build
* @param buildConfigID
@@ -324,15 +329,16 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
* progress monitor
* @throws CoreException
*/
- protected void buildProject(final IProject project, final String buildConfigID, IProgressMonitor monitor) throws CoreException {
+ protected void buildProject(final IProject project, final String buildConfigID, IProgressMonitor monitor)
+ throws CoreException {
final int TOTAL_TICKS = 1000;
-
+
buildFailed = false;
// Some day, this will hopefully be a simple pass-thru to a cdt.core
// utility. See bug 313927
- IWorkspaceRunnable build = new IWorkspaceRunnable(){
+ IWorkspaceRunnable build = new IWorkspaceRunnable() {
@Override
public void run(IProgressMonitor pm) throws CoreException {
SubMonitor localmonitor = SubMonitor.convert(pm, "", TOTAL_TICKS); //$NON-NLS-1$
@@ -340,38 +346,38 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
try {
// Number of times we'll end up calling IProject.build()
final int buildCount = (buildConfigID == null) ? 1 : project.getDescription().getBuildSpec().length;
- if (buildCount == 0) {
+ if (buildCount == 0) {
return; // the case for an imported-executable project; see bugzilla 315396
}
final int subtaskTicks = TOTAL_TICKS / buildCount;
-
+
if (buildConfigID != null) {
// Build a specific configuration
-
+
// To pass args, we have to specify the builder name.
// There can be multiple so this can require multiple
// builds. Note that this happens under the covers in
// the 'else' (args-less) case below
- Map<String,String> cfgIdArgs = AbstractCLaunchDelegate2.cfgIdsToMap(new String[] {buildConfigID}, new HashMap<String,String>());
- cfgIdArgs.put(CONTENTS, CONTENTS_CONFIGURATION_IDS);
+ Map<String, String> cfgIdArgs = AbstractCLaunchDelegate2
+ .cfgIdsToMap(new String[] { buildConfigID }, new HashMap<String, String>());
+ cfgIdArgs.put(CONTENTS, CONTENTS_CONFIGURATION_IDS);
ICommand[] commands = project.getDescription().getBuildSpec();
assert buildCount == commands.length;
for (ICommand command : commands) {
Map<String, String> args = command.getArguments();
if (args == null) {
args = new HashMap<String, String>(cfgIdArgs);
- }
- else {
+ } else {
args.putAll(cfgIdArgs);
}
-
+
if (localmonitor.isCanceled()) {
throw new OperationCanceledException();
}
- project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, command.getBuilderName(), args, localmonitor.newChild(subtaskTicks));
+ project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, command.getBuilderName(), args,
+ localmonitor.newChild(subtaskTicks));
}
- }
- else {
+ } else {
// Build the active configuration
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, localmonitor.newChild(subtaskTicks));
}
@@ -391,15 +397,15 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
/** TODO: Temporarily duplicated from BuilderFactory. Remove when 313927 is addressed */
static final String CONFIGURATION_IDS = "org.eclipse.cdt.make.core.configurationIds"; //$NON-NLS-1$
-
+
/** TODO: Temporarily duplicated from BuilderFactory. Remove when 313927 is addressed */
static final String CONTENTS = "org.eclipse.cdt.make.core.contents"; //$NON-NLS-1$
-
+
/** TODO: Temporarily duplicated from BuilderFactory. Remove when 313927 is addressed */
static final String CONTENTS_CONFIGURATION_IDS = "org.eclipse.cdt.make.core.configurationIds"; //$NON-NLS-1$
/** TODO: Temporarily duplicated from BuilderFactory. Remove when 313927 is addressed */
- private static Map<String, String> cfgIdsToMap(String ids[], Map<String, String> map){
+ private static Map<String, String> cfgIdsToMap(String ids[], Map<String, String> map) {
map.put(CONFIGURATION_IDS, encodeList(Arrays.asList(ids)));
return map;
}
@@ -428,37 +434,41 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
return str.toString();
}
-
/**
* The platform has a generic prompter object that redirects to an
* appropriate prompter based on the status object. The value-add it
* provides is that it can be invoked from a non-GUI thread.
*/
- private static final IStatus uiPromptStatus = new Status(IStatus.ERROR, "org.eclipse.debug.ui", 200, IInternalDebugCoreConstants.EMPTY_STRING, null); //$NON-NLS-1$
+ private static final IStatus uiPromptStatus = new Status(IStatus.ERROR, "org.eclipse.debug.ui", 200, //$NON-NLS-1$
+ IInternalDebugCoreConstants.EMPTY_STRING, null);
- /** Status object used to fish out our BuildErrPrompter */
- private static final IStatus promptStatusMainProj = new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(), BuildErrPrompter.STATUS_CODE_ERR_IN_MAIN_PROJ, IInternalDebugCoreConstants.EMPTY_STRING, null);
-
/** Status object used to fish out our BuildErrPrompter */
- private static final IStatus promptStatusReferencedProjs = new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(), BuildErrPrompter.STATUS_CODE_ERR_IN_REFERENCED_PROJS, IInternalDebugCoreConstants.EMPTY_STRING, null);
-
+ private static final IStatus promptStatusMainProj = new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(),
+ BuildErrPrompter.STATUS_CODE_ERR_IN_MAIN_PROJ, IInternalDebugCoreConstants.EMPTY_STRING, null);
+
+ /** Status object used to fish out our BuildErrPrompter */
+ private static final IStatus promptStatusReferencedProjs = new Status(IStatus.ERROR,
+ LaunchUIPlugin.getUniqueIdentifier(), BuildErrPrompter.STATUS_CODE_ERR_IN_REFERENCED_PROJS,
+ IInternalDebugCoreConstants.EMPTY_STRING, null);
+
private Object[] createPrompterArgs(ILaunchConfiguration launchConfig) throws CoreException {
-
+
IProject project = CDebugUtils.getCProject(launchConfig).getProject();
-
+
Object[] args = new Object[3];
-
+
// The launch configuration
args[0] = launchConfig;
-
+
// The name of the project
args[1] = project.getName();
-
+
// The name of the build configuration. Empty string if the
// setting is "Active" or the selected configuration is the
// active one, otherwise the name of the configuration.
args[2] = ""; //$NON-NLS-1$
- String buildConfigId = launchConfig.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, ""); //$NON-NLS-1$
+ String buildConfigId = launchConfig.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID,
+ ""); //$NON-NLS-1$
if (buildConfigId.length() > 0) {
ICProjectDescription desc = CCorePlugin.getDefault().getProjectDescription(project, false);
if (desc != null) {
@@ -467,34 +477,38 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
if ((cfgDesc != null) && (cfgDesc != cfgDescActive)) {
args[2] = cfgDesc.getName();
}
-
+
// Note that we use the active build configuration if the ID in
// the launch config is no longer valid. This is consistent with
// the logic in buildForLaunch()
}
}
-
+
return args;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#finalLaunchCheck(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
- public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor) throws CoreException {
+ public boolean finalLaunchCheck(ILaunchConfiguration configuration, String mode, IProgressMonitor monitor)
+ throws CoreException {
try {
- SubMonitor localMonitor = SubMonitor.convert(monitor, LaunchMessages.AbstractCLaunchDelegate_BuildBeforeLaunch, 10);
-
+ SubMonitor localMonitor = SubMonitor.convert(monitor,
+ LaunchMessages.AbstractCLaunchDelegate_BuildBeforeLaunch, 10);
+
if (!workspaceBuildBeforeLaunch) {
// buildForLaunch was not called which means that the workspace pref is disabled. see if the user enabled the
// launch specific setting in the main tab. if so, we do call buildBeforeLaunch here.
- if (ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED == configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH,
+ if (ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED == configuration.getAttribute(
+ ICDTLaunchConfigurationConstants.ATTR_BUILD_BEFORE_LAUNCH,
ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING)) {
-
- localMonitor.subTask(LaunchMessages.AbstractCLaunchDelegate_PerformingBuild);
+
+ localMonitor.subTask(LaunchMessages.AbstractCLaunchDelegate_PerformingBuild);
if (buildForLaunch(configuration, mode, localMonitor.newChild(7))) {
- localMonitor.subTask(LaunchMessages.AbstractCLaunchDelegate_PerformingIncrementalBuild);
- ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD, localMonitor.newChild(3));
+ localMonitor.subTask(LaunchMessages.AbstractCLaunchDelegate_PerformingIncrementalBuild);
+ ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.INCREMENTAL_BUILD,
+ localMonitor.newChild(3));
}
}
}
@@ -511,17 +525,16 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
localMonitor.subTask(DebugCoreMessages.LaunchConfigurationDelegate_6);
if (buildFailed || existsProblems(project)) {
// There's a build error in the main project
-
- // Put up the error dialog.
+
+ // Put up the error dialog.
IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(uiPromptStatus);
if (prompter != null) {
- continueLaunch = ((Boolean) prompter.handleStatus(promptStatusMainProj, createPrompterArgs(configuration))).booleanValue();
+ continueLaunch = ((Boolean) prompter.handleStatus(promptStatusMainProj,
+ createPrompterArgs(configuration))).booleanValue();
+ } else {
+ assert false;
}
- else {
- assert false;
- }
- }
- else {
+ } else {
// No build error in the main project but see if there's one
// in any of its referenced projects
IProject[] projects = getBuildOrder(configuration, mode);
@@ -531,16 +544,16 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
if (proj.equals(project)) {
continue;
}
-
+
if (existsProblems(proj)) {
- // Put up the error dialog.
+ // Put up the error dialog.
IStatusHandler prompter = DebugPlugin.getDefault().getStatusHandler(uiPromptStatus);
prompter = DebugPlugin.getDefault().getStatusHandler(uiPromptStatus);
if (prompter != null) {
- continueLaunch = ((Boolean) prompter.handleStatus(promptStatusReferencedProjs, createPrompterArgs(configuration))).booleanValue();
- }
- else {
- assert false;
+ continueLaunch = ((Boolean) prompter.handleStatus(promptStatusReferencedProjs,
+ createPrompterArgs(configuration))).booleanValue();
+ } else {
+ assert false;
}
// The error message says "one or more" and doesn't mention names.
@@ -549,25 +562,25 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
}
}
}
-
+
// Note that we do not call our super implementation (platform).
// That's because it'll just re-do everything we've done here in a
// non-customized way. However, we need to keep an eye out for any
// future additions to the platform's logic.
-
+
return continueLaunch;
} finally {
- workspaceBuildBeforeLaunch = false; // reset for future run
+ workspaceBuildBeforeLaunch = false; // reset for future run
if (monitor != null) {
monitor.done();
}
}
-}
+ }
protected ICProject verifyCProject(ILaunchConfiguration config) throws CoreException {
String name = CDebugUtils.getProjectName(config);
if (name == null && requireCProject) {
- abort(LaunchMessages.AbstractCLaunchDelegate_C_Project_not_specified, null,
+ abort(LaunchMessages.AbstractCLaunchDelegate_C_Project_not_specified, null,
ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROJECT);
}
ICProject cproject = CDebugUtils.getCProject(config);
@@ -580,7 +593,7 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
abort(NLS.bind(LaunchMessages.AbstractCLaunchDelegate_Project_NAME_is_closed, name), null,
ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
}
- abort(LaunchMessages.AbstractCLaunchDelegate_Not_a_C_CPP_project, null,
+ abort(LaunchMessages.AbstractCLaunchDelegate_Not_a_C_CPP_project, null,
ICDTLaunchConfigurationConstants.ERR_NOT_A_C_PROJECT);
}
return cproject;
@@ -590,30 +603,32 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
* Expands and returns the working directory attribute of the given launch
* configuration. Returns <code>null</code> if a working directory is not
* specified.
- *
+ *
* @param configuration launch configuration
* @return an absolute path to a directory, or <code>null</code> if unspecified
* @throws CoreException if unable to retrieve the associated launch
* configuration attribute or if unable to resolve any variables
- *
+ *
* @since 7.3
*/
protected IPath getWorkingDirectoryPath(ILaunchConfiguration config) throws CoreException {
- String location = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String)null);
+ String location = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
if (location != null) {
- String expandedLocation = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(location);;
+ String expandedLocation = VariablesPlugin.getDefault().getStringVariableManager()
+ .performStringSubstitution(location);
+ ;
if (!expandedLocation.isEmpty()) {
return new Path(expandedLocation);
}
}
return null;
}
-
+
/**
* Verifies the working directory specified by the given launch
* configuration exists, and returns that working directory, or
* <code>null</code> if none is specified.
- *
+ *
* @param configuration
* launch configuration
* @return the working directory specified by the given launch
@@ -634,7 +649,7 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
IProject p = cp.getProject();
return p.getLocation().toFile();
}
-
+
if (path.isAbsolute()) {
File dir = new File(path.toOSString());
if (dir.isDirectory()) {
@@ -648,49 +663,47 @@ public abstract class AbstractCLaunchDelegate2 extends LaunchConfigurationDelega
}
abort(LaunchMessages.AbstractCLaunchDelegate_Working_directory_does_not_exist,
- new FileNotFoundException(
- NLS.bind(LaunchMessages.AbstractCLaunchDelegate_WORKINGDIRECTORY_PATH_not_found,
- path.toOSString())),
- ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
+ new FileNotFoundException(NLS.bind(
+ LaunchMessages.AbstractCLaunchDelegate_WORKINGDIRECTORY_PATH_not_found, path.toOSString())),
+ ICDTLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
return null;
}
-
+
/**
* Verify that the program name of the configuration can be found as a file.
* This method supports a program name without a corresponding project,
* as long as the program name is specified with an absolute path.
- *
+ *
* @return Absolute path of the program location
* @since 7.3
*/
protected IPath verifyProgramPath(ILaunchConfiguration configuration, ICProject cproject) throws CoreException {
- String programName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String)null);
+ String programName = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
+ (String) null);
if (programName == null) {
abort(LaunchMessages.AbstractCLaunchDelegate_Program_file_not_specified, null,
- ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM);
+ ICDTLaunchConfigurationConstants.ERR_UNSPECIFIED_PROGRAM);
}
- programName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(programName);
+ programName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(programName);
- IPath programPath = new Path(programName);
+ IPath programPath = new Path(programName);
if (programPath.isEmpty()) {
abort(LaunchMessages.AbstractCLaunchDelegate_Program_file_does_not_exist, null,
- ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST);
+ ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST);
}
-
+
if (!programPath.isAbsolute() && cproject != null) {
// Find the specified program within the specified project
- IFile wsProgramPath = cproject.getProject().getFile(programPath);
- programPath = wsProgramPath.getLocation();
+ IFile wsProgramPath = cproject.getProject().getFile(programPath);
+ programPath = wsProgramPath.getLocation();
}
-
+
if (!programPath.toFile().exists()) {
- abort(LaunchMessages.AbstractCLaunchDelegate_Program_file_does_not_exist,
- new FileNotFoundException(
- NLS.bind(LaunchMessages.AbstractCLaunchDelegate_PROGRAM_PATH_not_found,
- programPath.toOSString())),
- ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST);
+ abort(LaunchMessages.AbstractCLaunchDelegate_Program_file_does_not_exist, new FileNotFoundException(
+ NLS.bind(LaunchMessages.AbstractCLaunchDelegate_PROGRAM_PATH_not_found, programPath.toOSString())),
+ ICDTLaunchConfigurationConstants.ERR_PROGRAM_NOT_EXIST);
}
-
+
return programPath;
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java
index b8bf156c81..d9a0d72939 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/LaunchUtils.java
@@ -64,7 +64,7 @@ public class LaunchUtils {
public BuildProgressMonitor(IProgressMonitor monitor, int ticks, int style) {
super(monitor, ticks, style);
}
-
+
public BuildProgressMonitor(IProgressMonitor monitor, int ticks) {
this(monitor, ticks, 0);
}
@@ -84,7 +84,7 @@ public class LaunchUtils {
}
/**
- * For given launch configuration returns the program arguments as
+ * For given launch configuration returns the program arguments as
* an array of individual arguments.
*/
public static String[] getProgramArgumentsArray(ILaunchConfiguration config) throws CoreException {
@@ -101,7 +101,7 @@ public class LaunchUtils {
}
return args;
}
-
+
/**
* @since 6.0
*/
@@ -110,7 +110,7 @@ public class LaunchUtils {
for (int i = 0; i < parserRef.length; i++) {
try {
IBinaryParser parser = CoreModelUtil.getBinaryParser(parserRef[i]);
- IBinaryObject exe = (IBinaryObject)parser.getBinary(exePath);
+ IBinaryObject exe = (IBinaryObject) parser.getBinary(exePath);
if (exe != null) {
return exe;
}
@@ -120,39 +120,35 @@ public class LaunchUtils {
}
IBinaryParser parser = CCorePlugin.getDefault().getDefaultBinaryParser();
try {
- IBinaryObject exe = (IBinaryObject)parser.getBinary(exePath);
+ IBinaryObject exe = (IBinaryObject) parser.getBinary(exePath);
return exe;
} catch (ClassCastException e) {
} catch (IOException e) {
}
return null;
}
-
+
/**
* @since 6.0
*/
- public static IBinaryObject getBinary(String programName, String projectName)
- throws CoreException
- {
- if (programName != null ) {
+ public static IBinaryObject getBinary(String programName, String projectName) throws CoreException {
+ if (programName != null) {
IPath exePath = new Path(programName);
IProject project = null;
if (projectName != null && !projectName.isEmpty()) {
project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
- if (project == null || project.getLocation() == null)
- {
+ if (project == null || project.getLocation() == null) {
return null;
}
if (!exePath.isAbsolute()) {
exePath = project.getLocation().append(exePath);
}
- }
+ }
return getBinary(project, exePath);
}
return null;
}
-
/**
* Convenience method.
*/
@@ -163,15 +159,13 @@ public class LaunchUtils {
private static String[] parseArguments(String args) {
return CommandLineUtil.argumentsToArray(args);
}
-
+
/**
* @since 6.1
*/
@SuppressWarnings("unchecked")
- public static void enableActivity(final String activityID, final boolean enableit)
- {
- if (PlatformUI.isWorkbenchRunning())
- {
+ public static void enableActivity(final String activityID, final boolean enableit) {
+ if (PlatformUI.isWorkbenchRunning()) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
@@ -180,9 +174,9 @@ public class LaunchUtils {
Set<String> enabledActivityIds = new HashSet<String>(activityManager.getEnabledActivityIds());
boolean changed = false;
if (enableit)
- changed = enabledActivityIds.add(activityID);
+ changed = enabledActivityIds.add(activityID);
else
- changed = enabledActivityIds.remove(activityID);
+ changed = enabledActivityIds.remove(activityID);
if (changed)
workbenchActivitySupport.setEnabledActivityIds(enabledActivityIds);
}
@@ -194,7 +188,7 @@ public class LaunchUtils {
* Get the build configuration that most likely builds the given program path.
* The build configuration is chosen as the one that outputs to a directory that contains
* the given program.
- *
+ *
* @param projectDesc The description for the project in which to search for the configuration.
* @param programPath The path to the program to search the build configurations for
* @return The build configuration that builds programName; or null if none or more than one were found.
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LaunchConfigAffinityExtensionPoint.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LaunchConfigAffinityExtensionPoint.java
index 76799d5441..244e1b971a 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LaunchConfigAffinityExtensionPoint.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LaunchConfigAffinityExtensionPoint.java
@@ -26,7 +26,7 @@ import org.eclipse.core.runtime.Platform;
* provide a collection of strings (launch configuration type IDs).
*/
public class LaunchConfigAffinityExtensionPoint {
-
+
static private final String EXTENSION_POINT_NAME = "launchConfigAffinity"; //$NON-NLS-1$
static private final String EXTENSION_ELEMENT_NAME = "launchConfigTypeId"; //$NON-NLS-1$
static private final String EXTENSION_ELEMENT_ATTR = "id"; //$NON-NLS-1$
@@ -34,23 +34,24 @@ public class LaunchConfigAffinityExtensionPoint {
/**
* Returns all launch configuration type IDs registered via the extension
* point.
- *
+ *
* @param ids
* Caller provides the collection. We just add to it. We do not
* clear it. Caller can provide any type of collection.
*/
static public <T extends Collection<String>> void getLaunchConfigTypeIds(T ids) {
- IExtension[] extensions = Platform.getExtensionRegistry().getExtensionPoint(LaunchUIPlugin.PLUGIN_ID, EXTENSION_POINT_NAME).getExtensions();
- for (IExtension extension : extensions) {
- IConfigurationElement[] elements = extension.getConfigurationElements();
- for (IConfigurationElement element : elements) {
- if (element.getName().equals(EXTENSION_ELEMENT_NAME)) {
- String id = element.getAttribute(EXTENSION_ELEMENT_ATTR);
- if (id != null) {
- ids.add(id);
- }
- }
- }
- }
+ IExtension[] extensions = Platform.getExtensionRegistry()
+ .getExtensionPoint(LaunchUIPlugin.PLUGIN_ID, EXTENSION_POINT_NAME).getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] elements = extension.getConfigurationElements();
+ for (IConfigurationElement element : elements) {
+ if (element.getName().equals(EXTENSION_ELEMENT_NAME)) {
+ String id = element.getAttribute(EXTENSION_ELEMENT_ATTR);
+ if (id != null) {
+ ids.add(id);
+ }
+ }
+ }
+ }
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java
index df28b088f8..981d769fbc 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/LocalRunLaunchDelegate.java
@@ -123,7 +123,7 @@ public class LocalRunLaunchDelegate extends AbstractCLaunchDelegate2 {
/**
* Gets the CDT environment from the CDT project's configuration referenced
* by the launch
- *
+ *
* This code matches what
* org.eclipse.cdt.dsf.gdb.launching.GdbLaunch.getLaunchEnvironment() and
* org.eclipse.cdt.dsf.gdb.service.DebugNewProcessSequence.stepSetEnvironmentVariables(RequestMonitor)
@@ -152,7 +152,7 @@ public class LocalRunLaunchDelegate extends AbstractCLaunchDelegate2 {
// If the launch configuration is the only environment the inferior should see, just use that
boolean append = config.getAttribute(ILaunchManager.ATTR_APPEND_ENVIRONMENT_VARIABLES, true);
boolean environmentCollectedFromProject = false;
-
+
if (append && project != null && project.isAccessible()) {
ICProjectDescription projDesc = CoreModel.getDefault().getProjectDescription(project, false);
if (projDesc != null) {
@@ -198,14 +198,14 @@ public class LocalRunLaunchDelegate extends AbstractCLaunchDelegate2 {
}
}
}
-
+
if (!environmentCollectedFromProject) {
// we haven't collected any environment variables from the project settings,
// therefore simply use the launch settings
- return DebugPlugin.getDefault().getLaunchManager().getEnvironment(config);
+ return DebugPlugin.getDefault().getLaunchManager().getEnvironment(config);
}
-
- // Now that we have the environment from the project, update it with
+
+ // Now that we have the environment from the project, update it with
// the environment settings the user has explicitly set in the launch
// configuration. There is no API in the launch manager to do this,
// so we create a temp copy with append = false to get around that.
@@ -222,7 +222,7 @@ public class LocalRunLaunchDelegate extends AbstractCLaunchDelegate2 {
}
}
}
-
+
// Turn it into an envp format
List<String> strings = new ArrayList<String>(envMap.size());
for (Entry<String, String> entry : envMap.entrySet()) {
@@ -267,7 +267,7 @@ public class LocalRunLaunchDelegate extends AbstractCLaunchDelegate2 {
/**
* Performs a runtime exec on the given command line in the context of the
* specified working directory, and returns the resulting process.
- *
+ *
* @param cmdLine
* the command line
* @param environ
@@ -304,7 +304,7 @@ public class LocalRunLaunchDelegate extends AbstractCLaunchDelegate2 {
* Modify the ILaunchConfiguration to set the
* DebugPlugin.ATTR_PROCESS_FACTORY_ID attribute, so as to specify the
* process factory to use.
- *
+ *
* This attribute should only be set if it is not part of the configuration
* already, to allow other code to set it to something else.
*/
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java
index 33f1ddd9ba..05e5e7c62d 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/MultiLaunchConfigurationDelegate.java
@@ -55,8 +55,8 @@ import org.eclipse.ui.activities.WorkbenchActivityHelper;
* @deprecated See Bug 517722, Launch Groups are now part of Platform.
*/
@Deprecated
-public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegate implements
- ILaunchConfigurationDelegate2 {
+public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegate
+ implements ILaunchConfigurationDelegate2 {
public static final String DEFAULT_MODE = "default"; //$NON-NLS-1$
private static final String NAME_PROP = "name"; //$NON-NLS-1$
private static final String ENABLED_PROP = "enabled"; //$NON-NLS-1$
@@ -65,12 +65,11 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
private static final String ACTION_PARAM_PROP = "actionParam"; //$NON-NLS-1$
public static String MULTI_LAUNCH_CONSTANTS_PREFIX = "org.eclipse.cdt.launch.launchGroup"; //$NON-NLS-1$
- public static class LaunchElement {
+ public static class LaunchElement {
public static enum EPostLaunchAction {
- NONE,
- WAIT_FOR_TERMINATION,
- DELAY
+ NONE, WAIT_FOR_TERMINATION, DELAY
};
+
/**
* Allows us decouple the enum identifier in the code from its textual representation in the GUI
*/
@@ -87,20 +86,18 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
return LaunchMessages.MultiLaunchConfigurationDelegate_Action_None;
}
}
+
/**
* Allows us decouple the enum identifier in the code from its textual representation in the GUI
*/
public static EPostLaunchAction strToActionEnum(String str) {
if (str.equals(LaunchMessages.MultiLaunchConfigurationDelegate_Action_None)) {
return EPostLaunchAction.NONE;
- }
- else if (str.equals(LaunchMessages.MultiLaunchConfigurationDelegate_Action_WaitUntilTerminated)) {
+ } else if (str.equals(LaunchMessages.MultiLaunchConfigurationDelegate_Action_WaitUntilTerminated)) {
return EPostLaunchAction.WAIT_FOR_TERMINATION;
- }
- else if (str.equals(LaunchMessages.MultiLaunchConfigurationDelegate_Action_Delay)) {
+ } else if (str.equals(LaunchMessages.MultiLaunchConfigurationDelegate_Action_Delay)) {
return EPostLaunchAction.DELAY;
- }
- else {
+ } else {
assert false : "new post launch action type is missing logic"; //$NON-NLS-1$
return EPostLaunchAction.NONE;
}
@@ -123,7 +120,7 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
* A specialization of launch to track sublaunches lifecycle, also terminates itself when all sublaunches are terminated
*
*/
- private class MultiLaunch extends Launch implements ILaunchesListener2{
+ private class MultiLaunch extends Launch implements ILaunchesListener2 {
/**
* Whether this process has been terminated
@@ -136,11 +133,9 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
*/
private Map<ILaunch, IProcess[]> subLaunches = new HashMap<ILaunch, IProcess[]>();
-
- public MultiLaunch(ILaunchConfiguration launchConfiguration,
- String mode) {
+ public MultiLaunch(ILaunchConfiguration launchConfiguration, String mode) {
super(launchConfiguration, mode, null);
- getLaunchManager().addLaunchListener((ILaunchesListener2)this);
+ getLaunchManager().addLaunchListener((ILaunchesListener2) this);
}
/**
@@ -148,7 +143,7 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
* @param subLaunch
*/
public void addSubLaunch(ILaunch subLaunch) {
- subLaunches.put(subLaunch, new IProcess[]{});
+ subLaunches.put(subLaunch, new IProcess[] {});
}
private ILaunch[] getSubLaunches() {
@@ -157,7 +152,9 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
private boolean isChild(ILaunch launch) {
for (ILaunch subLaunch : getSubLaunches()) {
- if (subLaunch == launch) { return true; }
+ if (subLaunch == launch) {
+ return true;
+ }
}
return false;
}
@@ -182,7 +179,6 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
return true;
}
-
/**
* Override default behavior by querying all sub-launches if they can be terminated
* @see org.eclipse.debug.core.Launch#canTerminate()
@@ -206,8 +202,8 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
*/
@Override
public void terminate() throws DebugException {
- MultiStatus status=
- new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED, DebugCoreMessages.Launch_terminate_failed, null);
+ MultiStatus status = new MultiStatus(DebugPlugin.getUniqueIdentifier(), DebugException.REQUEST_FAILED,
+ DebugCoreMessages.Launch_terminate_failed, null);
for (ILaunch launch : getSubLaunches()) {
if (launch.canTerminate()) {
@@ -223,7 +219,7 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
return;
}
- IStatus[] children= status.getChildren();
+ IStatus[] children = status.getChildren();
if (children.length == 1) {
throw new DebugException(children[0]);
}
@@ -236,7 +232,8 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
* @param launch
*/
private void launchTerminated(ILaunch launch) {
- if (this == launch) return;
+ if (this == launch)
+ return;
// Remove sub launch, keeping the processes of the terminated launch to
// show the association and to keep the console content accessible
@@ -254,7 +251,8 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
*/
@Override
public void launchChanged(ILaunch launch) {
- if (this == launch) return;
+ if (this == launch)
+ return;
// add/remove processes
if (isChild(launch)) {
@@ -292,7 +290,7 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
removeProcess(process);
}
- getLaunchManager().removeLaunchListener((ILaunchesListener2)this);
+ getLaunchManager().removeLaunchListener((ILaunchesListener2) this);
}
}
@@ -341,8 +339,7 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
* @see org.eclipse.debug.core.model.LaunchConfigurationDelegate#getLaunch(org.eclipse.debug.core.ILaunchConfiguration, java.lang.String)
*/
@Override
- public ILaunch getLaunch(ILaunchConfiguration configuration, String mode)
- throws CoreException {
+ public ILaunch getLaunch(ILaunchConfiguration configuration, String mode) throws CoreException {
return new MultiLaunch(configuration, mode);
}
@@ -362,15 +359,17 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
try {
monitor.beginTask(LaunchMessages.MultiLaunchConfigurationDelegate_0 + configuration.getName(), 1000);
- prefStore.setValue(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES, false);
+ prefStore.setValue(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES, false);
List<LaunchElement> launches = createLaunchElements(configuration, new ArrayList<LaunchElement>());
for (LaunchElement le : launches) {
- if (!le.enabled) continue;
+ if (!le.enabled)
+ continue;
// find launch; if not found, skip (error?)
final ILaunchConfiguration conf = findLaunch(le.name);
- if (conf == null) continue;
+ if (conf == null)
+ continue;
// determine mode for each launch
final String localMode;
@@ -385,24 +384,26 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
public void run() {
MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
LaunchMessages.LaunchUIPlugin_Error,
- NLS.bind(LaunchMessages.MultiLaunchConfigurationDelegate_Cannot,
- conf.toString(), localMode));
+ NLS.bind(LaunchMessages.MultiLaunchConfigurationDelegate_Cannot, conf.toString(),
+ localMode));
}
});
continue;
}
try {
- if (configuration.getName().equals(conf.getName())) throw new StackOverflowError();
+ if (configuration.getName().equals(conf.getName()))
+ throw new StackOverflowError();
// LAUNCH child here
- ILaunch subLaunch = DebugUIPlugin.buildAndLaunch(conf, localMode, new SubProgressMonitor(monitor, 1000 / launches.size()));
- ((MultiLaunch)launch).addSubLaunch(subLaunch);
+ ILaunch subLaunch = DebugUIPlugin.buildAndLaunch(conf, localMode,
+ new SubProgressMonitor(monitor, 1000 / launches.size()));
+ ((MultiLaunch) launch).addSubLaunch(subLaunch);
// Now that we added the launch in our list, we have already
// received the real launchChanged event, and did not know it was part of our list
// So, fake another event now.
- ((MultiLaunch)launch).launchChanged(subLaunch);
+ ((MultiLaunch) launch).launchChanged(subLaunch);
//Now we need to override the history to make multi-launch appear last, if we
//don't do it last launch would be our child's launch which is not correct
@@ -411,15 +412,13 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
postLaunchAction(subLaunch, le.action, le.actionParam, monitor);
-
} catch (StackOverflowError e) {
PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
LaunchMessages.LaunchUIPlugin_Error,
- NLS.bind(LaunchMessages.MultiLaunchConfigurationDelegate_Loop,
- conf.toString()));
+ NLS.bind(LaunchMessages.MultiLaunchConfigurationDelegate_Loop, conf.toString()));
}
});
}
@@ -433,12 +432,14 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
}
}
- private void postLaunchAction(ILaunch subLaunch, EPostLaunchAction action, Object actionParam, IProgressMonitor monitor) {
+ private void postLaunchAction(ILaunch subLaunch, EPostLaunchAction action, Object actionParam,
+ IProgressMonitor monitor) {
switch (action) {
case NONE:
return;
case WAIT_FOR_TERMINATION:
- monitor.subTask(LaunchMessages.MultiLaunchConfigurationDelegate_Action_WaitingForTermination + " " + subLaunch.getLaunchConfiguration().getName()); //$NON-NLS-1$
+ monitor.subTask(LaunchMessages.MultiLaunchConfigurationDelegate_Action_WaitingForTermination + " " //$NON-NLS-1$
+ + subLaunch.getLaunchConfiguration().getName());
while (!subLaunch.isTerminated() && !monitor.isCanceled()) {
try {
Thread.sleep(1000);
@@ -449,12 +450,12 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
monitor.subTask(""); //$NON-NLS-1$
break;
case DELAY:
- Integer waitSecs = (Integer)actionParam;
+ Integer waitSecs = (Integer) actionParam;
if (waitSecs != null) {
- monitor.subTask(NLS.bind(LaunchMessages.MultiLaunchConfigurationDelegate_Action_Delaying,
- waitSecs.toString()));
+ monitor.subTask(
+ NLS.bind(LaunchMessages.MultiLaunchConfigurationDelegate_Action_Delaying, waitSecs.toString()));
try {
- Thread.sleep(waitSecs * 1000); // param is milliseconds
+ Thread.sleep(waitSecs * 1000); // param is milliseconds
} catch (InterruptedException e) {
// ok
}
@@ -489,7 +490,8 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
ILaunchConfiguration[] launchConfigurations = launchManager.getLaunchConfigurations();
for (int i = 0; i < launchConfigurations.length; i++) {
ILaunchConfiguration lConf = launchConfigurations[i];
- if (lConf.getName().equals(name)) return lConf;
+ if (lConf.getName().equals(name))
+ return lConf;
}
return null;
}
@@ -497,13 +499,13 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
public static List<LaunchElement> createLaunchElements(ILaunchConfiguration configuration,
List<MultiLaunchConfigurationDelegate.LaunchElement> input) {
try {
- Map<?,?> attrs = configuration.getAttributes();
+ Map<?, ?> attrs = configuration.getAttributes();
for (Iterator<?> iterator = attrs.keySet().iterator(); iterator.hasNext();) {
String attr = (String) iterator.next();
try {
if (attr.startsWith(MultiLaunchConfigurationDelegate.MULTI_LAUNCH_CONSTANTS_PREFIX)) {
- String prop = attr.substring(MultiLaunchConfigurationDelegate.MULTI_LAUNCH_CONSTANTS_PREFIX
- .length() + 1);
+ String prop = attr
+ .substring(MultiLaunchConfigurationDelegate.MULTI_LAUNCH_CONSTANTS_PREFIX.length() + 1);
int k = prop.indexOf('.');
String num = prop.substring(0, k);
int index = Integer.parseInt(num);
@@ -514,7 +516,7 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
el.name = (String) attrs.get(attr);
Object actionParam = null;
- String actionStr = (String)attrs.get(getProp(index, ACTION_PROP));
+ String actionStr = (String) attrs.get(getProp(index, ACTION_PROP));
EPostLaunchAction action;
try {
@@ -524,9 +526,9 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
}
if (action == EPostLaunchAction.DELAY) {
try {
- actionParam = Integer.parseInt((String)attrs.get(getProp(index, ACTION_PARAM_PROP)));
- }
- catch (NumberFormatException exc) {
+ actionParam = Integer
+ .parseInt((String) attrs.get(getProp(index, ACTION_PARAM_PROP)));
+ } catch (NumberFormatException exc) {
LaunchUIPlugin.log(exc);
}
}
@@ -560,11 +562,13 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
int i = 0;
removeLaunchElements(configuration);
for (LaunchElement el : input) {
- if (el == null) continue;
+ if (el == null)
+ continue;
configuration.setAttribute(MultiLaunchConfigurationDelegate.getProp(i, NAME_PROP), el.name);
configuration.setAttribute(MultiLaunchConfigurationDelegate.getProp(i, ACTION_PROP), el.action.toString());
// note: the saving of the action param will need to be enhanced if ever an action type is introduced that uses something that can't be reconstructed from its toString()
- configuration.setAttribute(MultiLaunchConfigurationDelegate.getProp(i, ACTION_PARAM_PROP), el.actionParam != null ? el.actionParam.toString() : null);
+ configuration.setAttribute(MultiLaunchConfigurationDelegate.getProp(i, ACTION_PARAM_PROP),
+ el.actionParam != null ? el.actionParam.toString() : null);
configuration.setAttribute(MultiLaunchConfigurationDelegate.getProp(i, MODE_PROP), el.mode);
configuration.setAttribute(MultiLaunchConfigurationDelegate.getProp(i, ENABLED_PROP), el.enabled + ""); //$NON-NLS-1$
i++;
@@ -573,7 +577,7 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
public static void removeLaunchElements(ILaunchConfigurationWorkingCopy configuration) {
try {
- Map<?,?> attrs = configuration.getAttributes();
+ Map<?, ?> attrs = configuration.getAttributes();
for (Iterator<?> iterator = attrs.keySet().iterator(); iterator.hasNext();) {
String attr = (String) iterator.next();
try {
@@ -599,6 +603,6 @@ public class MultiLaunchConfigurationDelegate extends LaunchConfigurationDelegat
* @return <code>true</code> if it is a valid reference, <code>false</code> if launch configuration should be filtered
*/
public static boolean isValidLaunchReference(ILaunchConfiguration config) {
- return DebugUIPlugin.doLaunchConfigurationFiltering( config) && !WorkbenchActivityHelper.filterItem(config);
+ return DebugUIPlugin.doLaunchConfigurationFiltering(config) && !WorkbenchActivityHelper.filterItem(config);
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/corebuild/GenericLaunchConfigTabGroup.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/corebuild/GenericLaunchConfigTabGroup.java
index d45fca1a8b..bcc8b1a2b8 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/corebuild/GenericLaunchConfigTabGroup.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/corebuild/GenericLaunchConfigTabGroup.java
@@ -21,11 +21,7 @@ public class GenericLaunchConfigTabGroup extends AbstractLaunchConfigurationTabG
@Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- setTabs(new ILaunchConfigurationTab[] {
- new GenericMainTab(),
- new EnvironmentTab(),
- new CommonTab()
- });
+ setTabs(new ILaunchConfigurationTab[] { new GenericMainTab(), new EnvironmentTab(), new CommonTab() });
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/corebuild/LocalLaunchConfigurationTabGroup.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/corebuild/LocalLaunchConfigurationTabGroup.java
index 87d4c019d1..9ddf6f93d9 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/corebuild/LocalLaunchConfigurationTabGroup.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/corebuild/LocalLaunchConfigurationTabGroup.java
@@ -23,10 +23,7 @@ public class LocalLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
ILaunchConfigurationTab mainTab = new CoreBuildMainTab();
ILaunchConfigurationTab buildTab = new CoreBuildTab();
- setTabs(new ILaunchConfigurationTab[] {
- mainTab,
- buildTab
- });
+ setTabs(new ILaunchConfigurationTab[] { mainTab, buildTab });
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/AbstractLaunchConfigChange.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/AbstractLaunchConfigChange.java
index 35b5ce0cb6..c66597f25b 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/AbstractLaunchConfigChange.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/AbstractLaunchConfigChange.java
@@ -25,11 +25,11 @@ import org.eclipse.ltk.core.refactoring.RefactoringStatus;
/**
* Common implementation of launch configuration changes.
- *
+ *
* @author Christian W. Damus (cdamus)
- *
+ *
* @since 6.0
- *
+ *
*/
public abstract class AbstractLaunchConfigChange extends Change {
@@ -37,7 +37,7 @@ public abstract class AbstractLaunchConfigChange extends Change {
/**
* Initializes me with the launch configuration that I change.
- *
+ *
* @param launchConfig
* my launch configuration
*/
@@ -60,8 +60,7 @@ public abstract class AbstractLaunchConfigChange extends Change {
}
@Override
- public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException,
- OperationCanceledException {
+ public RefactoringStatus isValid(IProgressMonitor pm) throws CoreException, OperationCanceledException {
return new RefactoringStatus();
}
@@ -71,17 +70,17 @@ public abstract class AbstractLaunchConfigChange extends Change {
* The pattern of usage is:
* <pre>
* Change change = null;
- *
+ *
* for (<i>whatever</i>) {
* change = AbstractLaunchConfigChange.append(change, createNextChange(...));
* }
- *
+ *
* // do something with the change
* </pre>
- *
+ *
* @param change a change to add to, or <code>null</code> to start a new (potentially conposite) change
* @param toAppend the change to add. Must not be <code>null</code>
- *
+ *
* @return the resulting change, which may or may not be a composite
*/
public static Change append(Change change, Change toAppend) {
@@ -91,8 +90,7 @@ public abstract class AbstractLaunchConfigChange extends Change {
((CompositeChange) change).add(toAppend);
return change;
} else {
- return new CompositeChange(LaunchMessages.AbstractChange_compositeName0,
- new Change[] { change, toAppend });
+ return new CompositeChange(LaunchMessages.AbstractChange_compositeName0, new Change[] { change, toAppend });
}
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/ProjectRenameChange.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/ProjectRenameChange.java
index cf54cdb2c2..b9c748f6e8 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/ProjectRenameChange.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/ProjectRenameChange.java
@@ -36,9 +36,9 @@ import org.eclipse.osgi.util.NLS;
/**
* A change to update a launch configuration with a new project name.
- *
+ *
* @author Christian W. Damus (cdamus)
- *
+ *
* @since 6.0
*/
class ProjectRenameChange extends AbstractLaunchConfigChange {
@@ -52,11 +52,11 @@ class ProjectRenameChange extends AbstractLaunchConfigChange {
* The project relative path of the .launch file if the launch config is a
* non-local one and is stored within the project.
*/
- private IPath projectRelativePath;
-
+ private IPath projectRelativePath;
+
/**
* Initializes me.
- *
+ *
* @param launchConfig
* the launch configuration that I change
* @param oldName
@@ -64,13 +64,12 @@ class ProjectRenameChange extends AbstractLaunchConfigChange {
* @param newName
* the new project name
*/
- public ProjectRenameChange(ILaunchConfiguration launchConfig,
- String oldName, String newName) {
+ public ProjectRenameChange(ILaunchConfiguration launchConfig, String oldName, String newName) {
super(launchConfig);
this.oldName = oldName;
this.newName = newName;
-
+
// keep the project relative path if launch config is contained in the old project
if (!launchConfig.isLocal()) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
@@ -78,15 +77,14 @@ class ProjectRenameChange extends AbstractLaunchConfigChange {
IPath oldConfig = launchConfig.getFile().getLocation();
if (oldConfig != null && oldProject.getLocation().isPrefixOf(oldConfig)) {
projectRelativePath = oldConfig.makeRelativeTo(oldProject.getLocation());
- }
- }
+ }
+ }
}
@Override
public String getName() {
if (changeName == null) {
- changeName = NLS.bind(LaunchMessages.ProjectRenameChange_name,
- getLaunchConfiguration().getName());
+ changeName = NLS.bind(LaunchMessages.ProjectRenameChange_name, getLaunchConfiguration().getName());
}
return changeName;
@@ -100,14 +98,14 @@ class ProjectRenameChange extends AbstractLaunchConfigChange {
IProject newProject = root.getProject(newName);
ILaunchConfiguration launchConfig = getLaunchConfiguration();
- if (projectRelativePath != null) {
+ if (projectRelativePath != null) {
// If the launch config is non-local and lives in the project, we
// need to update its representation in the new project folder, not
// the old one
ILaunchManager mgr = DebugPlugin.getDefault().getLaunchManager();
launchConfig = mgr.getLaunchConfiguration(newProject.getFile(projectRelativePath));
}
-
+
ILaunchConfigurationWorkingCopy copy = launchConfig.getWorkingCopy();
IResource[] mapped = launchConfig.getMappedResources();
@@ -123,19 +121,18 @@ class ProjectRenameChange extends AbstractLaunchConfigChange {
}
}
- copy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME,
- newName);
+ copy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, newName);
// Update the program name if it corresponds to the project name
- IPath pathProgName = new Path(launchConfig.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "")); //$NON-NLS-1$
+ IPath pathProgName = new Path(
+ launchConfig.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, "")); //$NON-NLS-1$
String progExtension = pathProgName.getFileExtension();
String progName = pathProgName.removeFileExtension().lastSegment();
if (oldName.equals(progName)) {
pathProgName = pathProgName.removeLastSegments(1).append(newName);
- if (progExtension != null )
+ if (progExtension != null)
pathProgName = pathProgName.addFileExtension(progExtension);
- copy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME,
- pathProgName.toOSString());
+ copy.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, pathProgName.toOSString());
}
try {
@@ -145,15 +142,12 @@ class ProjectRenameChange extends AbstractLaunchConfigChange {
// This comment can/should be removed when 288368 is fixed.
copy.doSave();
} catch (CoreException e) {
- LaunchUIPlugin.log(new MultiStatus(LaunchUIPlugin.PLUGIN_ID, 0,
- new IStatus[] { e.getStatus() }, NLS.bind(
- LaunchMessages.ProjectRenameChange_saveFailed,
- launchConfig.getName()), null));
+ LaunchUIPlugin.log(new MultiStatus(LaunchUIPlugin.PLUGIN_ID, 0, new IStatus[] { e.getStatus() },
+ NLS.bind(LaunchMessages.ProjectRenameChange_saveFailed, launchConfig.getName()), null));
return null; // not undoable, as we didn't effect our change
}
- return new ProjectRenameChange(launchConfig, newName,
- oldName);
+ return new ProjectRenameChange(launchConfig, newName, oldName);
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/ResourceRenameParticipant.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/ResourceRenameParticipant.java
index 204dc8aa48..c7ada915b8 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/ResourceRenameParticipant.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/refactoring/ResourceRenameParticipant.java
@@ -39,9 +39,9 @@ import org.eclipse.ltk.core.refactoring.participants.RenameParticipant;
/**
* A rename participant for resource refactorings, that updates affected CDT
* launch configurations.
- *
+ *
* @author Christian W. Damus (cdamus)
- *
+ *
* @since 6.0
*/
public class ResourceRenameParticipant extends RenameParticipant implements IExecutableExtension {
@@ -85,8 +85,8 @@ public class ResourceRenameParticipant extends RenameParticipant implements IExe
for (ILaunchConfiguration next : launches) {
if (next.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, "").equals(oldName)) { //$NON-NLS-1$
- result = AbstractLaunchConfigChange.append(
- result, new ProjectRenameChange(next, oldName, newName));
+ result = AbstractLaunchConfigChange.append(result,
+ new ProjectRenameChange(next, oldName, newName));
}
}
}
@@ -102,12 +102,12 @@ public class ResourceRenameParticipant extends RenameParticipant implements IExe
// Get launch config types registered by CDT adopters
Set<String> thirdPartyConfgTypeIds = new HashSet<>(5);
LaunchConfigAffinityExtensionPoint.getLaunchConfigTypeIds(thirdPartyConfgTypeIds);
-
+
ILaunchManager mgr = DebugPlugin.getDefault().getLaunchManager();
for (ILaunchConfigurationType next : mgr.getLaunchConfigurationTypes()) {
// is it a CDT launch type or a third party one that is CDT-ish?
- if (next.getPluginIdentifier().startsWith("org.eclipse.cdt.") || //$NON-NLS-1$
- thirdPartyConfgTypeIds.contains(next.getIdentifier())) {
+ if (next.getPluginIdentifier().startsWith("org.eclipse.cdt.") || //$NON-NLS-1$
+ thirdPartyConfgTypeIds.contains(next.getIdentifier())) {
result.add(next);
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/BuildErrPrompter.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/BuildErrPrompter.java
index 1acbc5dcc2..a42ace1bf7 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/BuildErrPrompter.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/BuildErrPrompter.java
@@ -63,7 +63,7 @@ public class BuildErrPrompter implements IStatusHandler {
* if it was the active one. This argument should be non-empty ONLY if a
* not-active configuration was built.
* <ul>
- *
+ *
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus,
* java.lang.Object)
*/
@@ -75,82 +75,67 @@ public class BuildErrPrompter implements IStatusHandler {
return Boolean.TRUE;
}
- Object[] args = (Object[])source;
- if (args.length != 3 ||
- !(args[0] instanceof ILaunchConfiguration) ||
- !(args[1] instanceof String) ||
- !(args[2] instanceof String)) {
+ Object[] args = (Object[]) source;
+ if (args.length != 3 || !(args[0] instanceof ILaunchConfiguration) || !(args[1] instanceof String)
+ || !(args[2] instanceof String)) {
assert false : "status handler not given expected arguments"; //$NON-NLS-1$
return Boolean.TRUE;
}
- final ILaunchConfiguration launchConfig = (ILaunchConfiguration)args[0];
- final String projectName = (String)args[1];
- final String buildConfigName = (String)args[2];
+ final ILaunchConfiguration launchConfig = (ILaunchConfiguration) args[0];
+ final String projectName = (String) args[1];
+ final String buildConfigName = (String) args[2];
// The platform does this check; we should, too
if (DebugUITools.isPrivate(launchConfig)) {
return Boolean.TRUE;
}
-
+
Shell shell = DebugUIPlugin.getShell();
- String title = LaunchConfigurationsMessages.CompileErrorPromptStatusHandler_0;
+ String title = LaunchConfigurationsMessages.CompileErrorPromptStatusHandler_0;
String message;
if (status.getCode() == STATUS_CODE_ERR_IN_MAIN_PROJ) {
if (buildConfigName.length() > 0) {
- message = MessageFormat.format(
- LaunchMessages.BuildErrPrompter_error_in_specific_config, projectName, buildConfigName);
- }
- else {
- message = MessageFormat.format(
- LaunchMessages.BuildErrPrompter_error_in_active_config, projectName);
+ message = MessageFormat.format(LaunchMessages.BuildErrPrompter_error_in_specific_config, projectName,
+ buildConfigName);
+ } else {
+ message = MessageFormat.format(LaunchMessages.BuildErrPrompter_error_in_active_config, projectName);
}
- }
- else if (status.getCode() == STATUS_CODE_ERR_IN_REFERENCED_PROJS) {
+ } else if (status.getCode() == STATUS_CODE_ERR_IN_REFERENCED_PROJS) {
if (buildConfigName.length() > 0) {
- message = MessageFormat.format(
- LaunchMessages.BuildErrPrompter_error_in_referenced_project_specific,
- projectName, buildConfigName);
+ message = MessageFormat.format(LaunchMessages.BuildErrPrompter_error_in_referenced_project_specific,
+ projectName, buildConfigName);
+ } else {
+ message = MessageFormat.format(LaunchMessages.BuildErrPrompter_error_in_referenced_project_active,
+ projectName);
}
- else {
- message = MessageFormat.format(
- LaunchMessages.BuildErrPrompter_error_in_referenced_project_active,
- projectName);
- }
- }
- else {
+ } else {
assert false : "this prompter was called for an unexpected status"; //$NON-NLS-1$
return Boolean.TRUE;
}
-
+
// The rest is monkey-see, monkey-do (copied from
// CompileErrorProjectPromptStatusHandler)
-
- IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
+
+ IPreferenceStore store = DebugUIPlugin.getDefault().getPreferenceStore();
String pref = store.getString(IInternalDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR);
if (pref != null) {
if (pref.equals(MessageDialogWithToggle.ALWAYS)) {
return Boolean.TRUE;
}
}
- MessageDialogWithToggle dialog = new MessageDialogWithToggle(shell,
- title,
- null,
- message,
- MessageDialog.QUESTION,
- new String[] {IDialogConstants.PROCEED_LABEL, IDialogConstants.CANCEL_LABEL},
- 0,
- LaunchConfigurationsMessages.CompileErrorProjectPromptStatusHandler_1,
- false);
- int open = dialog.open();
+ MessageDialogWithToggle dialog = new MessageDialogWithToggle(shell, title, null, message,
+ MessageDialog.QUESTION, new String[] { IDialogConstants.PROCEED_LABEL, IDialogConstants.CANCEL_LABEL },
+ 0, LaunchConfigurationsMessages.CompileErrorProjectPromptStatusHandler_1, false);
+ int open = dialog.open();
if (open == IDialogConstants.PROCEED_ID) {
- if(dialog.getToggleState()) {
- store.setValue(IInternalDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR, MessageDialogWithToggle.ALWAYS);
- }
- return Boolean.TRUE;
- }
- else {
- return Boolean.FALSE;
- }
+ if (dialog.getToggleState()) {
+ store.setValue(IInternalDebugUIConstants.PREF_CONTINUE_WITH_COMPILE_ERROR,
+ MessageDialogWithToggle.ALWAYS);
+ }
+ return Boolean.TRUE;
+ } else {
+ return Boolean.FALSE;
+ }
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java
index 7e673f0bc9..53f7c0c529 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchImages.java
@@ -22,17 +22,17 @@ import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
public class LaunchImages {
- private static final String NAME_PREFIX= LaunchUIPlugin.PLUGIN_ID + '.';
- private static final int NAME_PREFIX_LENGTH= NAME_PREFIX.length();
-
+ private static final String NAME_PREFIX = LaunchUIPlugin.PLUGIN_ID + '.';
+ private static final int NAME_PREFIX_LENGTH = NAME_PREFIX.length();
+
// The plugin registry
private static ImageRegistry imageRegistry = new ImageRegistry();
// Subdirectory (under the package containing this class) where 16 color images are
private static URL fgIconBaseURL;
static {
- fgIconBaseURL= Platform.getBundle(LaunchUIPlugin.getUniqueIdentifier()).getEntry("/icons/"); //$NON-NLS-1$
- }
+ fgIconBaseURL = Platform.getBundle(LaunchUIPlugin.getUniqueIdentifier()).getEntry("/icons/"); //$NON-NLS-1$
+ }
private static final String T_TABS = "view16/"; //$NON-NLS-1$
private static final String T_OBJS = "obj16/"; //$NON-NLS-1$
@@ -44,36 +44,36 @@ public class LaunchImages {
public static String IMG_VIEW_SOURCE_TAB = NAME_PREFIX + "source_tab.gif"; //$NON-NLS-1$
public static String IMG_VIEW_CORE_BUILD_TAB = NAME_PREFIX + "core_build_tab.png"; //$NON-NLS-1$
- public static final ImageDescriptor DESC_TAB_MAIN= createManaged(T_TABS, IMG_VIEW_MAIN_TAB);
+ public static final ImageDescriptor DESC_TAB_MAIN = createManaged(T_TABS, IMG_VIEW_MAIN_TAB);
public static final ImageDescriptor DESC_TAB_ARGUMENTS = createManaged(T_TABS, IMG_VIEW_ARGUMENTS_TAB);
public static final ImageDescriptor DESC_TAB_ENVIRONMENT = createManaged(T_TABS, IMG_VIEW_ENVIRONMENT_TAB);
public static final ImageDescriptor DESC_TAB_DEBUGGER = createManaged(T_TABS, IMG_VIEW_DEBUGGER_TAB);
public static final ImageDescriptor DESC_TAB_SOURCE = createManaged(T_TABS, IMG_VIEW_SOURCE_TAB);
public static final ImageDescriptor DESC_TAB_CORE_BUILD = createManaged(T_TABS, IMG_VIEW_CORE_BUILD_TAB);
- public static String IMG_OBJS_EXEC= NAME_PREFIX + "exec_obj.gif"; //$NON-NLS-1$
+ public static String IMG_OBJS_EXEC = NAME_PREFIX + "exec_obj.gif"; //$NON-NLS-1$
public static final ImageDescriptor DESC_OBJS_EXEC = createManaged(T_OBJS, IMG_OBJS_EXEC);
public static void initialize() {
}
-
+
private static ImageDescriptor createManaged(String prefix, String name) {
return createManaged(imageRegistry, prefix, name);
}
-
+
private static ImageDescriptor createManaged(ImageRegistry registry, String prefix, String name) {
- ImageDescriptor result= ImageDescriptor.createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH)));
+ ImageDescriptor result = ImageDescriptor
+ .createFromURL(makeIconFileURL(prefix, name.substring(NAME_PREFIX_LENGTH)));
registry.put(name, result);
return result;
}
-
+
public static Image get(String key) {
return imageRegistry.get(key);
}
-
private static URL makeIconFileURL(String prefix, String name) {
- StringBuilder buffer= new StringBuilder(prefix);
+ StringBuilder buffer = new StringBuilder(prefix);
buffer.append(name);
try {
return new URL(fgIconBaseURL, buffer.toString());
@@ -82,7 +82,7 @@ public class LaunchImages {
return null;
}
}
-
+
/**
* Helper method to access the image registry from the JavaPlugin class.
*/
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.java
index 774c38a0e2..4d5877cf87 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchMessages.java
@@ -206,18 +206,19 @@ public class LaunchMessages extends NLS {
public static String BuildErrPrompter_error_in_referenced_project_active;
public static String CMainTab2_File_does_not_exist;
public static String CMainTab2_CoreFile_type;
- public static String CMainTab2_TraceFile_type;
+ public static String CMainTab2_TraceFile_type;
public static String CMainTab2_CoreFile_path;
- public static String CMainTab2_TraceFile_path;
+ public static String CMainTab2_TraceFile_path;
public static String CMainTab2_Application_Selection;
public static String CMainTab2_Core_Selection;
public static String CMainTab2_Trace_Selection;
public static String CMainTab2_Post_mortem_file_type;
+
private LaunchMessages() {
}
static {
- // Load message values from bundle file
- NLS.initializeMessages(LaunchMessages.class.getCanonicalName(), LaunchMessages.class);
- }
+ // Load message values from bundle file
+ NLS.initializeMessages(LaunchMessages.class.getCanonicalName(), LaunchMessages.class);
+ }
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
index 969a650a4a..e0763d0be7 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/LaunchUIPlugin.java
@@ -42,7 +42,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
/**
* Constructor for LaunchUIPlugin.
- *
+ *
* @param descriptor
*/
public LaunchUIPlugin() {
@@ -52,7 +52,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
/**
* Sets the Java Debug UI plug-in instance
- *
+ *
* @param plugin
* the plugin instance
*/
@@ -62,7 +62,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
/**
* Returns the Java Debug UI plug-in instance
- *
+ *
* @return the Java Debug UI plug-in instance
*/
public static LaunchUIPlugin getDefault() {
@@ -101,16 +101,17 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
/**
* Logs the specified status with this plug-in's log.
- *
+ *
* @param status
* status to log
*/
public static void log(IStatus status) {
getDefault().getLog().log(status);
}
+
/**
* Logs an internal error with the specified message.
- *
+ *
* @param message
* the error message to log
*/
@@ -120,7 +121,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
/**
* Logs an internal error with the specified throwable
- *
+ *
* @param e
* the exception to be logged
*/
@@ -130,7 +131,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
/**
* Returns the active workbench window
- *
+ *
* @return the active workbench window
*/
public static IWorkbenchWindow getActiveWorkbenchWindow() {
@@ -147,7 +148,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
/**
* Returns the active workbench shell or <code>null</code> if none
- *
+ *
* @return the active workbench shell or <code>null</code> if none
*/
public static Shell getActiveWorkbenchShell() {
@@ -162,7 +163,7 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
log(status);
Shell shell = getActiveWorkbenchShell();
if (shell != null) {
- ErrorDialog.openError(shell, LaunchMessages.LaunchUIPlugin_Error, message, status);
+ ErrorDialog.openError(shell, LaunchMessages.LaunchUIPlugin_Error, message, status);
}
}
@@ -171,17 +172,17 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
Shell shell = getActiveWorkbenchShell();
if (shell != null) {
IStatus status = new Status(IStatus.ERROR, getUniqueIdentifier(), 1, t.getMessage(), null);
- ErrorDialog.openError(shell, LaunchMessages.LaunchUIPlugin_Error, message, status);
+ ErrorDialog.openError(shell, LaunchMessages.LaunchUIPlugin_Error, message, status);
}
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
- public void start(BundleContext context) throws Exception {
+ public void start(BundleContext context) throws Exception {
super.start(context);
LaunchUIPlugin.getDefault().getPluginPreferences().getString(ICDebugConstants.PREF_FILTERED_DEBUGGERS);
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
@@ -189,47 +190,47 @@ public class LaunchUIPlugin extends AbstractUIPlugin implements ILaunchesListene
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
- public void stop(BundleContext context) throws Exception {
- DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
+ public void stop(BundleContext context) throws Exception {
+ DebugPlugin.getDefault().getLaunchManager().removeLaunchListener(this);
super.stop(context);
}
/* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
- */
- @Override
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesAdded(org.eclipse.debug.core.ILaunch[])
+ */
+ @Override
public void launchesAdded(ILaunch[] launches) {
- }
+ }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
- */
- @Override
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesChanged(org.eclipse.debug.core.ILaunch[])
+ */
+ @Override
public void launchesChanged(ILaunch[] launches) {
- }
+ }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
- */
- @Override
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener#launchesRemoved(org.eclipse.debug.core.ILaunch[])
+ */
+ @Override
public void launchesRemoved(ILaunch[] launches) {
- }
+ }
- /* (non-Javadoc)
- * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
- */
- @Override
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.core.ILaunchesListener2#launchesTerminated(org.eclipse.debug.core.ILaunch[])
+ */
+ @Override
public void launchesTerminated(ILaunch[] launches) {
- for (ILaunch l : launches) {
- if (l instanceof CLaunch) {
- ((CLaunch)l).refresh();
- }
- }
- }
+ for (ILaunch l : launches) {
+ if (l instanceof CLaunch) {
+ ((CLaunch) l).refresh();
+ }
+ }
+ }
public static <T> T getService(Class<T> service) {
BundleContext context = fgPlugin.getBundle().getBundleContext();
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java
index 53e8c08f54..c7c4fe502c 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationSelectionDialog.java
@@ -7,14 +7,13 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* QNX Software Systems - initial API and implementation
* Freescale Semiconductor
*******************************************************************************/
package org.eclipse.cdt.launch.internal.ui;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -63,8 +62,6 @@ import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.dialogs.FilteredTree;
import org.eclipse.ui.dialogs.PatternFilter;
-
-
/**
* Dialog to select launch configuration(s)
* @deprecated See Bug 517722, Launch Groups are now part of Platform.
@@ -84,7 +81,7 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
private Label fDelayAmountLabel;
private Text fDelayAmountWidget; // in seconds
private boolean fForEditing; // true if dialog was opened to edit an entry, otherwise it was opened to add one
-
+
public MultiLaunchConfigurationSelectionDialog(Shell shell, String initMode, boolean forEditing) {
super(shell);
LaunchConfigurationManager manager = DebugUIPlugin.getDefault().getLaunchConfigurationManager();
@@ -126,17 +123,15 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
@Override
protected Control createDialogArea(Composite parent2) {
Composite comp = (Composite) super.createDialogArea(parent2);
-
- // title bar
- getShell().setText(fForEditing ?
- LaunchMessages.MultiLaunchConfigurationSelectionDialog_13 :
- LaunchMessages.MultiLaunchConfigurationSelectionDialog_12);
-
+
+ // title bar
+ getShell().setText(fForEditing ? LaunchMessages.MultiLaunchConfigurationSelectionDialog_13
+ : LaunchMessages.MultiLaunchConfigurationSelectionDialog_12);
+
// dialog message area (not title bar)
- setTitle(fForEditing ?
- LaunchMessages.MultiLaunchConfigurationSelectionDialog_15 :
- LaunchMessages.MultiLaunchConfigurationSelectionDialog_14);
-
+ setTitle(fForEditing ? LaunchMessages.MultiLaunchConfigurationSelectionDialog_15
+ : LaunchMessages.MultiLaunchConfigurationSelectionDialog_14);
+
fStackComposite = new ComboControlledStackComposite(comp, SWT.NONE);
HashMap<String, ILaunchGroup> modes = new HashMap<String, ILaunchGroup>();
for (ILaunchGroup launchGroup : launchGroups) {
@@ -160,12 +155,13 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
}
} catch (Exception e) {
}
- }
+ }
for (Iterator<String> iterator = modes.keySet().iterator(); iterator.hasNext();) {
String mode = iterator.next();
ILaunchGroup launchGroup = modes.get(mode);
- LaunchConfigurationFilteredTree fTree = new LaunchConfigurationFilteredTree(fStackComposite.getStackParent(), SWT.MULTI
- | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, new PatternFilter(), launchGroup, fFilters);
+ LaunchConfigurationFilteredTree fTree = new LaunchConfigurationFilteredTree(
+ fStackComposite.getStackParent(), SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER,
+ new PatternFilter(), launchGroup, fFilters);
String label = mode;
fStackComposite.addItem(label, fTree);
fTree.createViewControl();
@@ -180,12 +176,12 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
if (launchGroup.getMode().equals(this.mode)) {
fStackComposite.setSelection(label);
}
- if (fInitialSelection!=null) {
-
+ if (fInitialSelection != null) {
+
fTree.getViewer().setSelection(fInitialSelection, true);
}
}
- fStackComposite.setLabelText(LaunchMessages.MultiLaunchConfigurationSelectionDialog_4);
+ fStackComposite.setLabelText(LaunchMessages.MultiLaunchConfigurationSelectionDialog_4);
fStackComposite.pack();
Rectangle bounds = fStackComposite.getBounds();
// adjust size
@@ -207,7 +203,7 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
checkboxComp.setLayout(new GridLayout(1, false));
checkboxComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Button checkBox = new Button(checkboxComp, SWT.CHECK);
- checkBox.setText(LaunchMessages.MultiLaunchConfigurationSelectionDialog_5);
+ checkBox.setText(LaunchMessages.MultiLaunchConfigurationSelectionDialog_5);
checkBox.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
@@ -215,7 +211,7 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
}
});
checkBox.setSelection(isDefaultMode);
-
+
createPostLaunchControl(comp);
return comp;
}
@@ -225,7 +221,7 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
comp.setLayout(new GridLayout(4, false));
comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label label = new Label(comp, SWT.NONE);
- label.setText(LaunchMessages.MultiLaunchConfigurationSelectionDialog_8);
+ label.setText(LaunchMessages.MultiLaunchConfigurationSelectionDialog_8);
Combo combo = new Combo(comp, SWT.READ_ONLY);
combo.add(LaunchElement.actionEnumToStr(EPostLaunchAction.NONE));
combo.add(LaunchElement.actionEnumToStr(EPostLaunchAction.WAIT_FOR_TERMINATION));
@@ -240,31 +236,30 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
}
});
combo.setText(MultiLaunchConfigurationDelegate.LaunchElement.actionEnumToStr(action));
-
+
fDelayAmountLabel = new Label(comp, SWT.NONE);
- fDelayAmountLabel.setText(LaunchMessages.MultiLaunchConfigurationSelectionDialog_9);
-
+ fDelayAmountLabel.setText(LaunchMessages.MultiLaunchConfigurationSelectionDialog_9);
+
fDelayAmountWidget = new Text(comp, SWT.SINGLE | SWT.BORDER);
GridData gridData = new GridData();
gridData.widthHint = convertWidthInCharsToPixels(8);
fDelayAmountWidget.setLayoutData(gridData);
- fDelayAmountWidget.addModifyListener(new ModifyListener(){
+ fDelayAmountWidget.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
- String text = ((Text)e.widget).getText();
+ String text = ((Text) e.widget).getText();
try {
actionParam = Integer.valueOf(text);
- }
- catch (NumberFormatException exc) {
+ } catch (NumberFormatException exc) {
actionParam = null;
}
validate();
}
});
if (actionParam instanceof Integer) {
- fDelayAmountWidget.setText(((Integer)actionParam).toString());
+ fDelayAmountWidget.setText(((Integer) actionParam).toString());
}
-
+
showHideDelayAmountWidgets();
}
@@ -275,12 +270,12 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
}
public ILaunchConfiguration[] getSelectedLaunchConfigurations() {
- List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();
+ List<ILaunchConfiguration> configs = new ArrayList<ILaunchConfiguration>();
if (fSelection != null && !fSelection.isEmpty()) {
- for (Iterator<?> iter = ((IStructuredSelection)fSelection).iterator(); iter.hasNext();) {
+ for (Iterator<?> iter = ((IStructuredSelection) fSelection).iterator(); iter.hasNext();) {
Object selection = iter.next();
if (selection instanceof ILaunchConfiguration) {
- configs.add((ILaunchConfiguration)selection);
+ configs.add((ILaunchConfiguration) selection);
}
}
}
@@ -290,16 +285,17 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
public String getMode() {
return isDefaultMode ? MultiLaunchConfigurationDelegate.DEFAULT_MODE : mode;
}
-
- public EPostLaunchAction getAction(){
+
+ public EPostLaunchAction getAction() {
return action;
}
- public Object getActionParam(){
+ public Object getActionParam() {
return actionParam;
}
- public static MultiLaunchConfigurationSelectionDialog createDialog(Shell shell, String groupId, boolean forEditing) {
+ public static MultiLaunchConfigurationSelectionDialog createDialog(Shell shell, String groupId,
+ boolean forEditing) {
return new MultiLaunchConfigurationSelectionDialog(shell, groupId, forEditing);
}
@@ -308,7 +304,7 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
*/
@Override
public void selectionChanged(SelectionChangedEvent event) {
-
+
// This listener gets called for a selection change in the launch
// configuration viewer embedded in the dialog. Problem is, there are
// numerous viewers--one for each platform debug ILaunchGroup (run,
@@ -316,11 +312,11 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
// visible to the user. During initialization, we get a selection change
// notification for every viewer. We need to ignore all but the one that
// matters--the visible one.
-
+
Tree topTree = null;
final Control topControl = fStackComposite.getTopControl();
if (topControl instanceof FilteredTree) {
- final TreeViewer viewer = ((FilteredTree)topControl).getViewer();
+ final TreeViewer viewer = ((FilteredTree) topControl).getViewer();
if (viewer != null) {
topTree = viewer.getTree();
}
@@ -328,20 +324,20 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
if (topTree == null) {
return;
}
-
+
boolean selectionIsForVisibleViewer = false;
final Object src = event.getSource();
if (src instanceof Viewer) {
- final Control viewerControl = ((Viewer)src).getControl();
+ final Control viewerControl = ((Viewer) src).getControl();
if (viewerControl == topTree) {
selectionIsForVisibleViewer = true;
}
}
-
+
if (!selectionIsForVisibleViewer) {
return;
}
-
+
fSelection = event.getSelection();
validate();
}
@@ -350,17 +346,17 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
Button ok_button = getButton(IDialogConstants.OK_ID);
boolean isValid = true;
if (getSelectedLaunchConfigurations().length < 1) {
- setErrorMessage(LaunchMessages.MultiLaunchConfigurationSelectionDialog_7);
+ setErrorMessage(LaunchMessages.MultiLaunchConfigurationSelectionDialog_7);
isValid = false;
} else {
setErrorMessage(null);
}
-
+
if (isValid) {
if (fForEditing) {
// must have only one selection
if (getSelectedLaunchConfigurations().length > 1) {
- setErrorMessage(LaunchMessages.MultiLaunchConfigurationSelectionDialog_11);
+ setErrorMessage(LaunchMessages.MultiLaunchConfigurationSelectionDialog_11);
isValid = false;
}
}
@@ -368,12 +364,12 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
if (isValid) {
if (action == EPostLaunchAction.DELAY) {
- isValid = (actionParam instanceof Integer) && ((Integer)actionParam > 0);
- setErrorMessage(isValid ? null : LaunchMessages.MultiLaunchConfigurationSelectionDialog_10);
+ isValid = (actionParam instanceof Integer) && ((Integer) actionParam > 0);
+ setErrorMessage(isValid ? null : LaunchMessages.MultiLaunchConfigurationSelectionDialog_10);
}
}
-
- if (ok_button != null)
+
+ if (ok_button != null)
ok_button.setEnabled(isValid);
}
@@ -381,7 +377,7 @@ public class MultiLaunchConfigurationSelectionDialog extends TitleAreaDialog imp
action = el.action;
actionParam = el.actionParam;
isDefaultMode = el.mode.equals(MultiLaunchConfigurationDelegate.DEFAULT_MODE);
- fInitialSelection = new StructuredSelection(el.data);
- fSelection = fInitialSelection;
- }
+ fInitialSelection = new StructuredSelection(el.data);
+ fSelection = fInitialSelection;
+ }
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java
index 9ed0df33dd..62404d4391 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/MultiLaunchConfigurationTabGroup.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* QNX Software Systems - initial API and implementation
* Freescale Semiconductor
@@ -101,6 +101,7 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
return (element == input) ? (input.size() > 0) : false;
}
}
+
static class LabelProvider extends BaseLabelProvider implements ITableLabelProvider {
@Override
public Image getColumnImage(Object element, int columnIndex) {
@@ -109,17 +110,19 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
if (columnIndex == 0) {
MultiLaunchConfigurationDelegate.LaunchElement el = (MultiLaunchConfigurationDelegate.LaunchElement) element;
if (el.data == null || !MultiLaunchConfigurationDelegate.isValidLaunchReference(el.data)) {
- Image errorImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ Image errorImage = PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
return errorImage;
}
-
+
try {
- String key = el.data.getType().getIdentifier();
- return DebugPluginImages.getImage(key);
- } catch (CoreException e) {
- Image errorImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
+ String key = el.data.getType().getIdentifier();
+ return DebugPluginImages.getImage(key);
+ } catch (CoreException e) {
+ Image errorImage = PlatformUI.getWorkbench().getSharedImages()
+ .getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
return errorImage;
- }
+ }
}
return null;
}
@@ -129,7 +132,7 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
if (!(element instanceof MultiLaunchConfigurationDelegate.LaunchElement))
return null;
MultiLaunchConfigurationDelegate.LaunchElement el = (MultiLaunchConfigurationDelegate.LaunchElement) element;
-
+
// launch name
if (columnIndex == 0) {
try {
@@ -139,10 +142,10 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
}
}
- // launch mode
+ // launch mode
if (columnIndex == 1)
return el.mode;
-
+
// launch post action
if (columnIndex == 2) {
EPostLaunchAction action = el.action;
@@ -163,7 +166,7 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
return null;
}
}
-
+
static class CheckStateProvider implements ICheckStateProvider {
/* (non-Javadoc)
@@ -172,7 +175,7 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
@Override
public boolean isChecked(Object element) {
if (element instanceof LaunchElement) {
- return ((LaunchElement)element).enabled;
+ return ((LaunchElement) element).enabled;
}
return false;
}
@@ -185,6 +188,7 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
return false;
}
}
+
static abstract class ButtonComposite extends Composite implements SelectionListener {
Button upButton;
Button downButton;
@@ -195,20 +199,21 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
public ButtonComposite(Composite parent, int style) {
super(parent, style);
setLayout(new GridLayout());
- upButton = createPushButton(this, LaunchMessages.MultiLaunchConfigurationTabGroup_1);
- downButton = createPushButton(this, LaunchMessages.MultiLaunchConfigurationTabGroup_2);
- editButton = createPushButton(this, LaunchMessages.MultiLaunchConfigurationTabGroup_3);
- addButton = createPushButton(this, LaunchMessages.MultiLaunchConfigurationTabGroup_4);
- deleteButton = createPushButton(this, LaunchMessages.MultiLaunchConfigurationTabGroup_5);
-
+ upButton = createPushButton(this, LaunchMessages.MultiLaunchConfigurationTabGroup_1);
+ downButton = createPushButton(this, LaunchMessages.MultiLaunchConfigurationTabGroup_2);
+ editButton = createPushButton(this, LaunchMessages.MultiLaunchConfigurationTabGroup_3);
+ addButton = createPushButton(this, LaunchMessages.MultiLaunchConfigurationTabGroup_4);
+ deleteButton = createPushButton(this, LaunchMessages.MultiLaunchConfigurationTabGroup_5);
+
}
- protected void updateWidgetEnablement(){
-
+ protected void updateWidgetEnablement() {
+
}
+
/**
* Helper method to create a push button.
- *
+ *
* @param parent
* the parent control
* @param key
@@ -249,21 +254,22 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
protected abstract void addPressed();
protected abstract void editPressed();
-
+
protected abstract void deletePressed();
protected abstract void downPressed();
protected abstract void upPressed();
}
+
static class GroupLaunchTab extends AbstractLaunchConfigurationTab {
protected CheckboxTreeViewer treeViewer;
protected List<LaunchElement> input = new ArrayList<LaunchElement>();
private String mode;
public GroupLaunchTab(String mode) {
- this.mode = mode;
- }
+ this.mode = mode;
+ }
@Override
public void createControl(Composite parent) {
@@ -280,25 +286,24 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
table.setHeaderVisible(true);
table.setLayoutData(new GridData(GridData.FILL_BOTH));
TreeColumn col1 = new TreeColumn(table, SWT.NONE);
- col1.setText(LaunchMessages.MultiLaunchConfigurationTabGroup_6);
+ col1.setText(LaunchMessages.MultiLaunchConfigurationTabGroup_6);
col1.setWidth(300);
TreeColumn col2 = new TreeColumn(table, SWT.NONE);
- col2.setText(LaunchMessages.MultiLaunchConfigurationTabGroup_7);
+ col2.setText(LaunchMessages.MultiLaunchConfigurationTabGroup_7);
col2.setWidth(100);
TreeColumn col3 = new TreeColumn(table, SWT.NONE);
- col3.setText(LaunchMessages.MultiLaunchConfigurationTabGroup_12);
+ col3.setText(LaunchMessages.MultiLaunchConfigurationTabGroup_12);
col3.setWidth(100);
-
+
treeViewer.setInput(input);
final ButtonComposite buts = new ButtonComposite(comp, SWT.NONE) {
@Override
protected void addPressed() {
- MultiLaunchConfigurationSelectionDialog dialog =
- MultiLaunchConfigurationSelectionDialog.createDialog(
- treeViewer.getControl().getShell(), mode, false);
+ MultiLaunchConfigurationSelectionDialog dialog = MultiLaunchConfigurationSelectionDialog
+ .createDialog(treeViewer.getControl().getShell(), mode, false);
if (dialog.open() == Dialog.OK) {
ILaunchConfiguration[] configs = dialog.getSelectedLaunchConfigurations();
- if (configs.length < 1)
+ if (configs.length < 1)
return;
for (ILaunchConfiguration config : configs) {
MultiLaunchConfigurationDelegate.LaunchElement el = new MultiLaunchConfigurationDelegate.LaunchElement();
@@ -317,8 +322,9 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
updateLaunchConfigurationDialog();
}
}
+
@Override
- protected void updateWidgetEnablement(){
+ protected void updateWidgetEnablement() {
downButton.setEnabled(isDownEnabled());
upButton.setEnabled(isUpEnabled());
@@ -326,7 +332,6 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
editButton.setEnabled(selectionCount == 1);
deleteButton.setEnabled(selectionCount > 0);
}
-
@Override
protected void editPressed() {
@@ -334,15 +339,14 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
if (index < 0)
return;
MultiLaunchConfigurationDelegate.LaunchElement el = input.get(index);
- MultiLaunchConfigurationSelectionDialog dialog =
- MultiLaunchConfigurationSelectionDialog.createDialog(
- treeViewer.getControl().getShell(), el.mode, true);
+ MultiLaunchConfigurationSelectionDialog dialog = MultiLaunchConfigurationSelectionDialog
+ .createDialog(treeViewer.getControl().getShell(), el.mode, true);
if (MultiLaunchConfigurationDelegate.isValidLaunchReference(el.data)) {
dialog.setInitialSelection(el);
}
if (dialog.open() == Dialog.OK) {
ILaunchConfiguration[] confs = dialog.getSelectedLaunchConfigurations();
- if (confs.length < 0)
+ if (confs.length < 0)
return;
assert confs.length == 1 : "invocation of the dialog for editing an entry sholdn't allow OK to be hit if the user chooses multiple launch configs in the dialog"; //$NON-NLS-1$
el.name = confs[0].getName();
@@ -355,6 +359,7 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
updateLaunchConfigurationDialog();
}
}
+
@Override
protected void deletePressed() {
int[] indices = getMultiSelectionIndices();
@@ -379,7 +384,7 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
if (sel.size() != 1)
return -1;
MultiLaunchConfigurationDelegate.LaunchElement el = ((MultiLaunchConfigurationDelegate.LaunchElement) sel
- .getFirstElement());
+ .getFirstElement());
return input.indexOf(el);
}
@@ -390,11 +395,12 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
private int[] getMultiSelectionIndices() {
StructuredSelection sel = (StructuredSelection) treeViewer.getSelection();
List<Integer> indices = new ArrayList<Integer>();
-
- for (Iterator<?> iter = sel.iterator(); iter.hasNext(); ) {
- MultiLaunchConfigurationDelegate.LaunchElement el = (MultiLaunchConfigurationDelegate.LaunchElement)iter.next();
+
+ for (Iterator<?> iter = sel.iterator(); iter.hasNext();) {
+ MultiLaunchConfigurationDelegate.LaunchElement el = (MultiLaunchConfigurationDelegate.LaunchElement) iter
+ .next();
indices.add(input.indexOf(el));
-
+
}
int[] result = new int[indices.size()];
for (int i = 0; i < result.length; i++) {
@@ -404,15 +410,15 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
}
private int getSelectionCount() {
- return ((StructuredSelection)treeViewer.getSelection()).size();
+ return ((StructuredSelection) treeViewer.getSelection()).size();
}
-
@Override
protected void downPressed() {
- if (!isDownEnabled()) return;
+ if (!isDownEnabled())
+ return;
int index = getSingleSelectionIndex();
-
+
MultiLaunchConfigurationDelegate.LaunchElement x = input.get(index);
input.set(index, input.get(index + 1));
input.set(index + 1, x);
@@ -420,19 +426,20 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
updateWidgetEnablement();
updateLaunchConfigurationDialog();
}
-
+
protected boolean isDownEnabled() {
final int index = getSingleSelectionIndex();
- return (index >= 0) && (index != input.size() - 1);
- }
-
- protected boolean isUpEnabled(){
+ return (index >= 0) && (index != input.size() - 1);
+ }
+
+ protected boolean isUpEnabled() {
return getSingleSelectionIndex() > 0;
}
@Override
protected void upPressed() {
- if (!isUpEnabled()) return;
+ if (!isUpEnabled())
+ return;
int index = getSingleSelectionIndex();
MultiLaunchConfigurationDelegate.LaunchElement x = input.get(index);
input.set(index, input.get(index - 1));
@@ -448,18 +455,18 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
buts.updateWidgetEnablement();
}
});
-
- treeViewer.getTree().addSelectionListener(new SelectionAdapter(){
+
+ treeViewer.getTree().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
buts.editPressed();
}
});
-
- treeViewer.addCheckStateListener(new ICheckStateListener(){
+
+ treeViewer.addCheckStateListener(new ICheckStateListener() {
@Override
public void checkStateChanged(CheckStateChangedEvent event) {
- ((LaunchElement)event.getElement()).enabled = event.getChecked();
+ ((LaunchElement) event.getElement()).enabled = event.getChecked();
updateLaunchConfigurationDialog();
}
});
@@ -471,13 +478,14 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
@Override
public String getName() {
- return LaunchMessages.MultiLaunchConfigurationTabGroup_10;
+ return LaunchMessages.MultiLaunchConfigurationTabGroup_10;
}
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
- // replace the input from previously shown launch configurations
- input = MultiLaunchConfigurationDelegate.createLaunchElements(configuration, new ArrayList<LaunchElement>());
+ // replace the input from previously shown launch configurations
+ input = MultiLaunchConfigurationDelegate.createLaunchElements(configuration,
+ new ArrayList<LaunchElement>());
if (treeViewer != null) {
treeViewer.setInput(input);
}
@@ -503,25 +511,25 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
int validLaunches = 0;
// test if each launch is valid
for (LaunchElement element : input) {
- if (element.enabled) {
- if ( element.data == null) {
+ if (element.enabled) {
+ if (element.data == null) {
// error referencing invalid launch
- setErrorMessage(MessageFormat.format(LaunchMessages.MultiLaunchConfigurationTabGroup_14,
- element.name));
+ setErrorMessage(
+ MessageFormat.format(LaunchMessages.MultiLaunchConfigurationTabGroup_14, element.name));
return false;
} else if (!MultiLaunchConfigurationDelegate.isValidLaunchReference(element.data)) {
// error referencing invalid launch
- setErrorMessage(MessageFormat.format(LaunchMessages.MultiLaunchConfigurationTabGroup_15,
- element.name));
+ setErrorMessage(
+ MessageFormat.format(LaunchMessages.MultiLaunchConfigurationTabGroup_15, element.name));
return false;
}
validLaunches++;
- }
+ }
}
if (validLaunches < 1) {
// must have at least one valid and enabled launch
- setErrorMessage(LaunchMessages.MultiLaunchConfigurationTabGroup_16);
- return false;
+ setErrorMessage(LaunchMessages.MultiLaunchConfigurationTabGroup_16);
+ return false;
}
return true;
}
@@ -533,7 +541,7 @@ public class MultiLaunchConfigurationTabGroup extends AbstractLaunchConfiguratio
@Override
public void createTabs(ILaunchConfigurationDialog dialog, String mode) {
- ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] {//
+ ILaunchConfigurationTab[] tabs = new ILaunchConfigurationTab[] { //
new GroupLaunchTab(mode), //
new CommonTabLite() //
};
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/ProcessPrompter.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/ProcessPrompter.java
index 3b8bf58631..bb3dbfe0a6 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/ProcessPrompter.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/ProcessPrompter.java
@@ -35,7 +35,7 @@ public class ProcessPrompter implements IStatusHandler {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.core.IStatusHandler#handleStatus(org.eclipse.core.runtime.IStatus,
* java.lang.Object)
*/
@@ -45,7 +45,7 @@ public class ProcessPrompter implements IStatusHandler {
if (shell == null) {
IStatus error = new Status(IStatus.ERROR, LaunchUIPlugin.getUniqueIdentifier(),
ICDTLaunchConfigurationConstants.ERR_INTERNAL_ERROR,
- LaunchMessages.CoreFileLaunchDelegate_No_Shell_available_in_Launch, null);
+ LaunchMessages.CoreFileLaunchDelegate_No_Shell_available_in_Launch, null);
throw new CoreException(error);
}
@@ -53,18 +53,19 @@ public class ProcessPrompter implements IStatusHandler {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.LabelProvider#getText(java.lang.Object)
*/
@Override
public String getText(Object element) {
- IProcessInfo info = (IProcessInfo)element;
+ IProcessInfo info = (IProcessInfo) element;
IPath path = new Path(info.getName());
return path.lastSegment() + " - " + info.getPid(); //$NON-NLS-1$
}
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
*/
@Override
@@ -76,12 +77,13 @@ public class ProcessPrompter implements IStatusHandler {
@Override
public String getText(Object element) {
- IProcessInfo info = (IProcessInfo)element;
+ IProcessInfo info = (IProcessInfo) element;
return info.getName();
}
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.jface.viewers.LabelProvider#getImage(java.lang.Object)
*/
@Override
@@ -90,23 +92,22 @@ public class ProcessPrompter implements IStatusHandler {
}
};
TwoPaneElementSelector dialog = new TwoPaneElementSelector(shell, provider, qprovider);
- dialog.setTitle(LaunchMessages.LocalAttachLaunchDelegate_Select_Process);
- dialog.setMessage(LaunchMessages.LocalAttachLaunchDelegate_Select_Process_to_attach_debugger_to);
+ dialog.setTitle(LaunchMessages.LocalAttachLaunchDelegate_Select_Process);
+ dialog.setMessage(LaunchMessages.LocalAttachLaunchDelegate_Select_Process_to_attach_debugger_to);
IProcessList plist = null;
try {
plist = CCorePlugin.getDefault().getProcessList();
} catch (CoreException e) {
- LaunchUIPlugin.errorDialog(LaunchMessages.LocalAttachLaunchDelegate_CDT_Launch_Error, e.getStatus());
+ LaunchUIPlugin.errorDialog(LaunchMessages.LocalAttachLaunchDelegate_CDT_Launch_Error, e.getStatus());
}
if (plist == null) {
- MessageDialog.openError(shell,
- LaunchMessages.LocalAttachLaunchDelegate_CDT_Launch_Error,
+ MessageDialog.openError(shell, LaunchMessages.LocalAttachLaunchDelegate_CDT_Launch_Error,
LaunchMessages.LocalAttachLaunchDelegate_Platform_cannot_list_processes);
return null;
}
dialog.setElements(plist.getProcessList());
if (dialog.open() == Window.OK) {
- IProcessInfo info = (IProcessInfo)dialog.getFirstResult();
+ IProcessInfo info = (IProcessInfo) dialog.getFirstResult();
if (info != null) {
return Integer.valueOf(info.getPid());
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java
index 0602878c36..1d850d74ec 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/ui/WorkingDirectoryBlock.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -93,14 +93,14 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createControl(Composite parent) {
Font font = parent.getFont();
- Group group = new Group(parent, SWT.NONE);
+ Group group = new Group(parent, SWT.NONE);
// WorkbenchHelp.setHelp(group,
// IJavaDebugHelpContextIds.WORKING_DIRECTORY_BLOCK);
GridLayout workingDirLayout = new GridLayout();
@@ -111,24 +111,22 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
group.setFont(font);
setControl(group);
- group.setText(LaunchMessages.WorkingDirectoryBlock_Working_directory);
-
- fWorkingDirText = new Text(group, SWT.SINGLE | SWT.BORDER);
- fWorkingDirText.getAccessible().addAccessibleListener(
- new AccessibleAdapter() {
- @Override
- public void getName(AccessibleEvent e) {
- e.result = LaunchMessages.WorkingDirectoryBlock_Working_directory;
- }
- }
- );
+ group.setText(LaunchMessages.WorkingDirectoryBlock_Working_directory);
+
+ fWorkingDirText = new Text(group, SWT.SINGLE | SWT.BORDER);
+ fWorkingDirText.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ @Override
+ public void getName(AccessibleEvent e) {
+ e.result = LaunchMessages.WorkingDirectoryBlock_Working_directory;
+ }
+ });
gd = new GridData(GridData.FILL_HORIZONTAL);
fWorkingDirText.setLayoutData(gd);
fWorkingDirText.setFont(font);
fWorkingDirText.addModifyListener(fListener);
fUseDefaultWorkingDirButton = new Button(group, SWT.CHECK);
- fUseDefaultWorkingDirButton.setText(LaunchMessages.WorkingDirectoryBlock_Use_default);
+ fUseDefaultWorkingDirButton.setText(LaunchMessages.WorkingDirectoryBlock_Use_default);
gd = new GridData(GridData.FILL, GridData.BEGINNING, true, false);
fUseDefaultWorkingDirButton.setLayoutData(gd);
fUseDefaultWorkingDirButton.setFont(font);
@@ -142,18 +140,18 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
buttonComp.setLayoutData(gd);
buttonComp.setFont(font);
- fWorkspaceButton = createPushButton(buttonComp, LaunchMessages.WorkingDirectoryBlock_0, null);
+ fWorkspaceButton = createPushButton(buttonComp, LaunchMessages.WorkingDirectoryBlock_0, null);
fWorkspaceButton.addSelectionListener(fListener);
- fFileSystemButton = createPushButton(buttonComp, LaunchMessages.WorkingDirectoryBlock_1, null);
+ fFileSystemButton = createPushButton(buttonComp, LaunchMessages.WorkingDirectoryBlock_1, null);
fFileSystemButton.addSelectionListener(fListener);
- fVariablesButton = createVariablesButton(buttonComp, LaunchMessages.WorkingDirectoryBlock_17, null);
+ fVariablesButton = createVariablesButton(buttonComp, LaunchMessages.WorkingDirectoryBlock_17, null);
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#dispose()
*/
@Override
@@ -165,7 +163,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
*/
protected void handleWorkingDirBrowseButtonSelected() {
DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setMessage(LaunchMessages.WorkingDirectoryBlock_7);
+ dialog.setMessage(LaunchMessages.WorkingDirectoryBlock_7);
String currentWorkingDir = fWorkingDirText.getText();
if (!currentWorkingDir.trim().isEmpty()) {
File path = new File(currentWorkingDir);
@@ -185,13 +183,13 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
* workspace
*/
protected void handleWorkspaceDirBrowseButtonSelected() {
- ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
- LaunchMessages.WorkingDirectoryBlock_4);
+ ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
+ ResourcesPlugin.getWorkspace().getRoot(), false, LaunchMessages.WorkingDirectoryBlock_4);
IContainer currentContainer = getContainer();
if (currentContainer != null) {
IPath path = currentContainer.getFullPath();
- dialog.setInitialSelections(new Object[] { path});
+ dialog.setInitialSelections(new Object[] { path });
}
dialog.showClosedProjects(false);
@@ -253,7 +251,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
@Override
@@ -279,7 +277,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
if (dir.isDirectory()) {
return true;
}
- setErrorMessage(LaunchMessages.WorkingDirectoryBlock_10);
+ setErrorMessage(LaunchMessages.WorkingDirectoryBlock_10);
return false;
}
}
@@ -288,7 +286,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
/**
* Defaults are empty.
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
@Override
@@ -299,14 +297,15 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
setLaunchConfiguration(configuration);
try {
- String wd = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, (String) null);
+ String wd = configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
+ (String) null);
fWorkingDirText.setText(""); //$NON-NLS-1$
if (wd == null) {
fUseDefaultWorkingDirButton.setSelection(true);
@@ -316,14 +315,15 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
}
handleUseDefaultWorkingDirButtonSelected();
} catch (CoreException e) {
- setErrorMessage(LaunchMessages.WorkingDirectoryBlock_Exception_occurred_reading_configuration_15 + e.getStatus().getMessage());
+ setErrorMessage(LaunchMessages.WorkingDirectoryBlock_Exception_occurred_reading_configuration_15
+ + e.getStatus().getMessage());
LaunchUIPlugin.log(e);
}
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
@Override
@@ -337,7 +337,7 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
/**
* Retuns the string in the text widget, or <code>null</code> if empty.
- *
+ *
* @return text or <code>null</code>
*/
protected String getAttributeValueFrom(Text text) {
@@ -350,12 +350,12 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
@Override
public String getName() {
- return LaunchMessages.WorkingDirectoryBlock_Working_Directory_8;
+ return LaunchMessages.WorkingDirectoryBlock_Working_Directory_8;
}
/**
@@ -381,4 +381,3 @@ public class WorkingDirectoryBlock extends CLaunchConfigurationTab {
}
}
-
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java
index 53c6bcde2d..ba5d8de8e0 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CAbstractMainTab.java
@@ -207,7 +207,8 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
for (int i = 0; i < cproject.length; i++) {
ICDescriptor cdesciptor = null;
try {
- cdesciptor = CCorePlugin.getDefault().getCProjectDescription((IProject) cproject[i].getResource(), false);
+ cdesciptor = CCorePlugin.getDefault().getCProjectDescription((IProject) cproject[i].getResource(),
+ false);
if (cdesciptor != null) {
String projectPlatform = cdesciptor.getPlatform();
if (filterPlatform.equals("*") //$NON-NLS-1$
@@ -385,11 +386,8 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
fWorkpsaceSettingsLink.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- PreferencesUtil.createPreferenceDialogOn(
- parent.getShell(),
- LAUNCHING_PREFERENCE_PAGE_ID,
- null,
- null).open();
+ PreferencesUtil.createPreferenceDialogOn(parent.getShell(), LAUNCHING_PREFERENCE_PAGE_ID, null, null)
+ .open();
}
});
}
@@ -419,14 +417,14 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
}
updateComboTooltip();
if (fDisableBuildButton != null)
- fDisableBuildButton
- .setSelection(buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED);
+ fDisableBuildButton.setSelection(
+ buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_DISABLED);
if (fEnableBuildButton != null)
- fEnableBuildButton.setSelection(buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED);
+ fEnableBuildButton.setSelection(
+ buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_ENABLED);
if (fWorkspaceSettingsButton != null)
- fWorkspaceSettingsButton
- .setSelection(
- buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING);
+ fWorkspaceSettingsButton.setSelection(
+ buildBeforeLaunchValue == ICDTLaunchConfigurationConstants.BUILD_BEFORE_LAUNCH_USE_WORKSPACE_SETTING);
}
/**
@@ -538,7 +536,8 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
@Override
public void performApply(ILaunchConfigurationWorkingCopy config) {
if (fBuildConfigCombo != null) {
- String configId = (String) fBuildConfigCombo.getData(Integer.toString(fBuildConfigCombo.getSelectionIndex()));
+ String configId = (String) fBuildConfigCombo
+ .getData(Integer.toString(fBuildConfigCombo.getSelectionIndex()));
boolean auto = false;
if (configId.equals(AUTO_CONFIG)) {
auto = true;
@@ -629,7 +628,8 @@ public abstract class CAbstractMainTab extends CLaunchConfigurationTab {
protected void updateComboTooltip() {
if (fBuildConfigCombo != null) {
// fBuildConfigCombo might not be loaded when controls are created
- String configId = (String) fBuildConfigCombo.getData(Integer.toString(fBuildConfigCombo.getSelectionIndex()));
+ String configId = (String) fBuildConfigCombo
+ .getData(Integer.toString(fBuildConfigCombo.getSelectionIndex()));
String tooltip = EMPTY_STRING;
if (configId != null) {
if (configId.equals(AUTO_CONFIG)) {
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java
index 7b377a5c64..fa27741024 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CArgumentsTab.java
@@ -40,7 +40,6 @@ import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-
/**
* A launch configuration tab that displays and edits program arguments,
* and working directory launch configuration attributes.
@@ -98,14 +97,12 @@ public class CArgumentsTab extends CLaunchConfigurationTab {
group.setText(LaunchMessages.CArgumentsTab_C_Program_Arguments);
fPrgmArgumentsText = new Text(group, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
- fPrgmArgumentsText.getAccessible().addAccessibleListener(
- new AccessibleAdapter() {
- @Override
- public void getName(AccessibleEvent e) {
- e.result = LaunchMessages.CArgumentsTab_C_Program_Arguments;
- }
+ fPrgmArgumentsText.getAccessible().addAccessibleListener(new AccessibleAdapter() {
+ @Override
+ public void getName(AccessibleEvent e) {
+ e.result = LaunchMessages.CArgumentsTab_C_Program_Arguments;
}
- );
+ });
gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = 40;
gd.widthHint = 100;
@@ -117,7 +114,8 @@ public class CArgumentsTab extends CLaunchConfigurationTab {
updateLaunchConfigurationDialog();
}
});
- fArgumentVariablesButton= createVariablesButton(group, LaunchMessages.CArgumentsTab_Variables, fPrgmArgumentsText);
+ fArgumentVariablesButton = createVariablesButton(group, LaunchMessages.CArgumentsTab_Variables,
+ fPrgmArgumentsText);
gd = new GridData(GridData.HORIZONTAL_ALIGN_END);
fArgumentVariablesButton.setLayoutData(gd);
addControlAccessibleListener(fArgumentVariablesButton, fArgumentVariablesButton.getText()); // need to strip the mnemonic from buttons
@@ -135,9 +133,11 @@ public class CArgumentsTab extends CLaunchConfigurationTab {
private class ControlAccessibleListener extends AccessibleAdapter {
private String controlName;
+
ControlAccessibleListener(String name) {
controlName = name;
}
+
@Override
public void getName(AccessibleEvent e) {
e.result = controlName;
@@ -158,7 +158,8 @@ public class CArgumentsTab extends CLaunchConfigurationTab {
@Override
public void initializeFrom(ILaunchConfiguration configuration) {
try {
- fPrgmArgumentsText.setText(configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "")); //$NON-NLS-1$
+ fPrgmArgumentsText
+ .setText(configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "")); //$NON-NLS-1$
fWorkingDirectoryBlock.initializeFrom(configuration);
} catch (CoreException e) {
setErrorMessage(NLS.bind(LaunchMessages.Launch_common_Exception_occurred_reading_configuration_EXCEPTION,
@@ -169,28 +170,26 @@ public class CArgumentsTab extends CLaunchConfigurationTab {
@Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
- configuration.setAttribute(
- ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
+ configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS,
getAttributeValueFrom(fPrgmArgumentsText));
fWorkingDirectoryBlock.performApply(configuration);
}
/**
* Returns the string in the text widget, or <code>null</code> if empty.
- *
+ *
* @return text or <code>null</code>
*/
protected String getAttributeValueFrom(Text text) {
String content = text.getText().trim();
// Bug #131513 - eliminate Windows \r line delimiter
- content = content.replaceAll("\r\n", "\n"); //$NON-NLS-1$//$NON-NLS-2$
+ content = content.replaceAll("\r\n", "\n"); //$NON-NLS-1$//$NON-NLS-2$
if (!content.isEmpty()) {
return content;
}
return null;
}
-
@Override
public String getId() {
return TAB_ID;
@@ -198,7 +197,7 @@ public class CArgumentsTab extends CLaunchConfigurationTab {
@Override
public String getName() {
- return LaunchMessages.CArgumentsTab_Arguments;
+ return LaunchMessages.CArgumentsTab_Arguments;
}
@Override
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java
index a3246c27b4..7aa9f052b5 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CEnvironmentTab.java
@@ -66,7 +66,6 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
-
/**
* @deprecated
*/
@@ -112,7 +111,8 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
@Override
public String getColumnText(Object element, int columnIndex) {
if (element != null && element instanceof Map.Entry) {
- return (columnIndex == 0) ? ((Map.Entry) element).getKey().toString() : ((Map.Entry) element).getValue().toString();
+ return (columnIndex == 0) ? ((Map.Entry) element).getKey().toString()
+ : ((Map.Entry) element).getValue().toString();
}
return null;
}
@@ -144,8 +144,8 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
- String title = (fEdit) ?
- LaunchMessages.CEnvironmentTab_Edit_Variable : LaunchMessages.CEnvironmentTab_New_Variable;
+ String title = (fEdit) ? LaunchMessages.CEnvironmentTab_Edit_Variable
+ : LaunchMessages.CEnvironmentTab_New_Variable;
shell.setText(title);
}
@@ -164,14 +164,14 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
int fieldWidthHint = convertWidthInCharsToPixels(metrics, 50);
Label label = new Label(composite, SWT.NONE);
- label.setText(LaunchMessages.CEnvironmentTab_NameColon);
+ label.setText(LaunchMessages.CEnvironmentTab_NameColon);
fTextName = new Text(composite, SWT.SINGLE | SWT.BORDER);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.grabExcessHorizontalSpace = true;
gd.widthHint = fieldWidthHint;
fTextName.setLayoutData(gd);
label = new Label(composite, SWT.NONE);
- label.setText(LaunchMessages.CEnvironmentTab_ValueColon);
+ label.setText(LaunchMessages.CEnvironmentTab_ValueColon);
fTextValue = new Text(composite, SWT.SINGLE | SWT.BORDER);
gd = new GridData(GridData.FILL_BOTH);
gd.grabExcessHorizontalSpace = true;
@@ -293,11 +293,11 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
table.setLinesVisible(true);
TableColumn column1 = new TableColumn(table, SWT.NULL);
- column1.setText(LaunchMessages.CEnvironmentTab_Name);
+ column1.setText(LaunchMessages.CEnvironmentTab_Name);
tableLayout.addColumnData(new ColumnWeightData(30));
TableColumn column2 = new TableColumn(table, SWT.NULL);
- column2.setText(LaunchMessages.CEnvironmentTab_Value);
+ column2.setText(LaunchMessages.CEnvironmentTab_Value);
tableLayout.addColumnData(new ColumnWeightData(30));
fVariableList.addDoubleClickListener(new IDoubleClickListener() {
@@ -319,7 +319,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
composite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING));
composite.setLayout(new GridLayout(1, true));
fBtnNew = new Button(composite, SWT.NONE);
- fBtnNew.setText(LaunchMessages.CEnvironmentTab_New);
+ fBtnNew.setText(LaunchMessages.CEnvironmentTab_New);
fBtnNew.setLayoutData(new GridData(GridData.FILL_BOTH));
fBtnNew.addSelectionListener(new SelectionAdapter() {
@Override
@@ -328,7 +328,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
}
});
fBtnImport = new Button(composite, SWT.NONE);
- fBtnImport.setText(LaunchMessages.CEnvironmentTab_Import);
+ fBtnImport.setText(LaunchMessages.CEnvironmentTab_Import);
fBtnImport.setLayoutData(new GridData(GridData.FILL_BOTH));
fBtnImport.addSelectionListener(new SelectionAdapter() {
@Override
@@ -337,7 +337,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
}
});
fBtnEdit = new Button(composite, SWT.NONE);
- fBtnEdit.setText(LaunchMessages.CEnvironmentTab_Edit);
+ fBtnEdit.setText(LaunchMessages.CEnvironmentTab_Edit);
fBtnEdit.setLayoutData(new GridData(GridData.FILL_BOTH));
fBtnEdit.addSelectionListener(new SelectionAdapter() {
@Override
@@ -346,7 +346,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
}
});
fBtnRemove = new Button(composite, SWT.NONE);
- fBtnRemove.setText(LaunchMessages.CEnvironmentTab_Remove);
+ fBtnRemove.setText(LaunchMessages.CEnvironmentTab_Remove);
fBtnRemove.setLayoutData(new GridData(GridData.FILL_BOTH));
fBtnRemove.addSelectionListener(new SelectionAdapter() {
@Override
@@ -386,11 +386,11 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
}
parseImportFile(filename);
-
+
updateButtons();
updateLaunchConfigurationDialog();
}
-
+
protected void parseImportFile(String filename) {
File file = new File(filename);
if (!file.exists()) {
@@ -399,15 +399,15 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
//Iterate through each key/value property we discover
try {
- BufferedReader reader = new BufferedReader(new FileReader(file));
+ BufferedReader reader = new BufferedReader(new FileReader(file));
String line, key, value;
- while((line = reader.readLine()) != null) {
+ while ((line = reader.readLine()) != null) {
line = line.trim();
if (line.length() == 0) {
continue;
}
-
+
int demarcation = line.indexOf("="); //$NON-NLS-1$
if (demarcation == -1) {
key = line;
@@ -429,11 +429,11 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
fElements.setProperty(key, value);
}
- } catch(Exception ex) {
-
+ } catch (Exception ex) {
+
}
- fVariableList.refresh();
+ fVariableList.refresh();
}
protected void edit() {
@@ -494,7 +494,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
*/
@Override
public String getName() {
- return LaunchMessages.CEnvironmentTab_Environment;
+ return LaunchMessages.CEnvironmentTab_Environment;
}
/* (non-Javadoc)
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java
index b068c4ebec..72b504efac 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CLaunchConfigurationTab.java
@@ -52,7 +52,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
* settings, or <code>null</code> if none. Note, if possible we will
* return the IBinary based on config entry as this may be more usefull then
* just the project.
- *
+ *
* @return C element context.
*/
protected ICElement getContext(ILaunchConfiguration config, String platform) {
@@ -61,10 +61,11 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
IWorkbenchPage page = LaunchUIPlugin.getActivePage();
Object obj = null;
try {
- projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
- programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String)null);
+ projectName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String) null);
+ programName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, (String) null);
if (programName != null) {
- programName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(programName);
+ programName = VariablesPlugin.getDefault().getStringVariableManager()
+ .performStringSubstitution(programName);
}
} catch (CoreException e) {
}
@@ -78,7 +79,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
if (page != null) {
ISelection selection = page.getSelection();
if (selection instanceof IStructuredSelection) {
- IStructuredSelection ss = (IStructuredSelection)selection;
+ IStructuredSelection ss = (IStructuredSelection) selection;
if (!ss.isEmpty()) {
obj = ss.getFirstElement();
}
@@ -97,8 +98,8 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
if (platform != null && !platform.equals("*")) { //$NON-NLS-1$
ICDescriptor descriptor;
try {
- descriptor = CCorePlugin.getDefault().getCProjectDescription(((ICElement) obj).getCProject().getProject(),
- false);
+ descriptor = CCorePlugin.getDefault()
+ .getCProjectDescription(((ICElement) obj).getCProject().getProject(), false);
if (descriptor != null) {
String projectPlatform = descriptor.getPlatform();
if (!projectPlatform.equals(platform) && !projectPlatform.equals("*")) { //$NON-NLS-1$
@@ -114,7 +115,7 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
}
ICElement ce = (ICElement) obj;
IProject project;
- project = (IProject)ce.getCProject().getResource();
+ project = (IProject) ce.getCProject().getResource();
IPath programFile = project.getFile(programName).getLocation();
ce = CCorePlugin.getDefault().getCoreModel().create(programFile);
if (ce != null && ce.exists()) {
@@ -128,9 +129,8 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
if (part != null) {
IEditorInput input = part.getEditorInput();
if (input instanceof IFileEditorInput) {
- IFile file = ((IFileEditorInput)input).getFile();
- if (file != null)
- {
+ IFile file = ((IFileEditorInput) input).getFile();
+ if (file != null) {
ICElement ce = CoreModel.getDefault().create(file);
if (ce == null) {
IProject pro = file.getProject();
@@ -152,14 +152,14 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
String name = null;
if (cProject != null && cProject.exists()) {
name = cProject.getElementName();
- config.setMappedResources(new IResource[] {cProject.getProject()});
-
+ config.setMappedResources(new IResource[] { cProject.getProject() });
+
ICProjectDescription projDes = CCorePlugin.getDefault().getProjectDescription(cProject.getProject());
if (projDes != null) {
String buildConfigID = projDes.getActiveConfiguration().getId();
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_BUILD_CONFIG_ID, buildConfigID);
}
-
+
}
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, name);
}
@@ -172,14 +172,14 @@ public abstract class CLaunchConfigurationTab extends AbstractLaunchConfiguratio
return platform;
}
}
-
+
/**
* Creates a button that allows user to insert build variables.
- *
+ *
* @since 7.1
*/
protected Button createVariablesButton(Composite parent, String label, final Text textField) {
- Button variablesButton = createPushButton(parent, label, null);
+ Button variablesButton = createPushButton(parent, label, null);
variablesButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent arg0) {
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainAttachTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainAttachTab.java
index ac8333df1f..2b837c9004 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainAttachTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainAttachTab.java
@@ -21,14 +21,14 @@ public class CMainAttachTab extends CMainTab {
public CMainAttachTab() {
super(false);
}
-
+
@Override
public boolean isValid(ILaunchConfiguration config) {
if (super.isValid(config) == false) {
String name = fProgText.getText().trim();
- if (name.length() == 0) { // allow no program for attach config.
+ if (name.length() == 0) { // allow no program for attach config.
setErrorMessage(null);
- return true;
+ return true;
}
return false;
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainCoreTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainCoreTab.java
index c05ba29b5f..348c0a05a7 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainCoreTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainCoreTab.java
@@ -7,19 +7,18 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* Ericsson - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.launch.ui;
-
/**
* @since 6.0
*/
@Deprecated
public class CMainCoreTab extends CMainTab {
- public CMainCoreTab() {
- super(CMainTab.SPECIFY_CORE_FILE);
- }
+ public CMainCoreTab() {
+ super(CMainTab.SPECIFY_CORE_FILE);
+ }
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
index ea981ae27e..11c7677467 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java
@@ -67,17 +67,17 @@ import org.eclipse.ui.dialogs.TwoPaneElementSelector;
* </p>
* @since 2.0
*/
-@Deprecated // see https://git.eclipse.org/r/#/c/68010/
+@Deprecated // see https://git.eclipse.org/r/#/c/68010/
public class CMainTab extends CAbstractMainTab {
- /**
- * Tab identifier used for ordering of tabs added using the
- * <code>org.eclipse.debug.ui.launchConfigurationTabs</code>
- * extension point.
- *
- * @since 6.0
- */
- public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.mainTab"; //$NON-NLS-1$
+ /**
+ * Tab identifier used for ordering of tabs added using the
+ * <code>org.eclipse.debug.ui.launchConfigurationTabs</code>
+ * extension point.
+ *
+ * @since 6.0
+ */
+ public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.mainTab"; //$NON-NLS-1$
private final boolean fWantsTerminalOption;
protected Button fTerminalButton;
@@ -103,10 +103,10 @@ public class CMainTab extends CAbstractMainTab {
dontCheckProgram = (flags & DONT_CHECK_PROGRAM) != 0;
fSpecifyCoreFile = (flags & SPECIFY_CORE_FILE) != 0;
}
-
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
@Override
@@ -114,7 +114,8 @@ public class CMainTab extends CAbstractMainTab {
Composite comp = new Composite(parent, SWT.NONE);
setControl(comp);
- LaunchUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(), ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB);
+ LaunchUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(),
+ ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB);
GridLayout topLayout = new GridLayout();
comp.setLayout(topLayout);
@@ -148,7 +149,7 @@ public class CMainTab extends CAbstractMainTab {
gd.horizontalSpan = colSpan;
mainComp.setLayoutData(gd);
- fTerminalButton = createCheckButton(mainComp, LaunchMessages.CMainTab_UseTerminal);
+ fTerminalButton = createCheckButton(mainComp, LaunchMessages.CMainTab_UseTerminal);
fTerminalButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -161,7 +162,7 @@ public class CMainTab extends CAbstractMainTab {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
@Override
@@ -178,7 +179,8 @@ public class CMainTab extends CAbstractMainTab {
if (fTerminalButton != null) {
boolean useTerminal = true;
try {
- useTerminal = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, ICDTLaunchConfigurationConstants.USE_TERMINAL_DEFAULT);
+ useTerminal = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL,
+ ICDTLaunchConfigurationConstants.USE_TERMINAL_DEFAULT);
} catch (CoreException e) {
LaunchUIPlugin.log(e);
}
@@ -201,7 +203,7 @@ public class CMainTab extends CAbstractMainTab {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
@Override
@@ -242,7 +244,7 @@ public class CMainTab extends CAbstractMainTab {
@Override
public String getText(Object element) {
if (element instanceof IBinary) {
- IBinary bin = (IBinary)element;
+ IBinary bin = (IBinary) element;
StringBuilder name = new StringBuilder();
name.append(bin.getPath().lastSegment());
return name.toString();
@@ -252,13 +254,13 @@ public class CMainTab extends CAbstractMainTab {
@Override
public Image getImage(Object element) {
- if (! (element instanceof ICElement)) {
+ if (!(element instanceof ICElement)) {
return super.getImage(element);
}
- ICElement celement = (ICElement)element;
+ ICElement celement = (ICElement) element;
if (celement.getElementType() == ICElement.C_BINARY) {
- IBinary belement = (IBinary)celement;
+ IBinary belement = (IBinary) celement;
if (belement.isExecutable()) {
return DebugUITools.getImage(IDebugUIConstants.IMG_ACT_RUN);
}
@@ -273,7 +275,7 @@ public class CMainTab extends CAbstractMainTab {
@Override
public String getText(Object element) {
if (element instanceof IBinary) {
- IBinary bin = (IBinary)element;
+ IBinary bin = (IBinary) element;
StringBuilder name = new StringBuilder();
name.append(bin.getCPU()).append(bin.isLittleEndian() ? "le" : "be"); //$NON-NLS-1$ //$NON-NLS-2$
name.append(" - "); //$NON-NLS-1$
@@ -284,16 +286,17 @@ public class CMainTab extends CAbstractMainTab {
}
};
- TwoPaneElementSelector dialog = new TwoPaneElementSelector(getShell(), programLabelProvider, qualifierLabelProvider);
+ TwoPaneElementSelector dialog = new TwoPaneElementSelector(getShell(), programLabelProvider,
+ qualifierLabelProvider);
dialog.setElements(getBinaryFiles(getCProject()));
- dialog.setMessage(LaunchMessages.CMainTab_Choose_program_to_run);
- dialog.setTitle(LaunchMessages.CMainTab_Program_Selection);
- dialog.setUpperListLabel(LaunchMessages.Launch_common_BinariesColon);
- dialog.setLowerListLabel(LaunchMessages.Launch_common_QualifierColon);
+ dialog.setMessage(LaunchMessages.CMainTab_Choose_program_to_run);
+ dialog.setTitle(LaunchMessages.CMainTab_Program_Selection);
+ dialog.setUpperListLabel(LaunchMessages.Launch_common_BinariesColon);
+ dialog.setLowerListLabel(LaunchMessages.Launch_common_QualifierColon);
dialog.setMultipleSelection(false);
// dialog.set
if (dialog.open() == Window.OK) {
- IBinary binary = (IBinary)dialog.getFirstResult();
+ IBinary binary = (IBinary) dialog.getFirstResult();
fProgText.setText(binary.getResource().getProjectRelativePath().toString());
}
}
@@ -314,7 +317,7 @@ public class CMainTab extends CAbstractMainTab {
projComp.setLayoutData(gd);
fProjLabel = new Label(projComp, SWT.NONE);
- fProjLabel.setText(LaunchMessages.CMainTab_ProjectColon);
+ fProjLabel.setText(LaunchMessages.CMainTab_ProjectColon);
gd = new GridData();
gd.horizontalSpan = 2;
fProjLabel.setLayoutData(gd);
@@ -328,13 +331,13 @@ public class CMainTab extends CAbstractMainTab {
public void modifyText(ModifyEvent evt) {
// if project changes, invalidate program name cache
fPreviouslyCheckedProgram = null;
-
+
updateBuildConfigCombo(""); //$NON-NLS-1$
updateLaunchConfigurationDialog();
}
});
- fProjButton = createPushButton(projComp, LaunchMessages.Launch_common_Browse_1, null);
+ fProjButton = createPushButton(projComp, LaunchMessages.Launch_common_Browse_1, null);
fProjButton.addSelectionListener(new SelectionAdapter() {
@Override
@@ -355,7 +358,7 @@ public class CMainTab extends CAbstractMainTab {
gd.horizontalSpan = colSpan;
mainComp.setLayoutData(gd);
fProgLabel = new Label(mainComp, SWT.NONE);
- fProgLabel.setText(LaunchMessages.CMainTab_C_Application);
+ fProgLabel.setText(LaunchMessages.CMainTab_C_Application);
gd = new GridData();
fProgLabel.setLayoutData(gd);
fProgText = new Text(mainComp, SWT.SINGLE | SWT.BORDER);
@@ -378,7 +381,7 @@ public class CMainTab extends CAbstractMainTab {
buttonComp.setFont(parent.getFont());
createVariablesButton(buttonComp, LaunchMessages.CMainTab_Variables, fProgText);
- fSearchButton = createPushButton(buttonComp, LaunchMessages.CMainTab_Search, null);
+ fSearchButton = createPushButton(buttonComp, LaunchMessages.CMainTab_Search, null);
fSearchButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
@@ -388,7 +391,7 @@ public class CMainTab extends CAbstractMainTab {
});
Button fBrowseForBinaryButton;
- fBrowseForBinaryButton = createPushButton(buttonComp, LaunchMessages.Launch_common_Browse_2, null);
+ fBrowseForBinaryButton = createPushButton(buttonComp, LaunchMessages.Launch_common_Browse_2, null);
fBrowseForBinaryButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
@@ -406,7 +409,7 @@ public class CMainTab extends CAbstractMainTab {
protected void handleBinaryBrowseButtonSelected() {
FileDialog fileDialog = new FileDialog(getShell(), SWT.NONE);
fileDialog.setFileName(fProgText.getText());
- String text= fileDialog.open();
+ String text = fileDialog.open();
if (text != null) {
fProgText.setText(text);
}
@@ -414,7 +417,7 @@ public class CMainTab extends CAbstractMainTab {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
@Override
@@ -425,31 +428,31 @@ public class CMainTab extends CAbstractMainTab {
if (!dontCheckProgram) {
String name = fProjText.getText().trim();
if (name.length() == 0) {
- setErrorMessage(LaunchMessages.CMainTab_Project_not_specified);
+ setErrorMessage(LaunchMessages.CMainTab_Project_not_specified);
return false;
}
if (!ResourcesPlugin.getWorkspace().getRoot().getProject(name).exists()) {
- setErrorMessage(LaunchMessages.Launch_common_Project_does_not_exist);
+ setErrorMessage(LaunchMessages.Launch_common_Project_does_not_exist);
return false;
}
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
if (!project.isOpen()) {
- setErrorMessage(LaunchMessages.CMainTab_Project_must_be_opened);
+ setErrorMessage(LaunchMessages.CMainTab_Project_must_be_opened);
return false;
}
-
+
name = fProgText.getText().trim();
- try {
- name = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(name);
+ try {
+ name = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(name);
} catch (CoreException e) {
// Silently ignore substitution failure (for consistency with "Arguments" and "Work directory" fields)
}
if (name.length() == 0) {
- setErrorMessage(LaunchMessages.CMainTab_Program_not_specified);
+ setErrorMessage(LaunchMessages.CMainTab_Program_not_specified);
return false;
}
if (name.equals(".") || name.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
- setErrorMessage(LaunchMessages.CMainTab_Program_does_not_exist);
+ setErrorMessage(LaunchMessages.CMainTab_Program_does_not_exist);
return false;
}
// Avoid constantly checking the binary if nothing relevant has
@@ -461,35 +464,37 @@ public class CMainTab extends CAbstractMainTab {
return fPreviouslyCheckedProgramIsValid;
} else {
fPreviouslyCheckedProgram = name;
- fPreviouslyCheckedProgramIsValid = true; // we'll flip this below if not true
- fPreviouslyCheckedProgramErrorMsg = null; // we'll set this below if there's an error
+ fPreviouslyCheckedProgramIsValid = true; // we'll flip this below if not true
+ fPreviouslyCheckedProgramErrorMsg = null; // we'll set this below if there's an error
IPath exePath = new Path(name);
if (!exePath.isAbsolute()) {
IPath location = project.getLocation();
if (location == null) {
- setErrorMessage(fPreviouslyCheckedProgramErrorMsg = LaunchMessages.CMainTab_Program_does_not_exist);
+ setErrorMessage(
+ fPreviouslyCheckedProgramErrorMsg = LaunchMessages.CMainTab_Program_does_not_exist);
return (fPreviouslyCheckedProgramIsValid = false);
}
-
+
exePath = location.append(name);
if (!exePath.toFile().exists()) {
// Try the old way, which is required to support linked resources.
- IFile projFile = null;
+ IFile projFile = null;
try {
projFile = project.getFile(name);
} catch (IllegalArgumentException e) {
// thrown if relative path that resolves to a root file ("..\somefile")
}
if (projFile == null || !projFile.exists()) {
- setErrorMessage(fPreviouslyCheckedProgramErrorMsg = LaunchMessages.CMainTab_Program_does_not_exist);
+ setErrorMessage(
+ fPreviouslyCheckedProgramErrorMsg = LaunchMessages.CMainTab_Program_does_not_exist);
return (fPreviouslyCheckedProgramIsValid = false);
} else {
exePath = projFile.getLocation();
}
}
- }
+ }
if (!exePath.toFile().exists()) {
- setErrorMessage(fPreviouslyCheckedProgramErrorMsg = LaunchMessages.CMainTab_Program_does_not_exist);
+ setErrorMessage(fPreviouslyCheckedProgramErrorMsg = LaunchMessages.CMainTab_Program_does_not_exist);
return (fPreviouslyCheckedProgramIsValid = false);
}
// Notice that we don't check if exePath points to a valid executable since such
@@ -497,24 +502,24 @@ public class CMainTab extends CAbstractMainTab {
// See "https://bugs.eclipse.org/bugs/show_bug.cgi?id=328012".
// We only verify that the program path represents a file.
if (!exePath.toFile().isFile()) {
- setErrorMessage(fPreviouslyCheckedProgramErrorMsg = LaunchMessages.CMainTab_Selection_must_be_file);
+ setErrorMessage(fPreviouslyCheckedProgramErrorMsg = LaunchMessages.CMainTab_Selection_must_be_file);
return (fPreviouslyCheckedProgramIsValid = false);
}
}
}
-
+
if (fCoreText != null) {
String coreName = fCoreText.getText().trim();
// We accept an empty string. This should trigger a prompt to the user
// This allows to re-use the launch, with a different core file.
if (!coreName.equals(EMPTY_STRING)) {
if (coreName.equals(".") || coreName.equals("..")) { //$NON-NLS-1$ //$NON-NLS-2$
- setErrorMessage(LaunchMessages.CMainTab_Core_does_not_exist);
+ setErrorMessage(LaunchMessages.CMainTab_Core_does_not_exist);
return false;
}
IPath corePath = new Path(coreName);
if (!corePath.toFile().exists()) {
- setErrorMessage(LaunchMessages.CMainTab_Core_does_not_exist);
+ setErrorMessage(LaunchMessages.CMainTab_Core_does_not_exist);
return false;
}
}
@@ -525,7 +530,7 @@ public class CMainTab extends CAbstractMainTab {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
@Override
@@ -557,7 +562,8 @@ public class CMainTab extends CAbstractMainTab {
config.setMappedResources(null);
}
if (wantsTerminalOption()) {
- config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL, ICDTLaunchConfigurationConstants.USE_TERMINAL_DEFAULT);
+ config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_USE_TERMINAL,
+ ICDTLaunchConfigurationConstants.USE_TERMINAL_DEFAULT);
}
}
@@ -570,7 +576,7 @@ public class CMainTab extends CAbstractMainTab {
if (!(cElement instanceof IBinary)) {
cElement = cElement.getCProject();
}
-
+
if (cElement instanceof ICProject) {
IProject project = cElement.getCProject().getProject();
String name = project.getName();
@@ -587,12 +593,12 @@ public class CMainTab extends CAbstractMainTab {
IBinary binary = null;
if (cElement instanceof ICProject) {
- IBinary[] bins = getBinaryFiles((ICProject)cElement);
+ IBinary[] bins = getBinaryFiles((ICProject) cElement);
if (bins != null && bins.length == 1) {
binary = bins[0];
}
} else if (cElement instanceof IBinary) {
- binary = (IBinary)cElement;
+ binary = (IBinary) cElement;
}
if (binary != null) {
@@ -607,10 +613,10 @@ public class CMainTab extends CAbstractMainTab {
}
name = getLaunchConfigurationDialog().generateName(name);
config.rename(name);
- renamed = true;
+ renamed = true;
}
}
-
+
if (!renamed) {
String name = getLaunchConfigurationDialog().generateName(cElement.getCProject().getElementName());
config.rename(name);
@@ -618,23 +624,23 @@ public class CMainTab extends CAbstractMainTab {
}
@Override
- public String getId() {
- return TAB_ID;
- }
-
+ public String getId() {
+ return TAB_ID;
+ }
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
@Override
public String getName() {
- return LaunchMessages.CMainTab_Main;
+ return LaunchMessages.CMainTab_Main;
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
@Override
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab2.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab2.java
index 21f824a092..c856aede4b 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab2.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab2.java
@@ -13,7 +13,7 @@
* Ken Ryall (Nokia) - bug 178731
* Ericsson - Support for tracepoint post-mortem debugging
* IBM Corporation
- * Marc Khouzam (Ericsson) - Support setting the path in which the core file
+ * Marc Khouzam (Ericsson) - Support setting the path in which the core file
* dialog should start (Bug 362039)
* Anton Gorenkov
* Marc Khouzam (Ericsson) - Move from dsf.gdb to cdt.launch
@@ -74,23 +74,23 @@ import org.eclipse.ui.dialogs.TwoPaneElementSelector;
public class CMainTab2 extends CAbstractMainTab {
- /**
- * Tab identifier used for ordering of tabs added using the
- * <code>org.eclipse.debug.ui.launchConfigurationTabs</code>
- * extension point.
- */
+ /**
+ * Tab identifier used for ordering of tabs added using the
+ * <code>org.eclipse.debug.ui.launchConfigurationTabs</code>
+ * extension point.
+ */
// Keep the same id as the original Run launch main tab for backwards-compatibility
- public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.mainTab"; //$NON-NLS-1$
-
- private static final String CORE_FILE = LaunchMessages.CMainTab2_CoreFile_type;
- private static final String TRACE_FILE = LaunchMessages.CMainTab2_TraceFile_type;
-
- /**
- * Combo box to select which type of post mortem file should be used.
- * We currently support core files and trace files.
- */
- protected Combo fCoreTypeCombo;
-
+ public static final String TAB_ID = "org.eclipse.cdt.cdi.launch.mainTab"; //$NON-NLS-1$
+
+ private static final String CORE_FILE = LaunchMessages.CMainTab2_CoreFile_type;
+ private static final String TRACE_FILE = LaunchMessages.CMainTab2_TraceFile_type;
+
+ /**
+ * Combo box to select which type of post mortem file should be used.
+ * We currently support core files and trace files.
+ */
+ protected Combo fCoreTypeCombo;
+
private final boolean fDontCheckProgram;
private final boolean fSpecifyCoreFile;
private final boolean fIncludeBuildSettings;
@@ -98,7 +98,7 @@ public class CMainTab2 extends CAbstractMainTab {
public static final int DONT_CHECK_PROGRAM = 2;
public static final int SPECIFY_CORE_FILE = 4;
public static final int INCLUDE_BUILD_SETTINGS = 8;
-
+
public CMainTab2() {
this(INCLUDE_BUILD_SETTINGS);
}
@@ -108,13 +108,14 @@ public class CMainTab2 extends CAbstractMainTab {
fSpecifyCoreFile = (flags & SPECIFY_CORE_FILE) != 0;
fIncludeBuildSettings = (flags & INCLUDE_BUILD_SETTINGS) != 0;
}
-
- @Override
+
+ @Override
public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
setControl(comp);
- LaunchUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(), ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB);
+ LaunchUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(getControl(),
+ ICDTLaunchHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB);
GridLayout topLayout = new GridLayout();
comp.setLayout(topLayout);
@@ -123,14 +124,14 @@ public class CMainTab2 extends CAbstractMainTab {
createProjectGroup(comp, 1);
createExeFileGroup(comp, 1);
- if (fIncludeBuildSettings){
- createBuildOptionGroup(comp, 1);
+ if (fIncludeBuildSettings) {
+ createBuildOptionGroup(comp, 1);
}
createVerticalSpacer(comp, 1);
if (fSpecifyCoreFile) {
createCoreFileGroup(comp, 1);
}
-
+
LaunchUIPlugin.setDialogShell(parent.getShell());
}
@@ -151,7 +152,7 @@ public class CMainTab2 extends CAbstractMainTab {
gd = new GridData(GridData.FILL_HORIZONTAL);
fProgText.setLayoutData(gd);
fProgText.addModifyListener(new ModifyListener() {
- @Override
+ @Override
public void modifyText(ModifyEvent evt) {
updateLaunchConfigurationDialog();
}
@@ -188,7 +189,7 @@ public class CMainTab2 extends CAbstractMainTab {
updateLaunchConfigurationDialog();
}
});
- }
+ }
/*
* Overridden to add the possibility to choose a trace file as a post mortem debug file.
@@ -204,7 +205,7 @@ public class CMainTab2 extends CAbstractMainTab {
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = colSpan;
coreComp.setLayoutData(gd);
-
+
Label comboLabel = new Label(coreComp, SWT.NONE);
comboLabel.setText(LaunchMessages.CMainTab2_Post_mortem_file_type);
comboLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1));
@@ -220,7 +221,7 @@ public class CMainTab2 extends CAbstractMainTab {
gd = new GridData(GridData.FILL_HORIZONTAL);
fCoreText.setLayoutData(gd);
fCoreText.addModifyListener(new ModifyListener() {
- @Override
+ @Override
public void modifyText(ModifyEvent evt) {
updateLaunchConfigurationDialog();
}
@@ -248,15 +249,15 @@ public class CMainTab2 extends CAbstractMainTab {
updateLaunchConfigurationDialog();
}
});
-
+
fCoreTypeCombo.addSelectionListener(new SelectionListener() {
- @Override
+ @Override
public void widgetSelected(SelectionEvent e) {
updateCoreFileLabel();
updateLaunchConfigurationDialog();
}
- @Override
+ @Override
public void widgetDefaultSelected(SelectionEvent e) {
}
});
@@ -266,7 +267,7 @@ public class CMainTab2 extends CAbstractMainTab {
/**
* Show a dialog that lets the user select a file.
* This method allows to set the title of the dialog.
- *
+ *
* @param title The title the dialog should show.
*/
protected String handleBrowseButtonSelected(String title) {
@@ -276,7 +277,7 @@ public class CMainTab2 extends CAbstractMainTab {
return fileDialog.open();
}
- @Override
+ @Override
public void initializeFrom(ILaunchConfiguration config) {
filterPlatform = getPlatform(config);
updateProjectFromConfig(config);
@@ -284,7 +285,7 @@ public class CMainTab2 extends CAbstractMainTab {
updateCoreFromConfig(config);
updateBuildOptionFromConfig(config);
}
-
+
protected void updateCoreFromConfig(ILaunchConfiguration config) {
if (fCoreText != null) {
String coreName = EMPTY_STRING;
@@ -292,7 +293,7 @@ public class CMainTab2 extends CAbstractMainTab {
try {
coreName = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_COREFILE_PATH, EMPTY_STRING);
coreType = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_POST_MORTEM_TYPE,
- ICDTLaunchConfigurationConstants.DEBUGGER_POST_MORTEM_TYPE_DEFAULT);
+ ICDTLaunchConfigurationConstants.DEBUGGER_POST_MORTEM_TYPE_DEFAULT);
} catch (CoreException ce) {
LaunchUIPlugin.log(ce);
}
@@ -303,12 +304,12 @@ public class CMainTab2 extends CAbstractMainTab {
fCoreTypeCombo.setText(TRACE_FILE);
} else {
assert false : "Unknown core file type"; //$NON-NLS-1$
- fCoreTypeCombo.setText(CORE_FILE);
+ fCoreTypeCombo.setText(CORE_FILE);
}
updateCoreFileLabel();
}
}
-
+
protected String getSelectedCoreType() {
int selectedIndex = fCoreTypeCombo.getSelectionIndex();
if (fCoreTypeCombo.getItem(selectedIndex).equals(CORE_FILE)) {
@@ -337,8 +338,7 @@ public class CMainTab2 extends CAbstractMainTab {
public void performApply(ILaunchConfigurationWorkingCopy config) {
super.performApply(config);
ICProject cProject = this.getCProject();
- if (cProject != null && cProject.exists())
- {
+ if (cProject != null && cProject.exists()) {
config.setMappedResources(new IResource[] { cProject.getProject() });
} else {
config.setMappedResources(null);
@@ -360,7 +360,7 @@ public class CMainTab2 extends CAbstractMainTab {
if (getCProject() == null) {
MessageDialog.openInformation(getShell(), LaunchMessages.CMainTab_Project_required,
LaunchMessages.CMainTab_Enter_project_before_searching_for_program);
-
+
return;
}
@@ -368,23 +368,23 @@ public class CMainTab2 extends CAbstractMainTab {
@Override
public String getText(Object element) {
if (element instanceof IBinary) {
- IBinary bin = (IBinary)element;
+ IBinary bin = (IBinary) element;
StringBuilder name = new StringBuilder();
name.append(bin.getPath().lastSegment());
return name.toString();
}
return super.getText(element);
}
-
+
@Override
public Image getImage(Object element) {
- if (! (element instanceof ICElement)) {
+ if (!(element instanceof ICElement)) {
return super.getImage(element);
}
- ICElement celement = (ICElement)element;
+ ICElement celement = (ICElement) element;
if (celement.getElementType() == ICElement.C_BINARY) {
- IBinary belement = (IBinary)celement;
+ IBinary belement = (IBinary) celement;
if (belement.isExecutable()) {
return DebugUITools.getImage(IDebugUIConstants.IMG_ACT_RUN);
}
@@ -398,7 +398,7 @@ public class CMainTab2 extends CAbstractMainTab {
@Override
public String getText(Object element) {
if (element instanceof IBinary) {
- IBinary bin = (IBinary)element;
+ IBinary bin = (IBinary) element;
StringBuilder name = new StringBuilder();
name.append(bin.getCPU()).append(bin.isLittleEndian() ? "le" : "be"); //$NON-NLS-1$ //$NON-NLS-2$
name.append(" - "); //$NON-NLS-1$
@@ -409,7 +409,8 @@ public class CMainTab2 extends CAbstractMainTab {
}
};
- TwoPaneElementSelector dialog = new TwoPaneElementSelector(getShell(), programLabelProvider, qualifierLabelProvider);
+ TwoPaneElementSelector dialog = new TwoPaneElementSelector(getShell(), programLabelProvider,
+ qualifierLabelProvider);
dialog.setElements(getBinaryFiles(getCProject()));
dialog.setMessage(LaunchMessages.CMainTab_Choose_program_to_run);
dialog.setTitle(LaunchMessages.CMainTab_Program_Selection);
@@ -418,7 +419,7 @@ public class CMainTab2 extends CAbstractMainTab {
dialog.setMultipleSelection(false);
// dialog.set
if (dialog.open() == Window.OK) {
- IBinary binary = (IBinary)dialog.getFirstResult();
+ IBinary binary = (IBinary) dialog.getFirstResult();
fProgText.setText(binary.getResource().getProjectRelativePath().toString());
}
}
@@ -430,8 +431,9 @@ public class CMainTab2 extends CAbstractMainTab {
if (!fDontCheckProgram) {
String programName = fProgText.getText().trim();
- try {
- programName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(programName);
+ try {
+ programName = VariablesPlugin.getDefault().getStringVariableManager()
+ .performStringSubstitution(programName);
} catch (CoreException e) {
// Silently ignore substitution failure (for consistency with "Arguments" and "Work directory" fields)
}
@@ -481,7 +483,7 @@ public class CMainTab2 extends CAbstractMainTab {
// check is too expensive to be done on the UI thread.
// See "https://bugs.eclipse.org/bugs/show_bug.cgi?id=328012".
}
-
+
if (fCoreText != null) {
String coreName = fCoreText.getText().trim();
// We accept an empty string. This should trigger a prompt to the user
@@ -491,12 +493,13 @@ public class CMainTab2 extends CAbstractMainTab {
if (!coreName.equals(EMPTY_STRING)) {
try {
// Replace the variables
- coreName = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(coreName, false);
+ coreName = VariablesPlugin.getDefault().getStringVariableManager()
+ .performStringSubstitution(coreName, false);
} catch (CoreException e) {
setErrorMessage(e.getMessage());
return false;
}
-
+
coreName = coreName.trim();
File filePath = new File(coreName);
if (!filePath.isDirectory() && !filePath.exists()) {
@@ -509,7 +512,7 @@ public class CMainTab2 extends CAbstractMainTab {
return true;
}
- @Override
+ @Override
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
// We set empty attributes for project & program so that when one config is
// compared to another, the existence of empty attributes doesn't cause and
@@ -542,10 +545,10 @@ public class CMainTab2 extends CAbstractMainTab {
protected void initializeProgramName(ICElement cElement, ILaunchConfigurationWorkingCopy config) {
boolean renamed = false;
- if (!(cElement instanceof IBinary)) {
+ if (!(cElement instanceof IBinary)) {
cElement = cElement.getCProject();
}
-
+
if (cElement instanceof ICProject) {
IProject project = cElement.getCProject().getProject();
String name = project.getName();
@@ -561,20 +564,19 @@ public class CMainTab2 extends CAbstractMainTab {
IBinary binary = null;
if (cElement instanceof ICProject) {
- IBinary[] bins = getBinaryFiles((ICProject)cElement);
+ IBinary[] bins = getBinaryFiles((ICProject) cElement);
if (bins != null && bins.length == 1) {
binary = bins[0];
}
} else if (cElement instanceof IBinary) {
- binary = (IBinary)cElement;
+ binary = (IBinary) cElement;
}
if (binary != null) {
String path;
path = binary.getResource().getProjectRelativePath().toOSString();
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, path);
- if (!renamed)
- {
+ if (!renamed) {
String name = binary.getElementName();
int index = name.lastIndexOf('.');
if (index > 0) {
@@ -582,34 +584,34 @@ public class CMainTab2 extends CAbstractMainTab {
}
name = getLaunchConfigurationDialog().generateName(name);
config.rename(name);
- renamed = true;
+ renamed = true;
}
}
-
+
if (!renamed) {
String name = getLaunchConfigurationDialog().generateName(cElement.getCProject().getElementName());
config.rename(name);
}
}
- @Override
- public String getId() {
- return TAB_ID;
- }
-
+ @Override
+ public String getId() {
+ return TAB_ID;
+ }
+
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
- @Override
+ @Override
public String getName() {
return LaunchMessages.CMainTab_Main;
}
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
@Override
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ComboControlledStackComposite.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ComboControlledStackComposite.java
index 4db7d55662..3b235c9c02 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ComboControlledStackComposite.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ComboControlledStackComposite.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* QNX Software Systems - initial API and implementation
* Freescale Semiconductor
@@ -35,7 +35,7 @@ import org.eclipse.swt.widgets.Label;
public class ComboControlledStackComposite extends Composite {
private Composite fArea;
private Combo fCombo;
- private Map<String, Composite> tabMap; // label ==> tab
+ private Map<String, Composite> tabMap; // label ==> tab
private StackLayout layout;
private Label fLabel;
@@ -49,10 +49,11 @@ public class ComboControlledStackComposite extends Composite {
public void setLabelText(String label) {
fLabel.setText(label);
}
+
public void addItem(String label, Composite tab) {
tabMap.put(label, tab);
fCombo.add(label);
- if (layout.topControl==null) {
+ if (layout.topControl == null) {
layout.topControl = tab;
fCombo.setText(label);
}
@@ -86,7 +87,6 @@ public class ComboControlledStackComposite extends Composite {
fArea.setLayoutData(agd);
}
-
public Composite getStackParent() {
return fArea;
}
@@ -107,12 +107,11 @@ public class ComboControlledStackComposite extends Composite {
return comp;
}
-
protected Label createLabel(Composite parent) {
Label label = new Label(parent, SWT.WRAP);
- return label;
- }
-
+ return label;
+ }
+
protected Combo createCombo(Composite parent) {
Combo box = new Combo(parent, SWT.READ_ONLY);
box.addSelectionListener(new SelectionAdapter() {
@@ -133,8 +132,8 @@ public class ComboControlledStackComposite extends Composite {
layout.topControl = tabMap.get(label);
getStackParent().layout();
}
-
+
public Control getTopControl() {
- return layout != null ? layout.topControl : null;
+ return layout != null ? layout.topControl : null;
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CommonTabLite.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CommonTabLite.java
index 0e21318ce4..10d0d920b3 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CommonTabLite.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CommonTabLite.java
@@ -7,14 +7,13 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
- * Freescale Semiconductor (stripped out functionality from platform debug version)
+ * Freescale Semiconductor (stripped out functionality from platform debug version)
*******************************************************************************/
package org.eclipse.cdt.launch.ui;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -76,27 +75,28 @@ import org.eclipse.ui.dialogs.ContainerSelectionDialog;
/**
* This class was taken from org.eclipse.debug.ui. We expose a Common tab for
* Multilaunch that has only a subset of the standard tab's properties.
- *
+ *
* Launch configuration tab used to specify the location a launch configuration
* is stored in, whether it should appear in the favorites list, and perspective
* switching behavior for an associated launch.
* <p>
* Clients may instantiate this class.
* </p>
- *
+ *
* @since 6.0
* @noextend This class is not intended to be subclassed by clients.
*/
public class CommonTabLite extends AbstractLaunchConfigurationTab {
-
+
/**
* Provides a persistible dialog for selecting the shared project location
* @since 3.2
*/
class SharedLocationSelectionDialog extends ContainerSelectionDialog {
private final String SETTINGS_ID = IDebugUIConstants.PLUGIN_ID + ".SHARED_LAUNCH_CONFIGURATON_DIALOG"; //$NON-NLS-1$
-
- public SharedLocationSelectionDialog(Shell parentShell, IContainer initialRoot, boolean allowNewContainerName, String message) {
+
+ public SharedLocationSelectionDialog(Shell parentShell, IContainer initialRoot, boolean allowNewContainerName,
+ String message) {
super(parentShell, initialRoot, allowNewContainerName, message);
}
@@ -106,11 +106,11 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
IDialogSettings section = settings.getSection(SETTINGS_ID);
if (section == null) {
section = settings.addNewSection(SETTINGS_ID);
- }
+ }
return section;
}
}
-
+
/**
* This attribute exists solely for the purpose of making sure that invalid shared locations
* can be revertible. This attribute is not saveable and will never appear in a saved
@@ -118,18 +118,18 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
* @since 3.3
*/
private static final String BAD_CONTAINER = "bad_container_name"; //$NON-NLS-1$
-
+
// Local/shared UI widgets
private Button fLocalRadioButton;
private Button fSharedRadioButton;
private Text fSharedLocationText;
private Button fSharedLocationButton;
-
+
/**
* Check box list for specifying favorites
*/
private CheckboxTableViewer fFavoritesTable;
-
+
/**
* Modify listener that simply updates the owning launch configuration dialog.
*/
@@ -139,30 +139,33 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
updateLaunchConfigurationDialog();
}
};
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.widgets.Composite)
*/
@Override
- public void createControl(Composite parent) {
+ public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE);
setControl(comp);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_COMMON_TAB);
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(),
+ IDebugHelpContextIds.LAUNCH_CONFIGURATION_DIALOG_COMMON_TAB);
comp.setLayout(new GridLayout(2, true));
comp.setFont(parent.getFont());
-
+
createSharedConfigComponent(comp);
createFavoritesComponent(comp);
}
-
+
/**
* Creates the favorites control
* @param parent the parent composite to add this one to
* @since 3.2
*/
private void createFavoritesComponent(Composite parent) {
- Group favComp = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_Display_in_favorites_menu__10, 1, 1, GridData.FILL_BOTH);
- fFavoritesTable = CheckboxTableViewer.newCheckList(favComp, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
+ Group favComp = SWTFactory.createGroup(parent,
+ LaunchConfigurationsMessages.CommonTab_Display_in_favorites_menu__10, 1, 1, GridData.FILL_BOTH);
+ fFavoritesTable = CheckboxTableViewer.newCheckList(favComp,
+ SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
Control table = fFavoritesTable.getControl();
GridData gd = new GridData(GridData.FILL_BOTH);
table.setLayoutData(gd);
@@ -170,20 +173,21 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
fFavoritesTable.setContentProvider(new FavoritesContentProvider());
fFavoritesTable.setLabelProvider(new FavoritesLabelProvider());
fFavoritesTable.addCheckStateListener(new ICheckStateListener() {
- @Override
- public void checkStateChanged(CheckStateChangedEvent event) {
- updateLaunchConfigurationDialog();
- }
- });
+ @Override
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ updateLaunchConfigurationDialog();
+ }
+ });
}
-
+
/**
* Creates the shared config component
* @param parent the parent composite to add this component to
* @since 3.2
*/
private void createSharedConfigComponent(Composite parent) {
- Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_0, 3, 2, GridData.FILL_HORIZONTAL);
+ Group group = SWTFactory.createGroup(parent, LaunchConfigurationsMessages.CommonTab_0, 3, 2,
+ GridData.FILL_HORIZONTAL);
Composite comp = SWTFactory.createComposite(group, parent.getFont(), 3, 3, GridData.FILL_BOTH, 0, 0);
fLocalRadioButton = createRadioButton(comp, LaunchConfigurationsMessages.CommonTab_L_ocal_3);
GridData gd = new GridData();
@@ -200,22 +204,22 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
fSharedLocationText.getAccessible().addAccessibleListener(new AccessibleAdapter() {
@Override
public void getName(AccessibleEvent e) {
- e.result = LaunchConfigurationsMessages.CommonTab_S_hared_4;
+ e.result = LaunchConfigurationsMessages.CommonTab_S_hared_4;
}
});
fSharedLocationText.addModifyListener(fBasicModifyListener);
- fSharedLocationButton = createPushButton(comp, LaunchConfigurationsMessages.CommonTab__Browse_6, null);
+ fSharedLocationButton = createPushButton(comp, LaunchConfigurationsMessages.CommonTab__Browse_6, null);
fSharedLocationButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent evt) {
handleSharedLocationButtonSelected();
}
- });
+ });
fLocalRadioButton.setSelection(true);
- setSharedEnabled(false);
+ setSharedEnabled(false);
}
-
+
/**
* handles the shared radio button being selected
*/
@@ -223,34 +227,35 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
setSharedEnabled(isShared());
updateLaunchConfigurationDialog();
}
-
+
/**
* Sets the widgets for specifying that a launch configuration is to be shared to the enable value
- * @param enable the enabled value for
+ * @param enable the enabled value for
*/
private void setSharedEnabled(boolean enable) {
fSharedLocationText.setEnabled(enable);
fSharedLocationButton.setEnabled(enable);
}
-
+
private String getDefaultSharedConfigLocation(ILaunchConfiguration config) {
String path = IInternalDebugCoreConstants.EMPTY_STRING;
try {
IResource[] res = config.getMappedResources();
- if(res != null) {
- IProject proj;
+ if (res != null) {
+ IProject proj;
for (int i = 0; i < res.length; i++) {
proj = res[i].getProject();
- if(proj != null && proj.isAccessible()) {
+ if (proj != null && proj.isAccessible()) {
return proj.getFullPath().toOSString();
}
}
}
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
+ } catch (CoreException e) {
+ DebugUIPlugin.log(e);
+ }
return path;
}
-
+
/**
* if the shared radio button is selected, indicating that the launch configuration is to be shared
* @return true if the radio button is selected, false otherwise
@@ -258,27 +263,25 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
private boolean isShared() {
return fSharedRadioButton.getSelection();
}
-
+
/**
* Handles the shared location button being selected
*/
- private void handleSharedLocationButtonSelected() {
+ private void handleSharedLocationButtonSelected() {
String currentContainerString = fSharedLocationText.getText();
IContainer currentContainer = getContainer(currentContainerString);
- SharedLocationSelectionDialog dialog = new SharedLocationSelectionDialog(getShell(),
- currentContainer,
- false,
- LaunchConfigurationsMessages.CommonTab_Select_a_location_for_the_launch_configuration_13);
+ SharedLocationSelectionDialog dialog = new SharedLocationSelectionDialog(getShell(), currentContainer, false,
+ LaunchConfigurationsMessages.CommonTab_Select_a_location_for_the_launch_configuration_13);
dialog.showClosedProjects(false);
dialog.open();
- Object[] results = dialog.getResult();
+ Object[] results = dialog.getResult();
if ((results != null) && (results.length > 0) && (results[0] instanceof IPath)) {
- IPath path = (IPath)results[0];
+ IPath path = (IPath) results[0];
String containerName = path.toOSString();
fSharedLocationText.setText(containerName);
- }
+ }
}
-
+
/**
* gets the container form the specified path
* @param path the path to get the container from
@@ -288,7 +291,7 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
Path containerPath = new Path(path);
return (IContainer) getWorkspaceRoot().findMember(containerPath);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug.core.ILaunchConfiguration)
*/
@@ -299,7 +302,7 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
fLocalRadioButton.setSelection(!isShared);
setSharedEnabled(isShared);
fSharedLocationText.setText(getDefaultSharedConfigLocation(configuration));
- if(isShared) {
+ if (isShared) {
String containerName = IInternalDebugCoreConstants.EMPTY_STRING;
IFile file = configuration.getFile();
if (file != null) {
@@ -312,7 +315,6 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
}
updateFavoritesFromConfig(configuration);
}
-
/**
* Updates the favorites selections from the local configuration
@@ -320,7 +322,7 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
*/
private void updateFavoritesFromConfig(ILaunchConfiguration config) {
fFavoritesTable.setInput(config);
- fFavoritesTable.setCheckedElements(new Object[]{});
+ fFavoritesTable.setCheckedElements(new Object[] {});
try {
List groups = config.getAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, new ArrayList());
if (groups.isEmpty()) {
@@ -336,7 +338,7 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
List list = new ArrayList();
Iterator iterator = groups.iterator();
while (iterator.hasNext()) {
- String id = (String)iterator.next();
+ String id = (String) iterator.next();
LaunchGroupExtension extension = getLaunchConfigurationManager().getLaunchGroup(id);
if (extension != null) {
list.add(extension);
@@ -357,28 +359,27 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
if (isShared()) {
String containerPathString = fSharedLocationText.getText();
IContainer container = getContainer(containerPathString);
- if(container == null) {
+ if (container == null) {
//we need to force an attribute to allow the invalid container path to be revertable
config.setAttribute(BAD_CONTAINER, containerPathString);
- }
- else {
+ } else {
config.setContainer(container);
}
} else {
config.setContainer(null);
}
}
-
+
/**
* Convenience accessor
*/
protected LaunchConfigurationManager getLaunchConfigurationManager() {
return DebugUIPlugin.getDefault().getLaunchConfigurationManager();
}
-
+
/**
* Update the favorite settings.
- *
+ *
* NOTE: set to <code>null</code> instead of <code>false</code> for backwards compatibility
* when comparing if content is equal, since 'false' is default
* and will be missing for older configurations.
@@ -413,12 +414,12 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
return;
}
}
- }
- config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String)null);
- config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, (String)null);
+ }
+ config.setAttribute(IDebugUIConstants.ATTR_DEBUG_FAVORITE, (String) null);
+ config.setAttribute(IDebugUIConstants.ATTR_RUN_FAVORITE, (String) null);
List groups = null;
for (int i = 0; i < checked.length; i++) {
- LaunchGroupExtension group = (LaunchGroupExtension)checked[i];
+ LaunchGroupExtension group = (LaunchGroupExtension) checked[i];
if (groups == null) {
groups = new ArrayList();
}
@@ -427,16 +428,16 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
config.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, groups);
} catch (CoreException e) {
DebugUIPlugin.log(e);
- }
- }
-
+ }
+ }
+
/**
* Convenience method for getting the workspace root.
*/
private IWorkspaceRoot getWorkspaceRoot() {
return ResourcesPlugin.getWorkspace().getRoot();
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.ILaunchConfiguration)
*/
@@ -444,27 +445,28 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
public boolean isValid(ILaunchConfiguration config) {
setMessage(null);
setErrorMessage(null);
-
+
return validateLocalShared();
}
-
- /**
- * validates the local shared config file location
- * @return true if the local shared file exists, false otherwise
- */
- private boolean validateLocalShared() {
+
+ /**
+ * validates the local shared config file location
+ * @return true if the local shared file exists, false otherwise
+ */
+ private boolean validateLocalShared() {
if (isShared()) {
String path = fSharedLocationText.getText().trim();
IContainer container = getContainer(path);
if (container == null || container.equals(ResourcesPlugin.getWorkspace().getRoot())) {
- setErrorMessage(LaunchConfigurationsMessages.CommonTab_Invalid_shared_configuration_location_14);
+ setErrorMessage(LaunchConfigurationsMessages.CommonTab_Invalid_shared_configuration_location_14);
return false;
} else if (!container.getProject().isOpen()) {
- setErrorMessage(LaunchConfigurationsMessages.CommonTab_Cannot_save_launch_configuration_in_a_closed_project__1);
- return false;
+ setErrorMessage(
+ LaunchConfigurationsMessages.CommonTab_Cannot_save_launch_configuration_in_a_closed_project__1);
+ return false;
}
}
- return true;
+ return true;
}
/* (non-Javadoc)
@@ -490,19 +492,19 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
*/
@Override
public String getName() {
- return LaunchConfigurationsMessages.CommonTab__Common_15;
+ return LaunchConfigurationsMessages.CommonTab__Common_15;
}
-
+
/**
* @see org.eclipse.debug.ui.AbstractLaunchConfigurationTab#getId()
- *
+ *
* @since 3.3
*/
@Override
public String getId() {
return "org.eclipse.debug.ui.commonTab"; //$NON-NLS-1$
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#canSave()
*/
@@ -518,18 +520,20 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
public Image getImage() {
return DebugUITools.getImage(IInternalDebugUIConstants.IMG_OBJS_COMMON_TAB);
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
@Override
- public void activated(ILaunchConfigurationWorkingCopy workingCopy) {}
+ public void activated(ILaunchConfigurationWorkingCopy workingCopy) {
+ }
/* (non-Javadoc)
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)
*/
@Override
- public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {}
+ public void deactivated(ILaunchConfigurationWorkingCopy workingCopy) {
+ }
/**
* Content provider for the favorites table
@@ -540,38 +544,40 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
public Object[] getElements(Object inputElement) {
ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
List possibleGroups = new ArrayList();
- ILaunchConfiguration configuration = (ILaunchConfiguration)inputElement;
+ ILaunchConfiguration configuration = (ILaunchConfiguration) inputElement;
for (int i = 0; i < groups.length; i++) {
ILaunchGroup extension = groups[i];
LaunchHistory history = getLaunchConfigurationManager().getLaunchHistory(extension.getIdentifier());
if (history != null && history.accepts(configuration)) {
possibleGroups.add(extension);
- }
+ }
}
return possibleGroups.toArray();
}
@Override
- public void dispose() {}
+ public void dispose() {
+ }
@Override
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
}
-
+
/**
* Provides the labels for the favorites table
*
*/
class FavoritesLabelProvider implements ITableLabelProvider {
-
+
private Map fImages = new HashMap();
@Override
public Image getColumnImage(Object element, int columnIndex) {
- Image image = (Image)fImages.get(element);
+ Image image = (Image) fImages.get(element);
if (image == null) {
- ImageDescriptor descriptor = ((LaunchGroupExtension)element).getImageDescriptor();
+ ImageDescriptor descriptor = ((LaunchGroupExtension) element).getImageDescriptor();
if (descriptor != null) {
image = descriptor.createImage();
fImages.put(element, image);
@@ -582,27 +588,31 @@ public class CommonTabLite extends AbstractLaunchConfigurationTab {
@Override
public String getColumnText(Object element, int columnIndex) {
- String label = ((LaunchGroupExtension)element).getLabel();
+ String label = ((LaunchGroupExtension) element).getLabel();
return DebugUIPlugin.removeAccelerators(label);
}
@Override
- public void addListener(ILabelProviderListener listener) {}
+ public void addListener(ILabelProviderListener listener) {
+ }
@Override
public void dispose() {
Iterator images = fImages.values().iterator();
while (images.hasNext()) {
- Image image = (Image)images.next();
+ Image image = (Image) images.next();
image.dispose();
}
}
@Override
- public boolean isLabelProperty(Object element, String property) {return false;}
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
@Override
- public void removeListener(ILabelProviderListener listener) {}
+ public void removeListener(ILabelProviderListener listener) {
+ }
}
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java
index e298da372a..f1eec2ff69 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/ICDTLaunchHelpContextIds.java
@@ -20,10 +20,14 @@ public interface ICDTLaunchHelpContextIds {
public static final String PREFIX = LaunchUIPlugin.PLUGIN_ID + "."; //$NON-NLS-1$
// Launch configuration dialog pages
- public static final String LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB = PREFIX + "launch_configuration_dialog_main_tab"; //$NON-NLS-1$
- public static final String LAUNCH_CONFIGURATION_DIALOG_ARGUMNETS_TAB = PREFIX + "launch_configuration_dialog_arguments_tab"; //$NON-NLS-1$
- public static final String LAUNCH_CONFIGURATION_DIALOG_ENVIRONMENT_TAB = PREFIX + "launch_configuration_dialog_environment_tab"; //$NON-NLS-1$
- public static final String LAUNCH_CONFIGURATION_DIALOG_DEBBUGER_TAB = PREFIX + "launch_configuration_dialog_debugger_tab"; //$NON-NLS-1$
- public static final String LAUNCH_CONFIGURATION_DIALOG_SOURCELOOKUP_TAB = PREFIX + "launch_configuration_dialog_source_tab"; //$NON-NLS-1$
+ public static final String LAUNCH_CONFIGURATION_DIALOG_MAIN_TAB = PREFIX + "launch_configuration_dialog_main_tab"; //$NON-NLS-1$
+ public static final String LAUNCH_CONFIGURATION_DIALOG_ARGUMNETS_TAB = PREFIX
+ + "launch_configuration_dialog_arguments_tab"; //$NON-NLS-1$
+ public static final String LAUNCH_CONFIGURATION_DIALOG_ENVIRONMENT_TAB = PREFIX
+ + "launch_configuration_dialog_environment_tab"; //$NON-NLS-1$
+ public static final String LAUNCH_CONFIGURATION_DIALOG_DEBBUGER_TAB = PREFIX
+ + "launch_configuration_dialog_debugger_tab"; //$NON-NLS-1$
+ public static final String LAUNCH_CONFIGURATION_DIALOG_SOURCELOOKUP_TAB = PREFIX
+ + "launch_configuration_dialog_source_tab"; //$NON-NLS-1$
}
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/CommonBuildTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/CommonBuildTab.java
index 766af2b094..e58984d8f0 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/CommonBuildTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/CommonBuildTab.java
@@ -43,7 +43,7 @@ import org.eclipse.swt.widgets.Group;
/**
* Common utilities for Core Build launch configuration tabs.
- *
+ *
* @since 9.1
*/
public abstract class CommonBuildTab extends AbstractLaunchConfigurationTab {
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/CoreBuildTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/CoreBuildTab.java
index d054063988..c1c01ba7b6 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/CoreBuildTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/CoreBuildTab.java
@@ -35,7 +35,7 @@ import org.eclipse.swt.widgets.Label;
/**
* Launch configuration tab for adjusting Core Build settings. Contents of tab depends on the nature
* of the project which determines what build system is being used.
- *
+ *
* @since 9.1
*/
public class CoreBuildTab extends AbstractLaunchConfigurationTab {
diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/GenericMainTab.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/GenericMainTab.java
index c0a6e14c01..68819c8528 100644
--- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/GenericMainTab.java
+++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/corebuild/GenericMainTab.java
@@ -7,7 +7,7 @@
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
- *
+ *
* copied from:
* org.eclipse.ui.externaltools.internal.launchConfigurations.GenericMainTab
*******************************************************************************/
@@ -118,7 +118,7 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.ui.ILaunchConfigurationTab#createControl(org.eclipse.swt.
* widgets.Composite)
@@ -233,7 +233,8 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
buttonComposite.setLayoutData(gridData);
buttonComposite.setFont(parent.getFont());
- workspaceWorkingDirectoryButton = createPushButton(buttonComposite, Messages.GenericMainTab_BrowseWorkspace, null);
+ workspaceWorkingDirectoryButton = createPushButton(buttonComposite, Messages.GenericMainTab_BrowseWorkspace,
+ null);
workspaceWorkingDirectoryButton.addSelectionListener(fListener);
addControlAccessibleListener(workspaceWorkingDirectoryButton,
group.getText() + " " + workspaceWorkingDirectoryButton.getText()); //$NON-NLS-1$
@@ -316,7 +317,7 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.ui.ILaunchConfigurationTab#setDefaults(org.eclipse.debug.
* core.ILaunchConfigurationWorkingCopy)
@@ -328,7 +329,7 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.ui.ILaunchConfigurationTab#initializeFrom(org.eclipse.debug
* .core.ILaunchConfiguration)
@@ -387,7 +388,7 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.ui.ILaunchConfigurationTab#performApply(org.eclipse.debug.
* core.ILaunchConfigurationWorkingCopy)
@@ -422,7 +423,7 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getName()
*/
@Override
@@ -432,7 +433,7 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.ui.ILaunchConfigurationTab#isValid(org.eclipse.debug.core.
* ILaunchConfiguration)
@@ -614,7 +615,7 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
/**
* Returns a new variable expression with the given variable and the given
* argument.
- *
+ *
* @see IStringVariableManager#generateVariableExpression(String, String)
*/
protected String newVariableExpression(String varName, String arg) {
@@ -657,7 +658,7 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see org.eclipse.debug.ui.ILaunchConfigurationTab#getImage()
*/
@Override
@@ -667,7 +668,7 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.ui.ILaunchConfigurationTab#deactivated(org.eclipse.debug.
* core.ILaunchConfigurationWorkingCopy)
@@ -678,7 +679,7 @@ public class GenericMainTab extends AbstractLaunchConfigurationTab {
/*
* (non-Javadoc)
- *
+ *
* @see
* org.eclipse.debug.ui.ILaunchConfigurationTab#activated(org.eclipse.debug.core
* .ILaunchConfigurationWorkingCopy)

Back to the top