private static boolean hasVScrollBar( final ScrolledComposite composite ) { ScrollBar verticalBar = composite.getVerticalBar(); return verticalBar != null && verticalBar.getVisible(); }
private static Point getOrigin( ScrolledComposite composite ) { Point result = new Point( 0, 0 ); ScrollBar horizontalBar = composite.getHorizontalBar(); if( horizontalBar != null ) { result.x = horizontalBar.getSelection(); } ScrollBar verticalBar = composite.getVerticalBar(); if( verticalBar != null ) { result.y = verticalBar.getSelection(); } return result; }
void vScroll() { if (content == null) return; Point location = content.getLocation (); ScrollBar vBar = getVerticalBar (); int vSelection = vBar.getSelection (); content.setLocation (location.x, -vSelection); } }
void vScroll() { if (content == null) return; Point location = content.getLocation (); ScrollBar vBar = getVerticalBar (); int vSelection = vBar.getSelection (); content.setLocation (location.x, -vSelection); } }
void vScroll() { if (content == null) return; Point location = content.getLocation (); ScrollBar vBar = getVerticalBar (); int vSelection = vBar.getSelection (); content.setLocation (location.x, -vSelection); } }
void vScroll() { if (content == null) return; Point location = content.getLocation (); ScrollBar vBar = getVerticalBar (); int vSelection = vBar.getSelection (); content.setLocation (location.x, -vSelection); } }
void vScroll() { if (content == null) return; Point location = content.getLocation (); ScrollBar vBar = getVerticalBar (); int vSelection = vBar.getSelection (); content.setLocation (location.x, -vSelection); } }
private void createContentArea() { scrollable = new ScrolledComposite(sash, SWT.H_SCROLL | SWT.V_SCROLL); scrollable.getVerticalBar().setIncrement(20); scrollable.setExpandHorizontal(true); scrollable.setExpandVertical(true); content = new Composite(scrollable, SWT.NONE); content.setLayout(new GridLayout()); content.setFont(JFaceResources.getDialogFont()); ExtdocUtils.setInfoBackgroundColor(content); scrollable.setContent(content); }
boolean needHScroll(Rectangle contentRect, boolean vVisible) { ScrollBar hBar = getHorizontalBar(); if (hBar == null) return false; Rectangle hostRect = getBounds(); int border = getBorderWidth(); hostRect.width -= 2*border; ScrollBar vBar = getVerticalBar(); if (vVisible && vBar != null) hostRect.width -= vBar.getSize().x; if (!expandHorizontal && contentRect.width > hostRect.width) return true; if (expandHorizontal && minWidth > hostRect.width) return true; return false; }
boolean needHScroll(Rectangle contentRect, boolean vVisible) { ScrollBar hBar = getHorizontalBar(); if (hBar == null) return false; Rectangle hostRect = getBounds(); int border = getBorderWidth(); hostRect.width -= 2*border; ScrollBar vBar = getVerticalBar(); if (vVisible && vBar != null) hostRect.width -= vBar.getSize().x; if (!expandHorizontal && contentRect.width > hostRect.width) return true; if (expandHorizontal && minWidth > hostRect.width) return true; return false; }
boolean needVScroll(Rectangle contentRect, boolean hVisible) { ScrollBar vBar = getVerticalBar(); if (vBar == null) return false; Rectangle hostRect = getBounds(); int border = getBorderWidth(); hostRect.height -= 2*border; ScrollBar hBar = getHorizontalBar(); if (hVisible && hBar != null) hostRect.height -= hBar.getSize().y; if (!expandVertical && contentRect.height > hostRect.height) return true; if (expandVertical && minHeight > hostRect.height) return true; return false; }
boolean needVScroll(Rectangle contentRect, boolean hVisible) { ScrollBar vBar = getVerticalBar(); if (vBar == null) return false; Rectangle hostRect = getBounds(); int border = getBorderWidth(); hostRect.height -= 2*border; ScrollBar hBar = getHorizontalBar(); if (hVisible && hBar != null) hostRect.height -= hBar.getSize().y; if (!expandVertical && contentRect.height > hostRect.height) return true; if (expandVertical && minHeight > hostRect.height) return true; return false; }
boolean needHScroll(Rectangle contentRect, boolean vVisible) { ScrollBar hBar = getHorizontalBar(); if (hBar == null) return false; Rectangle hostRect = getBounds(); int border = getBorderWidth(); hostRect.width -= 2*border; ScrollBar vBar = getVerticalBar(); if (vVisible && vBar != null) hostRect.width -= vBar.getSize().x; if (!expandHorizontal && contentRect.width > hostRect.width) return true; if (expandHorizontal && minWidth > hostRect.width) return true; return false; }
boolean needVScroll(Rectangle contentRect, boolean hVisible) { ScrollBar vBar = getVerticalBar(); if (vBar == null) return false; Rectangle hostRect = getBounds(); int border = getBorderWidth(); hostRect.height -= 2*border; ScrollBar hBar = getHorizontalBar(); if (hVisible && hBar != null) hostRect.height -= hBar.getSize().y; if (!expandVertical && contentRect.height > hostRect.height) return true; if (expandVertical && minHeight > hostRect.height) return true; return false; }
boolean needVScroll(Rectangle contentRect, boolean hVisible) { ScrollBar vBar = getVerticalBar(); if (vBar == null) return false; Rectangle hostRect = getBounds(); int border = getBorderWidth(); hostRect.height -= 2*border; ScrollBar hBar = getHorizontalBar(); if (hVisible && hBar != null) hostRect.height -= hBar.getSize().y; if (!expandVertical && contentRect.height > hostRect.height) return true; if (expandVertical && minHeight > hostRect.height) return true; return false; }
boolean needHScroll(Rectangle contentRect, boolean vVisible) { ScrollBar hBar = getHorizontalBar(); if (hBar == null) return false; Rectangle hostRect = getBounds(); int border = getBorderWidth(); hostRect.width -= 2*border; ScrollBar vBar = getVerticalBar(); if (vVisible && vBar != null) hostRect.width -= vBar.getSize().x; if (!expandHorizontal && contentRect.width > hostRect.width) return true; if (expandHorizontal && minWidth > hostRect.width) return true; return false; }
boolean needHScroll(Rectangle contentRect, boolean vVisible) { ScrollBar hBar = getHorizontalBar(); if (hBar == null) return false; Rectangle hostRect = getBounds(); int border = getBorderWidth(); hostRect.width -= 2*border; ScrollBar vBar = getVerticalBar(); if (vVisible && vBar != null) hostRect.width -= vBar.getSize().x; if (!expandHorizontal && contentRect.width > hostRect.width) return true; if (expandHorizontal && minWidth > hostRect.width) return true; return false; }
boolean needVScroll(Rectangle contentRect, boolean hVisible) { ScrollBar vBar = getVerticalBar(); if (vBar == null) return false; Rectangle hostRect = getBounds(); int border = getBorderWidth(); hostRect.height -= 2*border; ScrollBar hBar = getHorizontalBar(); if (hVisible && hBar != null) hostRect.height -= hBar.getSize().y; if (!expandVertical && contentRect.height > hostRect.height) return true; if (expandVertical && minHeight > hostRect.height) return true; return false; }
public void handleSetOrigin( ScrolledComposite composite, JsonObject properties ) { Point origin = composite.getOrigin(); JsonValue hSelection = properties.get( PARAM_H_BAR_SELECTION ); if( hSelection != null && composite.getHorizontalBar() != null ) { origin.x = hSelection.asInt(); } JsonValue vSelection = properties.get( PARAM_V_BAR_SELECTION ); if( vSelection != null && composite.getVerticalBar() != null ) { origin.y = vSelection.asInt(); } composite.setOrigin( origin ); }
public void controlResized(ControlEvent e) { Rectangle clientArea = fScrolledComposite.getClientArea(); ScrollBar verticalBar= fScrolledComposite.getVerticalBar(); verticalBar.setIncrement(VERTICAL_SCROLL_INCREMENT); verticalBar.setPageIncrement(clientArea.height - verticalBar.getIncrement()); ScrollBar horizontalBar= fScrolledComposite.getHorizontalBar(); horizontalBar.setIncrement(HORIZONTAL_SCROLL_INCREMENT); horizontalBar.setPageIncrement(clientArea.width - horizontalBar.getIncrement()); } });