diff options
author | Alain Magloire | 2004-01-07 21:02:50 +0000 |
---|---|---|
committer | Alain Magloire | 2004-01-07 21:02:50 +0000 |
commit | 081264bae4fae8a36bd7ed3342f1214a82fd4db1 (patch) | |
tree | 102ad8b1acc02b32d011f7f992abf92a9f4f4c11 /launch | |
parent | 41a0020d24a9badd0e876e80e6bb44d3ea896494 (diff) | |
download | org.eclipse.cdt-081264bae4fae8a36bd7ed3342f1214a82fd4db1.tar.gz org.eclipse.cdt-081264bae4fae8a36bd7ed3342f1214a82fd4db1.tar.xz org.eclipse.cdt-081264bae4fae8a36bd7ed3342f1214a82fd4db1.zip |
Fix Pr 49652.
Show the full path of the binaries.
Diffstat (limited to 'launch')
3 files changed, 37 insertions, 2 deletions
diff --git a/launch/org.eclipse.cdt.launch/ChangeLog b/launch/org.eclipse.cdt.launch/ChangeLog index e8571009cef..6b1ce948135 100644 --- a/launch/org.eclipse.cdt.launch/ChangeLog +++ b/launch/org.eclipse.cdt.launch/ChangeLog @@ -1,3 +1,11 @@ +2004-01-07 Alain Magloire + + Fix # 49652 + You could not see a difference with binaries of the same name but different location. + + * src/org/eclipse/cdt/launch/ui/CMainTab.java + * src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java + 2003-12-18 Alain Magloire Possible NPE, PR 49146 diff --git a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java index d8566c627f8..71a0336c383 100644 --- a/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java +++ b/launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/internal/CApplicationLaunchShortcut.java @@ -34,9 +34,11 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.ILabelProvider; +import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.LabelProvider; +import org.eclipse.swt.graphics.Image; import org.eclipse.swt.widgets.Shell; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.dialogs.ElementListSelectionDialog; @@ -256,7 +258,20 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut { * @return the selected binary or <code>null</code> if none. */ protected IBinary chooseBinary(List binList, String mode) { - ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), new CElementLabelProvider()); + ILabelProvider provider = new CElementLabelProvider() { + public String getText(Object element) { + if (element instanceof IBinary) { + IBinary bin = (IBinary)element; + StringBuffer name = new StringBuffer(); + name.append(bin.getPath().toString()); + name.append(" - [" + bin.getCPU() + (bin.isLittleEndian() ? "le" : "be") + "]"); + return name.toString(); + } + return super.getText(element); + } + }; + + ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), provider); dialog.setElements(binList.toArray()); dialog.setTitle("C Local Application"); //$NON-NLS-1$ if (mode.equals(ILaunchManager.DEBUG_MODE)) { 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 0b7539c636a..2b1a6e80d17 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 @@ -198,7 +198,19 @@ public class CMainTab extends CLaunchConfigurationTab { "Project must first be entered before searching for a program"); return; } - ILabelProvider labelProvider = new CElementLabelProvider(); + ILabelProvider labelProvider = new CElementLabelProvider() { + public String getText(Object element) { + if (element instanceof IBinary) { + IBinary bin = (IBinary)element; + StringBuffer name = new StringBuffer(); + name.append(bin.getPath().toString()); + name.append(" - [" + bin.getCPU() + (bin.isLittleEndian() ? "le" : "be") + "]"); + return name.toString(); + } + return super.getText(element); + } + }; + ElementListSelectionDialog dialog = new ElementListSelectionDialog(getShell(), labelProvider); dialog.setElements(getBinaryFiles(getCProject())); dialog.setMessage("Choose a &program to run"); |