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 null 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");