summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorDME2013-08-13 05:27:57 (EDT)
committer Paul Webster2013-08-13 10:03:47 (EDT)
commit5ef642c5cdbd19e171252be4a977bfa31dea0027 (patch)
treea4845a36151c47963cb9d69814c6ca3d22962516
parent11849032c5d770fd1326a99aa96fcb25ea049810 (diff)
downloadeclipse.platform.ui-5ef642c5cdbd19e171252be4a977bfa31dea0027.zip
eclipse.platform.ui-5ef642c5cdbd19e171252be4a977bfa31dea0027.tar.gz
eclipse.platform.ui-5ef642c5cdbd19e171252be4a977bfa31dea0027.tar.bz2
Bug 414741 - ToolbarControl in own ToolBar throws NPErefs/changes/87/15287/5
Set default contribution cureSide to SWT.TOP Change-Id: Ie6728bf14bb7ece05d68c8e904760d29bfcf9181 Signed-off-by: DME <dennis.m@web.de>
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/CompatibilityWorkbenchWindowControlContribution.java31
1 files changed, 18 insertions, 13 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/CompatibilityWorkbenchWindowControlContribution.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/CompatibilityWorkbenchWindowControlContribution.java
index ef0bd8b..b84c248 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/CompatibilityWorkbenchWindowControlContribution.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/menus/CompatibilityWorkbenchWindowControlContribution.java
@@ -63,23 +63,28 @@ public class CompatibilityWorkbenchWindowControlContribution {
}
MUIElement parent = toolControl.getParent();
- while (!(parent instanceof MTrimBar)) {
+ while (!(parent instanceof MTrimBar) && parent != null) {
parent = parent.getParent();
}
- switch (((MTrimBar) parent).getSide()) {
- case BOTTOM:
- contribution.setCurSide(SWT.BOTTOM);
- break;
- case LEFT:
- contribution.setCurSide(SWT.LEFT);
- break;
- case RIGHT:
- contribution.setCurSide(SWT.RIGHT);
- break;
- case TOP:
+ if (parent instanceof MTrimBar) {
+ switch (((MTrimBar) parent).getSide()) {
+ case BOTTOM:
+ contribution.setCurSide(SWT.BOTTOM);
+ break;
+ case LEFT:
+ contribution.setCurSide(SWT.LEFT);
+ break;
+ case RIGHT:
+ contribution.setCurSide(SWT.RIGHT);
+ break;
+ case TOP:
+ contribution.setCurSide(SWT.TOP);
+ break;
+ }
+ } else {
+ // default position
contribution.setCurSide(SWT.TOP);
- break;
}
contribution.delegateCreateControl(composite);