sbHorizontal.setSelection( 0 ); sbHorizontal.setVisible( false ); } else { sbVertical.setSelection( 0 ); sbVertical.setVisible( false ); } else {
private static void setScrollBarSelection( ScrollBar scrollBar, int selection ) { if( scrollBar != null ) { scrollBar.setSelection( selection ); } }
private static void setScrollBarSelection( ScrollBar scrollBar, int selection ) { if( scrollBar != null ) { scrollBar.setSelection( selection ); } }
private static void setScrollBarSelection( ScrollBar scrollBar, int selection ) { if( scrollBar != null ) { scrollBar.setSelection( selection ); } }
void resetScrollBars() { if (image == null) return; ix = 0; iy = 0; py = 0; resizeScrollBars(); imageCanvas.getHorizontalBar().setSelection(0); imageCanvas.getVerticalBar().setSelection(0); paletteCanvas.getVerticalBar().setSelection(0); }
/** * {@inheritDoc} */ public void setSelection(int selection) { // RAP [if]: ScrollBar#setSelection() does not limit the value // scrollBar.setSelection(selection); int minimum = scrollBar.getMinimum(); int maximum = scrollBar.getMaximum(); int thumb = scrollBar.getThumb(); if( selection < minimum ) { scrollBar.setSelection( minimum ); } else if ( selection > maximum - thumb ) { scrollBar.setSelection( maximum - thumb ); } else { scrollBar.setSelection( selection ); } }
@Override public void runSupport() { if (isDisposed()) { return; } int pos = vBar.getSelection(); if ( distance > 0 ){ pos += distance; pos = Math.min( pos,vBar.getMaximum()); vBar.setSelection( pos ); }else{ pos += distance; pos = Math.max( pos,vBar.getMinimum()); vBar.setSelection( pos ); } swt_vBarChanged(); }}); }
/** * Set the origin of the view. NOTE: this won't be done immediately. * * @param pt */ public void setOrigin(Point pt) { Point p = checkOrigin(pt); if (p.equals(_origin)) return; getHorizontalBar().setSelection(p.x); getVerticalBar().setSelection(p.y); scrollTo(p); }
void updateScrollbars(boolean adaptToScrollbar) { final Rectangle rect = image.getBounds(); final Rectangle client = canvas.getClientArea(); hBar.setMaximum(rect.width); vBar.setMaximum(rect.height); hBar.setThumb(Math.min(rect.width, client.width)); vBar.setThumb(Math.min(rect.height, client.height)); if (!adaptToScrollbar) { final org.eclipse.swt.graphics.Point center = getCenteredOrigin(); hBar.setSelection(-center.x); vBar.setSelection(-center.y); } }
public void scrollToEnd() { SWTAsync.assertGUI(); ScrollBar sb = consoleText.getVerticalBar(); if (sb != null) { sb.setSelection(sb.getMaximum()); } }
public void setImage(Image img) { fImage= img; if (!isDisposed()) { getHorizontalBar().setSelection(0); getVerticalBar().setSelection(0); updateScrollbars(); getParent().layout(); redraw(); } }
public void setImage(Image img) { fImage= img; if (!isDisposed()) { getHorizontalBar().setSelection(0); getVerticalBar().setSelection(0); updateScrollbars(); getParent().layout(); redraw(); } }
private void syncViewport(MergeSourceViewer w) { if (fInScrolling) return; int ix= w.getTopIndex(); int ix2= w.getDocumentRegionOffset(); int viewPosition= realToVirtualPosition(w, ix-ix2); scrollVertical(viewPosition, viewPosition, viewPosition, w); // scroll all but the given views if (fVScrollBar != null) { int value= Math.max(0, Math.min(viewPosition, getVirtualHeight() - getViewportHeight())); fVScrollBar.setSelection(value); //refreshBirdEyeView(); } }
@Override public void run() { if (styledText == null) return; int i; long start = System.currentTimeMillis(); for (i = 0; i < lineCount; i++) { if (lineHeight[i] == -1 || lineWidth[i] == -1) { calculate(i, 1); if (System.currentTimeMillis() - start > IDLE_TIME) break; } } if (i < lineCount) { Display display = styledText.getDisplay(); display.asyncExec(this); } else { idleRunning = false; styledText.setScrollBars(true); ScrollBar bar = styledText.getVerticalBar(); if (bar != null) { bar.setSelection(styledText.getVerticalScrollOffset()); } } } };
@Override public void run() { if (styledText == null) return; int i; long start = System.currentTimeMillis(); for (i = 0; i < lineCount; i++) { if (lineHeight[i] == -1 || lineWidth[i] == -1) { calculate(i, 1); if (System.currentTimeMillis() - start > IDLE_TIME) break; } } if (i < lineCount) { Display display = styledText.getDisplay(); display.asyncExec(this); } else { idleRunning = false; styledText.setScrollBars(true); ScrollBar bar = styledText.getVerticalBar(); if (bar != null) { bar.setSelection(styledText.getVerticalScrollOffset()); } } } };
private static void processScrollBarSelection( final ScrollBar scrollBar, final int selection ) { if( scrollBar != null ) { scrollBar.setSelection( selection ); if( SelectionEvent.hasListener( scrollBar ) ) { int eventId = SelectionEvent.WIDGET_SELECTED; SelectionEvent evt = new SelectionEvent( scrollBar, null, eventId ); evt.stateMask = EventLCAUtil.readStateMask( JSConst.EVENT_WIDGET_SELECTED_MODIFIER ); evt.processEvent(); } } }
private static void processScrollBarSelection( final ScrollBar scrollBar, final int selection ) { if( scrollBar != null ) { scrollBar.setSelection( selection ); if( SelectionEvent.hasListener( scrollBar ) ) { int eventId = SelectionEvent.WIDGET_SELECTED; SelectionEvent evt = new SelectionEvent( scrollBar, null, eventId ); evt.stateMask = EventLCAUtil.readStateMask( JSConst.EVENT_WIDGET_SELECTED_MODIFIER ); evt.processEvent(); } } }
private void syncViewport(MergeSourceViewer w) { if (fInScrolling) return; int ix= w.getSourceViewer().getTopIndex(); int ix2= w.getDocumentRegionOffset(); int viewPosition= realToVirtualPosition(getLeg(w), ix-ix2); scrollVertical(viewPosition, viewPosition, viewPosition, w); // scroll all but the given views if (fVScrollBar != null) { int value= Math.max(0, Math.min(viewPosition, fMerger.getVirtualHeight() - getViewportHeight())); fVScrollBar.setSelection(value); //refreshBirdEyeView(); } }
/** * Restores the state of the filter actions * @param memento the memento */ public void restoreState(IMemento memento) { fMemberFilterActionGroup.restoreState(memento); getControl().setRedraw(false); refresh(); getControl().setRedraw(true); boolean showInherited= Boolean.valueOf(memento.getString(TAG_SHOWINHERITED)).booleanValue(); showInheritedMethods(showInherited); boolean showDefiningTypes= Boolean.valueOf(memento.getString(TAG_SORTBYDEFININGTYPE)).booleanValue(); sortByDefiningType(showDefiningTypes); ScrollBar bar= getTable().getVerticalBar(); if (bar != null) { Integer vScroll= memento.getInteger(TAG_VERTICAL_SCROLL); if (vScroll != null) { bar.setSelection(vScroll.intValue()); } } }
/** * Restores the state of the filter actions * @param memento the memento */ public void restoreState(IMemento memento) { fMemberFilterActionGroup.restoreState(memento); getControl().setRedraw(false); refresh(); getControl().setRedraw(true); boolean showInherited= Boolean.valueOf(memento.getString(TAG_SHOWINHERITED)).booleanValue(); showInheritedMethods(showInherited); boolean showDefiningTypes= Boolean.valueOf(memento.getString(TAG_SORTBYDEFININGTYPE)).booleanValue(); sortByDefiningType(showDefiningTypes); ScrollBar bar= getTable().getVerticalBar(); if (bar != null) { Integer vScroll= memento.getInteger(TAG_VERTICAL_SCROLL); if (vScroll != null) { bar.setSelection(vScroll.intValue()); } } }