Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemy Suen2012-02-02 15:51:57 +0000
committerRemy Suen2012-02-02 15:51:57 +0000
commit391d4d71a020048e9b8586486fca0ed72ba8afbf (patch)
tree297f52ea4a6fba4374c2b67c5d4d8f0e89f7dd8c
parent5c045195ea4f561eb3ed6e9a4df32d307ffd4f8a (diff)
downloadeclipse.platform.ui-391d4d71a020048e9b8586486fca0ed72ba8afbf.tar.gz
eclipse.platform.ui-391d4d71a020048e9b8586486fca0ed72ba8afbf.tar.xz
eclipse.platform.ui-391d4d71a020048e9b8586486fca0ed72ba8afbf.zip
Bug 330117 No separation between view toolbar, view description and viewv20120202-1551I20120202-2200I20120202-1500
content Add a separator back between a view's content and its description.
-rw-r--r--bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ContributedPartRenderer.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ContributedPartRenderer.java b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ContributedPartRenderer.java
index 890bc716f43..2b70ac8483d 100644
--- a/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ContributedPartRenderer.java
+++ b/bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/ContributedPartRenderer.java
@@ -152,14 +152,18 @@ public class ContributedPartRenderer extends SWTPartRenderer {
Composite c = (Composite) part.getWidget();
// Do we already have a label?
- if (c.getChildren().length == 2) {
+ if (c.getChildren().length == 3) {
Label label = (Label) c.getChildren()[0];
if (description == null)
description = ""; //$NON-NLS-1$
// hide the label if there is no text to show
- label.setVisible(!description.equals("")); //$NON-NLS-1$
+ boolean hasText = !description.equals(""); //$NON-NLS-1$
+ label.setVisible(hasText);
label.setText(description);
label.setToolTipText(description);
+
+ // also hide the separator
+ c.getChildren()[1].setVisible(hasText);
c.layout();
} else if (c.getChildren().length == 1) {
c.setLayout(new Layout() {
@@ -176,26 +180,34 @@ public class ContributedPartRenderer extends SWTPartRenderer {
if (composite.getChildren().length == 1) {
composite.getChildren()[0].setBounds(composite
.getBounds());
- } else if (composite.getChildren().length == 2) {
+ } else if (composite.getChildren().length == 3) {
Label label = (Label) composite.getChildren()[0];
- Control partCtrl = composite.getChildren()[1];
+ Label separator = (Label) composite.getChildren()[1];
+ Control partCtrl = composite.getChildren()[2];
// if the label is not visible, give it a zero size
int labelHeight = label.isVisible() ? label
.computeSize(bounds.width, SWT.DEFAULT).y : 0;
label.setBounds(0, 0, bounds.width, labelHeight);
- partCtrl.setBounds(0, labelHeight, bounds.width,
- bounds.height - labelHeight);
+ int separatorHeight = separator.isVisible() ? separator
+ .computeSize(bounds.width, SWT.DEFAULT).y : 0;
+ separator.setBounds(0, labelHeight, bounds.width,
+ separatorHeight);
+
+ partCtrl.setBounds(0, labelHeight + separatorHeight,
+ bounds.width, bounds.height - labelHeight
+ - separatorHeight);
}
}
});
- Control partCtrl = c.getChildren()[0];
+ Label separator = new Label(c, SWT.SEPARATOR | SWT.HORIZONTAL);
+ separator.moveAbove(null);
Label label = new Label(c, SWT.NONE);
label.setText(description);
label.setToolTipText(description);
- label.moveAbove(partCtrl);
+ label.moveAbove(null);
c.layout();
}
}

Back to the top