Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2013-10-11 08:20:26 -0400
committerIgor Fedorenko2013-10-11 08:20:26 -0400
commit03101f71c4944e504683fb71ef06ff8389b91e49 (patch)
treed6d58e1696f6ed80f224a201cd482e1250b23a93
parentde2b3dedd838c4a9cc76b4b22fd9d0d54b52a98c (diff)
downloadm2e-core-03101f71c4944e504683fb71ef06ff8389b91e49.tar.gz
m2e-core-03101f71c4944e504683fb71ef06ff8389b91e49.tar.xz
m2e-core-03101f71c4944e504683fb71ef06ff8389b91e49.zip
changed NestedProjectsComposite to work better with windowbuilder
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
-rw-r--r--org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/NestedProjectsComposite.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/NestedProjectsComposite.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/NestedProjectsComposite.java
index 19e2b3e6..b3ea56a2 100644
--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/NestedProjectsComposite.java
+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/components/NestedProjectsComposite.java
@@ -11,6 +11,7 @@
package org.eclipse.m2e.core.ui.internal.components;
+import java.beans.Beans;
import java.io.File;
import java.net.URI;
import java.util.ArrayList;
@@ -151,6 +152,10 @@ public class NestedProjectsComposite extends Composite implements IMenuListener
});
codebaseViewer.setLabelProvider(new LabelProvider() {
public Image getImage(Object element) {
+ if(Beans.isDesignTime()) {
+ // windowbuilder compat
+ return null;
+ }
ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
if(element instanceof IProject && !((IProject) element).isAccessible()) {
return sharedImages.getImage(IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED);
@@ -166,13 +171,15 @@ public class NestedProjectsComposite extends Composite implements IMenuListener
projects = getMavenCodebases();
codebaseViewer.setInput(projects);
codebaseViewer.expandAll();
- for(IProject project : initialSelection) {
- codebaseViewer.setSubtreeChecked(project, true);
- }
+ if(initialSelection != null) { // windowbuilder compat
+ for(IProject project : initialSelection) {
+ codebaseViewer.setSubtreeChecked(project, true);
+ }
- // Reveal the first element
- if(initialSelection.length > 0) {
- codebaseViewer.reveal(initialSelection[0]);
+ // Reveal the first element
+ if(initialSelection.length > 0) {
+ codebaseViewer.reveal(initialSelection[0]);
+ }
}
Tree tree = codebaseViewer.getTree();

Back to the top