Demos and Usage of org.eclipse.swt.widgets.ScrollBar.getSelection()


   1: import org.eclipse.swt.widgets.Table;
   2: import org.eclipse.swt.widgets.ScrollBar;
   3: import org.gudy.azureus2.core3.config.COConfigurationManager;
   4:         ...
   5:             return 0;
   6:         ScrollBar sb = t.getHorizontalBar();
   7:         if (sb == null)
   8:         ...
   9:             return 0;
  10:         return sb.getSelection();
  11:     }

View Full Code Here
   1: 
   2:     final ScrollBar vBar1 = sc1.getVerticalBar ();
   3:         ...
   4:     final ScrollBar vBar2 = sc2.getVerticalBar ();
   5:         ...
   6:     final ScrollBar hBar1 = sc1.getHorizontalBar ();
   7:     final ScrollBar hBar2 = sc2.getHorizontalBar ();
   8:         ...
   9:         public void widgetSelected (SelectionEvent e) {
  10:             int x =  hBar1.getSelection() * (hBar2.getMaximum() - hBar2.getThumb()) / Math.max(1, hBar1.getMaximum() - hBar1.getThumb());

View Full Code Here
   1:     };
   2:     final ScrollBar hBar = shell.getHorizontalBar();
   3:         ...
   4:     final ScrollBar vBar = shell.getVerticalBar();
   5:     hBar.addListener(SWT.Selection, scrollListener);
   6:         ...
   7:             gc.fillRectangle(rect);
   8:             int x = -hBar.getSelection();
   9:             int height = gc.stringExtent("").y;
  10:         ...
  11:             int start = vBar.getSelection();

View Full Code Here
   1: import org.eclipse.swt.widgets.Composite;
   2: import org.eclipse.swt.widgets.ScrollBar;
   3: import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
   4:         ...
   5:             }
   6:             ScrollBar bar =  page.viewer.getTree().getVerticalBar();
   7:             double selection = 0;
   8:         ...
   9:             if (bar != null) {
  10:                 selection = (0.0 + bar.getSelection()) / bar.getMaximum();
  11:             }

View Full Code Here
   1: import org.eclipse.swt.widgets.Composite;
   2: import org.eclipse.swt.widgets.ScrollBar;
   3: import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
   4:         ...
   5:             if (added) {
   6:                 ScrollBar bar =  page.viewer.getTree().getVerticalBar();
   7:                 double selection = 0;
   8:         ...
   9:                 if (bar != null) {
  10:                     selection = (0.0 + bar.getSelection()) / bar.getMaximum();
  11:                 }

View Full Code Here
   1:             if(st != null) {
   2:                 final ScrollBar sb = st.getVerticalBar();
   3:                 if(sb != null) {
   4:         ...
   5:                                     int x = stLoc.x+stSize.x-sbSize.x-extent.x-4;
   6:                                     mShell.setBounds(x,scrollTop + (sb.getSelection()-sb.getMinimum())*scrollHeight/(sb.getMaximum()-sb.getMinimum()),
   7:                                                      extent.x,extent.y);
   8:         ...
   9:             if(st != null) {
  10:                 ScrollBar sb = st.getVerticalBar();
  11:                 if(sb != null) {

View Full Code Here
   1: import org.eclipse.swt.events.SelectionListener;
   2: import org.eclipse.swt.widgets.ScrollBar;
   3: import org.eclipse.ui.dialogs.ListSelectionDialog;
   4:         ...
   5:             if (added) {
   6:                 ScrollBar bar =  page.viewer.getTree().getVerticalBar();
   7:                 double selection = 0;
   8:         ...
   9:                 if (bar != null) {
  10:                     selection = (0.0 + bar.getSelection()) / bar.getMaximum();
  11:                 }

View Full Code Here
   1: import org.eclipse.swt.widgets.Menu;
   2: import org.eclipse.swt.widgets.ScrollBar;
   3: import org.eclipse.swt.widgets.Table;
   4:         ...
   5: 
   6:         ScrollBar bar= getTable().getVerticalBar();
   7:         ...
   8:         int position= bar != null ? bar.getSelection() : 0;
   9:         memento.putString(TAG_VERTICAL_SCROLL, String.valueOf(position));
  10:         ...
  11:         
  12:         ScrollBar bar= getTable().getVerticalBar();

View Full Code Here
   1: import org.eclipse.swt.widgets.Composite;
   2: import org.eclipse.swt.widgets.ScrollBar;
   3: import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
   4:         ...
   5:             if (added) {
   6:                 ScrollBar bar =  page.viewer.getTree().getVerticalBar();
   7:                 double selection = 0;
   8:         ...
   9:                 if (bar != null) {
  10:                     selection = (0.0 + bar.getSelection()) / bar.getMaximum();
  11:                 }

View Full Code Here
   1:     super.setLayout(new ScrolledCompositeLayout());
   2:     ScrollBar hBar = getHorizontalBar ();
   3:     if (hBar != null) {
   4:         ...
   5:     
   6:     ScrollBar vBar = getVerticalBar ();
   7:     if (vBar != null) {
   8:         ...
   9:     Point location = content.getLocation ();
  10:     ScrollBar hBar = getHorizontalBar ();
  11:         ...
  12:     int hSelection = hBar.getSelection();

View Full Code Here
   1: import org.eclipse.swt.widgets.Menu;
   2: import org.eclipse.swt.widgets.ScrollBar;
   3: import org.eclipse.swt.widgets.Scrollable;
   4:         ...
   5:                 IStructuredSelection selection = (IStructuredSelection) event
   6:                         .getSelection();
   7:                 viewerSelectionChanged(selection);
   8:         ...
   9:         Scrollable scrollable = (Scrollable) viewer.getControl();
  10:         ScrollBar bar = scrollable.getVerticalBar();
  11:         if (bar != null) {
  12:         ...
  13:         Scrollable scrollable = (Scrollable) viewer.getControl();
  14:         ScrollBar bar = scrollable.getVerticalBar();

View Full Code Here
   1: import org.eclipse.swt.widgets.Menu;
   2: import org.eclipse.swt.widgets.ScrollBar;
   3: import org.eclipse.swt.widgets.Scrollable;
   4:         ...
   5:                 handleSelectionChanged((IStructuredSelection) event
   6:                         .getSelection());
   7:             }
   8:         ...
   9:                 public ShowInContext getShowInContext() {
  10:                     return new ShowInContext(null, getViewer().getSelection());
  11:                 }
  12:         ...
  13:         if (MarkerTransfer.getInstance().isSupportedType(event.dataType)) {
  14:             event.data = ((IStructuredSelection) viewer.getSelection())

View Full Code Here
   1: import org.eclipse.swt.widgets.Label;
   2: import org.eclipse.swt.widgets.ScrollBar;
   3: import org.eclipse.swt.widgets.ToolBar;
   4:         ...
   5: 
   6:         fActionGroups.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
   7:         fActionGroups.fillContextMenu(menu);
   8:         ...
   9:         fMethodsViewer.contributeToContextMenu(menu);
  10:         fActionGroups.setContext(new ActionContext(getSite().getSelectionProvider().getSelection()));
  11:         fActionGroups.fillContextMenu(menu);
  12:         ...
  13:         if (e.getSelectionProvider() == fMethodsViewer) {
  14:             methodSelectionChanged(e.getSelection());

View Full Code Here
   1: 
   2:     private ScrollBar vBar;
   3: 
   4:         ...
   5:                                             public void runSupport() {
   6:                                                 scrollTo(vBar.getSelection());
   7:                                             }
   8:         ...
   9:                 } else {
  10:                     scrollTo(vBar.getSelection());
  11:                 }
  12:         ...
  13:             vBar.setPageIncrement(client.height / 2);
  14:             if (iLastVBarPos != vBar.getSelection()) {

View Full Code Here
   1:             } else {
   2:                 this.fSelection = viewer.getSelection();
   3:                 this.fTopIndex = viewer.getTopIndex();
   4:         ...
   5:         public Point getSelection() {
   6:             return fFocusPart.getFindReplaceTarget().getSelection();
   7:         }
   8:         ...
   9:                 public void handleEvent(Event e) {
  10:                     int vpos= ((ScrollBar)e.widget).getSelection();
  11:                     synchronizedScrollVertical(vpos);
  12:         ...
  13:         final StyledText st3= tv3.getTextWidget();
  14:         final ScrollBar sb1= st1.getHorizontalBar();

View Full Code Here