Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/launch
diff options
context:
space:
mode:
authorThomas Fletcher2004-02-15 17:32:45 +0000
committerThomas Fletcher2004-02-15 17:32:45 +0000
commit3f2a1ba9ff94ed671335a880bc2ad2ca684ba2aa (patch)
tree2737e392e00a98bf23ba778a1f8c5f43fcaef072 /launch
parent04649e1b683b7d973dd56b96e8343ea1fefdc40d (diff)
downloadorg.eclipse.cdt-3f2a1ba9ff94ed671335a880bc2ad2ca684ba2aa.tar.gz
org.eclipse.cdt-3f2a1ba9ff94ed671335a880bc2ad2ca684ba2aa.tar.xz
org.eclipse.cdt-3f2a1ba9ff94ed671335a880bc2ad2ca684ba2aa.zip
Further enhancements for PR 39580. If the icons are
different (ie debug and release) then the executables show up as different entries when they should show up as the same with different "qualifiers"
Diffstat (limited to 'launch')
-rw-r--r--launch/org.eclipse.cdt.launch/src/org/eclipse/cdt/launch/ui/CMainTab.java26
1 files changed, 26 insertions, 0 deletions
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 b92ec84bb8f..3bb97f84430 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
@@ -14,9 +14,13 @@ import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.debug.core.ICDTLaunchConfigurationConstants;
+import org.eclipse.cdt.internal.ui.CElementImageProvider;
+import org.eclipse.cdt.internal.ui.CPluginImages;
import org.eclipse.cdt.launch.internal.ui.LaunchImages;
import org.eclipse.cdt.launch.internal.ui.LaunchUIPlugin;
+import org.eclipse.cdt.ui.CElementImageDescriptor;
import org.eclipse.cdt.ui.CElementLabelProvider;
+import org.eclipse.cdt.ui.CUIPlugin;
import org.eclipse.core.boot.BootLoader;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
@@ -36,6 +40,7 @@ import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -220,6 +225,8 @@ public class CMainTab extends CLaunchConfigurationTab {
}
ILabelProvider programLabelProvider = new CElementLabelProvider() {
+ CElementImageProvider imageProvider = new CElementImageProvider();
+
public String getText(Object element) {
if (element instanceof IBinary) {
IBinary bin = (IBinary)element;
@@ -229,6 +236,24 @@ public class CMainTab extends CLaunchConfigurationTab {
}
return super.getText(element);
}
+
+ public Image getImage(Object element) {
+ if(!(element instanceof ICElement)) {
+ return super.getImage(element);
+ }
+ ICElement celement = (ICElement)element;
+
+ if(celement.getElementType() == ICElement.C_BINARY) {
+ IBinary belement = (IBinary)celement;
+ if(belement.isExecutable()) {
+ Image image = super.getImage(element);
+ Point size= new Point(image.getBounds().width, image.getBounds().height);
+ return CUIPlugin.getImageDescriptorRegistry().get(new CElementImageDescriptor(CPluginImages.DESC_OBJS_CEXEC, 0, size));
+ }
+ }
+
+ return super.getImage(element);
+ }
};
ILabelProvider qualifierLabelProvider = new CElementLabelProvider() {
@@ -252,6 +277,7 @@ public class CMainTab extends CLaunchConfigurationTab {
dialog.setUpperListLabel("Binaries:");
dialog.setLowerListLabel("Qualifier:");
dialog.setMultipleSelection(false);
+ //dialog.set
if (dialog.open() == ElementListSelectionDialog.OK) {
IBinary binary = (IBinary) dialog.getFirstResult();
fProgText.setText(binary.getResource().getProjectRelativePath().toString());

Back to the top