protected int getTableWidth( Table table ) { int width = table.getSize().x - 2; if ( table.getVerticalBar() != null && table.getVerticalBar().isVisible() ) { width -= table.getVerticalBar().getSize().x; } return width; }
final boolean was_visible = getVerticalBar().isVisible();
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; } } return trim; }
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; } } return trim; }
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; } } return trim; }
return; if (this.fScrollBar.isVisible()) { if (fCheckedTimes > 20) {
&& (verticalBar == null || !verticalBar.isVisible())) { showItem (0); } else {
public void controlResized( ControlEvent e ) { if ( tree.getClientArea().width > 0 ) { int width = tree.getClientArea().width - 2 * tree.getBorderWidth(); if ( tree.getVerticalBar().isVisible() ) { width -= tree.getVerticalBar().getSize().x; } tree.getColumn( EntryEditorWidgetTableMetadata.VALUE_COLUMN_INDEX ).setWidth( width - tree.getColumn( EntryEditorWidgetTableMetadata.KEY_COLUMN_INDEX ).getWidth() ); } } } );
/** * Update the scrollbars * * @return true if we need to relayout the whole thing */ protected boolean updateScrollBars() { Point size = getScreenSize(); ScrollBar hBar = getHorizontalBar(), vBar = getVerticalBar(); boolean needRelayout = false; hBar.setMaximum(_drawnSize.x); hBar.setThumb(Math.min(_drawnSize.x, size.x)); hBar.setIncrement(15); // TODO something meaningful ? hBar.setPageIncrement(size.x); boolean visible = !(_origin.x == 0 && _drawnSize.x <= size.x); hBar.setVisible(visible); size = getScreenSize(); vBar.setMaximum(_drawnSize.y); vBar.setThumb(Math.min(_drawnSize.y, size.y)); vBar.setIncrement(15); // TODO line height here vBar.setPageIncrement(size.y); visible = !(_origin.y == 0 && _drawnSize.y <= size.y); if (!isPrint() && vBar.isVisible() != visible) { needRelayout = true; } vBar.setVisible(visible); return needRelayout; }
vBar.setVisible(false); } else { if (!vBar.isVisible()) { vBar.setVisible(true); vBar.setEnabled(true); int tableSize = cTable.getSize().x; int max = columnsWidth; if (vBarValid && vBar.isVisible() && getScrollbarsMode() == SWT.NONE) { int vBarW = vBar.getSize().x; hBar.setVisible(false); } else { if (!hBar.isVisible()) { hBar.setVisible(true); hBar.setEnabled(true); if (vBarValid && hBar.isVisible()) { int hBarW = getScrollbarsMode() == SWT.NONE ? hBar.getSize().y : 0;
if (verticalBar != null && scrollable.getScrollbarsMode() == SWT.NONE && !verticalBar.isVisible()) { fixedWidth += verticalBar.getSize().x;
if (verticalBar != null && scrollable.getScrollbarsMode() == SWT.NONE && !verticalBar.isVisible()) { fixedWidth += verticalBar.getSize().x;
int emptyHBarSpace = hBar.isVisible () ? 0 : hBar.getSize ().y; list.setSize (listRect.width, listRect.height - emptyHBarSpace); popup.setBounds (x, y, width, height - emptyHBarSpace);
int emptyHBarSpace = hBar.isVisible () ? 0 : hBar.getSize ().y; list.setSize (listRect.width, listRect.height - emptyHBarSpace); popup.setBounds (x, y, width, height - emptyHBarSpace);
int emptyHBarSpace = hBar.isVisible () ? 0 : hBar.getSize ().y; list.setSize (listRect.width, listRect.height - emptyHBarSpace); popup.setBounds (x, y, width, height - emptyHBarSpace);
int emptyHBarSpace = hBar.isVisible () ? 0 : hBar.getSize ().y; list.setSize (listRect.width, listRect.height - emptyHBarSpace); popup.setBounds (x, y, width, height - emptyHBarSpace);