Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorPhilippe NOEL2017-08-01 11:18:51 +0000
committerPhilippe NOEL2017-08-02 07:28:32 +0000
commit10b3a4ea3ac7760a5372374677ae4dbd2879da44 (patch)
treed89016b4fcfdd57464c594e3bcfd14c55eebdd3e /build
parent07a9aa05432dc0436d7b89d75effcdac8d31094c (diff)
downloadorg.eclipse.cdt-10b3a4ea3ac7760a5372374677ae4dbd2879da44.tar.gz
org.eclipse.cdt-10b3a4ea3ac7760a5372374677ae4dbd2879da44.tar.xz
org.eclipse.cdt-10b3a4ea3ac7760a5372374677ae4dbd2879da44.zip
Bug 520360 - First created target does not appear in BuildTargetDialog
Change-Id: Ief40f2ee09d3714c65526086db993f6c630dda81 Signed-off-by: Philippe NOEL <philippe.noel@st.com>
Diffstat (limited to 'build')
-rw-r--r--build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java28
1 files changed, 15 insertions, 13 deletions
diff --git a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java
index 79bc55d686c..db78a25a74d 100644
--- a/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java
+++ b/build/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/ui/MakeContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2013 QNX Software Systems and others.
+ * Copyright (c) 2000, 2017 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -252,21 +252,23 @@ public class MakeContentProvider implements ITreeContentProvider, IMakeTargetLis
if (viewer == null || viewer.getControl() == null || viewer.getControl().isDisposed())
return;
- int itemCount = 0;
- if (viewer instanceof TreeViewer) {
- itemCount = ((TreeViewer) viewer).getTree().getItemCount();
- } else if (viewer instanceof TableViewer) {
- itemCount = ((TableViewer) viewer).getTable().getItemCount();
- }
- if (itemCount <= 0) {
- return;
- }
-
+ // Get first item of the viewer
Object firstItem = null;
if (viewer instanceof TreeViewer) {
- firstItem = ((TreeViewer) viewer).getTree().getItem(0).getData();
+ if( ((TreeViewer) viewer).getTree().getItemCount() <= 0) {
+ // No items yet, no refresh needed
+ return;
+ } else {
+ firstItem = ((TreeViewer) viewer).getTree().getItem(0).getData();
+ }
} else if (viewer instanceof TableViewer) {
- firstItem = ((TableViewer) viewer).getTable().getItem(0).getData();
+ if( ((TableViewer) viewer).getTable().getItemCount() <= 0) {
+ // No items yet, refresh
+ viewer.refresh();
+ return;
+ } else {
+ firstItem = ((TableViewer) viewer).getTable().getItem(0).getData();
+ }
}
IContainer parentContainer = null;

Back to the top