mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Fix Pr 49652.
Show the full path of the binaries.
This commit is contained in:
parent
41a0020d24
commit
081264bae4
3 changed files with 37 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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");
|
||||
|
|
Loading…
Add table
Reference in a new issue