Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/ColumnLayout.java')
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/ColumnLayout.java62
1 files changed, 31 insertions, 31 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/ColumnLayout.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/ColumnLayout.java
index ee22664199f..f0d77999ae1 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/ColumnLayout.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/templates/ColumnLayout.java
@@ -188,41 +188,41 @@ final class ColumnLayout extends Layout {
@Override
protected void layout(Composite composite, boolean flushCache) {
- Rectangle area= composite.getClientArea();
- Table table= getTable(composite);
- int tableWidth= table.getSize().x;
- int trim= computeTrim(area, table, tableWidth);
- int width= Math.max(0, area.width - trim);
-
- if (width > 1)
- layoutTable(table, width, area, tableWidth < area.width);
-
- if( composite.getData(RECALCULATE_LAYOUT) == null ) {
- composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE);
- composite.layout();
- }
+ Rectangle area= composite.getClientArea();
+ Table table= getTable(composite);
+ int tableWidth= table.getSize().x;
+ int trim= computeTrim(area, table, tableWidth);
+ int width= Math.max(0, area.width - trim);
+
+ if (width > 1)
+ layoutTable(table, width, area, tableWidth < area.width);
+
+ if( composite.getData(RECALCULATE_LAYOUT) == null ) {
+ composite.setData(RECALCULATE_LAYOUT, Boolean.FALSE);
+ composite.layout();
+ }
}
private int computeTrim(Rectangle area, Table table, int tableWidth) {
Point preferredSize= computeTableSize(table, area.width, area.height);
- int trim;
- if (tableWidth > 1) {
- trim= tableWidth - table.getClientArea().width;
- } else {
- // initially, the table has no extend and no client area - use the border with
- // plus some padding as educated guess
- trim= 2 * table.getBorderWidth() + 1 ;
- }
- if (preferredSize.y > area.height) {
- // Subtract the scrollbar width from the total column width
- // if a vertical scrollbar will be required, but is not currently showing
- // (in which case it is already subtracted above)
- ScrollBar vBar= table.getVerticalBar();
- if (!vBar.isVisible()) {
- Point vBarSize= vBar.getSize();
- trim += vBarSize.x;
- }
- }
+ int trim;
+ if (tableWidth > 1) {
+ trim= tableWidth - table.getClientArea().width;
+ } else {
+ // initially, the table has no extend and no client area - use the border with
+ // plus some padding as educated guess
+ trim= 2 * table.getBorderWidth() + 1 ;
+ }
+ if (preferredSize.y > area.height) {
+ // Subtract the scrollbar width from the total column width
+ // if a vertical scrollbar will be required, but is not currently showing
+ // (in which case it is already subtracted above)
+ ScrollBar vBar= table.getVerticalBar();
+ if (!vBar.isVisible()) {
+ Point vBarSize= vBar.getSize();
+ trim += vBarSize.x;
+ }
+ }
return trim;
}

Back to the top